Build an Accurate Milliohm Meter

A milliohm meter is a handy benchtop tool for measuring small electrical resistance values. In this article, Mark Driedger details how to build a microcontroller-based milliohm meter that accurately measures DC resistance from 10 mΩ to 10 kΩ.

I built an Arduino-based milliohm meter that accurately measures DC resistance from 10 mΩ to 10 kΩ. I used careful design techniques to cancel many error sources rather than resort to costly components. The milliohm meter is useful for tasks such as measuring transformer and inductor winding resistance, ammeter current shunts, and resistance of PCB tracks.

The finished milliohm meter

The finished milliohm meter

Measurement Method

The milliohm meter calculates the value of the resistor under test (Rx) by measuring the voltage across it and the voltage across a series-connected, known reference resistor (Rr) when driven by a test current. The measured resistance is simply: Rx = Vx/Vr × Rr.

A technique called synchronous rectification (also known as a lock-in amplifier) is used to enhance accuracy. The direction of the test current is alternated and measurements of Vx and Vr are made synchronously with the change in direction of the test current. As we will see, this cancels a number of error sources and is easy to implement on the Arduino.

Synchronous rectification can be thought of as narrowband filter at the switching frequency, implemented using a mixer (multiplier) at the switching frequency followed by a low-pass filter at DC (averaging). Normally, the switching frequency would be high enough (say, 1 kHz) to allow AC-coupled, high-gain amplifiers to be used and to move the filter passband well away from induced 60-Hz AC line voltages. In this implementation, the relatively slow ADC conversion speed prevents us from using a high switching frequency. However, we retain many other benefits of synchronous rectification with regard to reducing measurement error and we gain accuracy improvement in other ways.


An Arduino is used to control the synchronous rectification, read voltages Vx and Vr, and then compute and display the test resistor value. The test current is derived by paralleling four I/O pins through current-limiting resistors for each of the source and sink legs.

sad dsg

The circuitry

This increases the test current to roughly 100 mA, which is still well within the 40 mA/pin and 200 mA/chip limits of the Arduino processor, and the 150 mA limit of the Pro Mini’s onboard voltage regulator. The source and sink legs are alternately driven high and low to produce the test current.

sdfg sdgf

A look inside the meter

Measurement of Vx and Vr is made with an Analog Devices ADS1115 ADC, which has two differential inputs, a programmable gain amplifier (PGA) with 16× maximum gain, and 16-bit accuracy in a very small 10 MSOP package. The device costs between $10 and $15 on a small PCB module. Series resistors and film capacitors on the analog inputs provide some overload protection and noise filtering. At the highest gain, the meter resolution is approximately 75 µΩ/bit. Each measurement consists of two cycles of synchronous rectification, with 100 samples per cycle for a total of 200 samples.

An OLED module with an I2C interface is used for the display, although other options can be substituted with corresponding code changes. The meter is powered by a 9-V battery. Battery voltage is read through one of the analog input ports. Measurements are initiated with the push of the test switch to maximize battery life and minimize self-heating errors in the reference resistor. Each measurement takes roughly 2 s. Purchased modules are used for the Arduino, ADS1115 ADC, and the 64 × 128 OLED display, making it very easy to build.


OLED for displaying data


The meter is built using purchased modules and a small piece of protoboard for the shield. The ADC and display modules are available from multiple sources, and you can use any Arduino module of your choosing. (The photos and layout are for the Pro Mini.) Keep the ADC analog input wiring short and away from the processor. Use a four-wire connection to the reference resistor. Solder the drive leads farthest from the body, and the sense leads closer. The display module is mounted on the reverse side of the protoboard. The SDA/SCL I2C connections are brought from the Arduino module to the protoboard with a short cable and connector since they are not on the regular 0.1” grid.

dsf dsf

Protoboard layout

The ADS1115 module includes the pull-ups that are needed on the I2C interface lines (SDA, SCL).  I used a six-pin GX-16-6 connector for the probes. The additional two pins were used to close the battery circuit on the ground side, turning the meter on and off when the probes are connected.

The complete article appears in Circuit Cellar 314 (September 2016).

Mark Driedger has been experimenting with tube audio and electronics for over 35 years. His earned a BSc and MSc in Electrical Engineering in his native Canada. Mark has worked in the telecom industry for the past 28 years in various technical, business, and executive roles. He is currently COO for Procera Networks and lives in Dallas, TX.

Issue 286: EQ Answers

Question 1—A divider is a logic module that takes two binary numbers and produces their numerical quotient (and optionally, the remainder). The basic structure is a series of subtractions and multiplexers, where the multiplexer uses the result of the subtraciton to select the value that gets passed to the next step. The quotient is formed from the bits used to control the multiplexers, and the remainder is the result of the last subtraction.

If it is implemented purely combinatorially, then the critical path through all of this logic is quite long (even with carry-lookahead in the subtractors) and the clock cycle must be very slow. What could be done to shorten the clock period without losing the ability to get a result on every clock?

Answer 1—Pretty much any large chunk of combinatorial logic can be pipelined in order to reduce the clock period. This allows it to produce more results in a given amount of time, at the expense of increasing the latency for any particular result.

Divider logic is very easy to pipeline, and the number of pipeline stages you can use is fairly arbitrary. You could insert a pipeline register after each subtract-mux pair, or you might choose to do two or more subtract-mux stages per pipeline register You could even go so far as to pipeline the subtracts and the muxes separately (or even pipeline *within* each subtract) in order to get the fastest possible clock speed, but this would be rather extreme.

The more pipeline registers you use, the shorter the critical path (and the clock period) can be, but you use more resources (the registers). Also, the overall latency goes up, since you need to account for the setup and propagation times of the pipeline registers in the clock period (in addition to the subtract-mux logic delays). This gets multiplied by the number of pipeline stages in order to compute the total latency.

Question 2—On the other hand, what could be done to reduce the amount of logic required for the divider, giving up the ability to have a result on every clock?


Answer 2—If you don’t need the level of performance provided by a pipelined divider, you can computes the quotient serially, one bit at a time. You would just need one subtractor and one multiplexer, along with registers to hold the input values, quotient bits and the intermediate result.

You could potentially compute more than one bit per clock period using additional subtract-mux stages. This gives you the flexibility to trade off space and time as needed for a particular application.

Question 3—An engineer wanted to build an 8-MHz filter that had a very narrow bandwidth, so he used a crystal lattice filter like this:


However, when he built and tested his filter, he discovered that while it worked fine around 8 MHz, the attenuation at very high frequencies (e.g., >80 MHz) was very much reduced. What caused this?

Answer 3—The equivalent circuit for a quartz crystal is something like this:EQ-fig2-CC287-June14

The components across the bottom represent the mechanical resonance of the crystal itself, while the capacitor at the top represents the capacitance of the electrodes and holder. Typical values are:

  • Cser: 10s of fF (yes, femtofarads, 10-15F)
  • L: 10s of mH
  • R: 10s of ohms
  • Cpar: 10s of pF

The crystal has a series-resonant frequency based on just Cser and L. It has a relatively low impedance (basically just R) at this frequency.

It also has a parallel-resonant (sometimes called “antiresonant”) frequency when you consider the entire loop, including Cpar. Since Cser and Cpar are essentially in series, together they have a slightly lower capacitance than Cser alone, so the parallel-resonant frequency is slightly higher. The crystal’s impedance is very high at this frequency.

But at frequencies much higher than either of the resonant frequencies, you can see that the impedance of Cparalone dominates, and this just keeps decreasing with increasing frequency. This reduces the crystal lattice filter to a simple capacitive divider, which passes high freqeuncies with little attenuation.

Question 4—Suppose you know that a nominal 10.000 MHz crystal has a series-resonant frequency of 9.996490 MHz and a parallel-resonant frequency of 10.017730 MHz. You also know that its equivalent series capacitance is 27.1 fF. How can you calculate the value of its parallel capacitance?

Answer 4—First, calculate the crystal’s equivalent inductance, based on the series-resonant frequency:EQ-equation1-CC287-June14

Next, calculate the capacitance required to resonate with that inductance at the parallel-resonant frequency:EQ-equation2-CC287-June14

Finally, calculate the value of Cpar required to give that value of capacitance when in series with Cser:EQ-equation3-CC287-June14

Note that all three equations can be combined into one, and this reduces to:EQ-equation4-CC287-June14

Closed-Loop Module

CogiscanThe LCR Control Module is a fully integrated and closed-loop system designed to eliminate the risk of placing incorrect passive components on PCBs. Combined with the Offline Job Setup and/or Line Setup Control module, the LCR Control Module’s software is integrated with an electrical LCR meter. The system verifies that the measured values (e.g., inductance, capacitance, resistance) are within the tolerances specified for the component. This electrical verification can be done at any time prior to mounting the reel on the placement machine.

Contact Cogiscan for pricing.

Cogiscan, Inc.

Issue 284: EQ Answers

Can you name all of the signals in the original 25-pin RS-232 connector?

Pins 9, 10, 11, 18, and 25 are unassigned/reserved. The rest are:

Pin Abbreviation Source Description
1 PG Protective ground
2 TD DTE Transmitted data
3 RD DCE Received data
4 RTS DTE Request to send
5 CTS DCE Clear to send
6 DSR DCE Data Set Ready
7 SG Signal ground
8 CD DCE Carrier detect
12 SCD DCE Secondary carrier detect
13 SCTS DCE Secondary clear to send
14 STD DTE Secondary transmitted data
15 TC DCE Transmitter clock
16 SRD DCE Secondary received data
17 RC DCE Receiver clock
19 SRTS DTE Secondary request to send
20 DTR DTE Data terminal ready
21 SQ DCE Signal quality
22 RI DCE Ring indicator
23 DTE Data rate selector
24 ETC DTE External transmitter clock


What is the key difference between a Moore state machine and a Mealy state machine?

The key difference between Moore and Mealy is that in a Moore state machine, the outputs depend only on the current state, while in a Mealy state machine, the outputs can also be affected directly by the inputs.


What are some practical reasons you might choose one state machine over the other?

In practice, the difference between Moore and Mealy in most situations is not very important. However, when you’re trying to optimize the design in certain ways, it sometimes is.

Generally speaking, a Mealy machine can have fewer state variables than the corresponding Moore machine, which will save physical resources on a chip. This can be important in low-power designs.

On the other hand, a Moore machine will typically have shorter logic paths between flip-flops (total combinatorial gate delays), which will enable it to run at a higher clock speed than the corresponding Mealy machine.


What is the key feature that distinguishes a DSP from any other general-purpose CPU?

Usually, the key distinguishing feature of a DSP when compared with a general-purpose CPU is that the DSP can execute certain signal-processing operations with few, if any, CPU cycles wasted on instructions that do not compute results.

One of the most basic operations in many key DSP algorithms is the MAC (multiply-accumulate) operation, which is the fundamental step used in matrix dot and cross products, FIR and IIR filters, and fast Fourier transforms (FFTs). A DSP will typically have a register and/or memory organization and a data path that enables it to do at least 64 MAC operations (and often many more) on unique data pairs in a row without any clocks wasted on loop overhead or data movement. General-purpose CPUs do not generally have enough registers to accomplish this without using additional instructions to move data between registers and memory.

Issue 282: EQ Answers

Construct an electrical circuit to find the values of Xa, Xb, and Xc in this system of equations:

21Xa – 10Xb – 10Xc = 1
–10Xa + 22Xb – 10Xc = –2
–10Xa – 10Xb + 20Xc = 10

Your circuit should include only the following elements:

one 1-Ω resistor
one 2-Ω resistor
three 10-Ω resistors
three ideal constant voltage sources
three ideal ammeters

The circuit should be designed so that each ammeter displays one of the values Xa, Xb, or Xc. Given that the Xa, Xb, and Xc values represent currents, what kind of circuit analysis yields equations in this form?

You get equations in this form when you do mesh analysis of a circuit. Each equation represents the sum of the voltages around one loop in the mesh.

What do the coefficients on the left side of the equations represent? What about the constants on the right side?

The coefficients on the left side of each equation represent resistances. Resistance multiplied by current (the unknown Xa, Xb, and Xc values) yields voltage.
The “bare” numbers on the right side of each equation represent voltages directly (i.e., independent voltage sources).

What is the numerical solution for the equations?

To solve the equations directly, start by solving the third equation for Xc and substituting it into the other two equations:

Xc = 1/2 Xa + 1/2 Xb + 1/2

21Xa – 10Xb – 5Xa – 5Xb – 5 = 1
–10Xa + 22Xb – 5Xa – 5Xb – 5 = –2

16Xa – 15Xb = 6
–15Xa + 17Xb = 3

Solve for Xa by multiplying the first equation by 17 and the second equation by 15 and then adding them:

272Xa – 255Xb = 102
–225Xa + 255Xb = 45

47Xa = 147 → Xa = 147/47

Solve for Xb by multiplying the first equation by 15 and the second equation by 16 and then adding them:

240Xa – 225Xb = 90
–240Xa + 272Xb = 48

47Xb = 138 → Xb = 138/47

Finally, substitute those two results into the equation for Xc:

Xc = 147/94 + 138/94 + 47/94 = 332/94 = 166/47

Finally, what is the actual circuit? Draw a diagram of the circuit and indicate the required value of each voltage source.

The circuit is a mesh comprising three loops, each with a voltage source. The common elements of the three loops are the three 10-Ω resistors, connected in a Y configuration (see the figure below).

cc281_eq_fig1The values of the voltage sources in each loop are given directly by the equations, as shown. To verify the numeric solution calculated previously, you can calculate all of the node voltages around the outer loop, plus the voltage at the center of the Y, and ensure they’re self-consistent.

We’ll start by naming Va as ground, or 0 V:

Vb = Va + 2 V = 2 V

Vc = Vb + 2 Ω × Xb = 2V + 2 Ω × 138/47 A = 370/47 V = 7.87234 V

Vd = Vc + 1 Ω × Xa = 370/47 V + 1 Ω × 147/47A = 517/47 V = 11.000 V

Ve = Vd – 1 V = 11.000 V – 1.000 V = 10.000 V

Va = Ve – 10 V = 0 V

which is where we started.

The center node, Vf, should be at the average of the three voltages Va, Vc, and Ve:

0 V + 370/47 V + 10 V/3 = 840/141 V = 5.95745 V

We should also be able to get this value by calculating the voltage drops across each of the three 10-Ω resistors:

Va + (Xc – Xb) × 10 Ω = 0 V + (166 – 138)/47A × 10 Ω = 280/47 V = 5.95745 V

Vc + (Xb – Xa) × 10 Ω = 370/47V + (138-147)/47A × 10 Ω = 280/47 V = 5.95745 V

Ve + (Xa – Xc) × 10 Ω = 10 V + (147-166)/47 A × 10 Ω = 280/47 V = 5.95745 V

DC Motor for Fine Rotary Motions

The RE 30 EB precious metal brushed motor features a low start-up voltage, even after a long period in standstill. With a 53-mNm rated torque, the powerful motor provides twice the power of an Maxon RE 25 EB. In addition, the RE 30 EB features minimal high-frequency interference.

The RE 30 EB motor is specifically designed for haptic applications (e.g., surgical robots). Therefore, the motor can also be used as a highly sensitive sensor, acting as the sense of touch to register mechanical resistance.

Contact Maxon for pricing.

Maxon Precision Motors

Dual-Display Digital Multimeter

The DM3058E digital multimeter (DMM) is designed with 5.5-digit resolution and dual display. The DMM can enable system integration and is suitable for high-precision, multifunction, and automatic measurement applications.

The DM3058E is capable of measuring up to 123 readings per second. It can quickly save or recall up to 10 preset configurations, including built-in cold terminal compensation for thermocouples.

The DMM provides a convenient and flexible platform with an easy-to-use design and a built-in help system for information acquisition. In addition, it supports 10 different measurement types including DC voltage (200 mV to approximately 1,000 V), AC voltage (200 mV to approximately 750 V), DC current (200 µA to approximately
10 A), AC current (20 mA to approximately 10 A), frequency measurement (20 Hz to approximately 1 MHz), 2-Wire and 4-Wire resistance (200 O to approximately 100 MO), and diode, continuity, and capacitance.

The DM3058 is ideal for research and development labs and educational applications, as well as low-end detection, maintenance, and quality tests where automation combined with capability and value are needed.

The DM3058E digital multimeter costs $449.

Rigol Technologies, Inc.