9 minute read

How to measure current and energy use accurately

General-purpose test equipment can have trouble measuring small currents, particularly if they only happen briefly. New specialized instruments go a long way toward solving this problem.

Matt Liberty | Jetperch LLC

The direct measurement of current is difficult. It’s usually impractical to count individual electrons, so the two primary techniques for measuring current actually measure “side-effects” of current. The first technique uses the fact that moving charged particles create a magnetic field (Ampère’s Law). The second technique uses the fact that charged particles moving through resistance create a voltage (Ohm’s Law). Both these techniques can be derived from Maxwell’s equations.

The fact that current creates a magnetic field was first discovered by Ørsted in 1820 using a compass. This technique was later refined into the modern galvanometer. Most modern galvanometers have a permanent magnet and a pivoting coil of wire. In a typical D’Arsonval/Weston type galvanometer, current flowing through the coil pushes towards or away from the permanent magnet. The coil magnetic field is counteracted by the permanent magnet which forces the coil to twist, moving the pointer. If you have ever seen analog multimeters or vintage stereo equipment, you have likely seen a galvanometer.

The magnetic field caused by current flow can also be measured using Hall-effect sensors. Changing magnetic fields caused by ac currents can use a sense coil inductance that will measure the rate of change of coil current, which can then be processed to yield a figure for ac current flow.

A point to note is that with all these techniques, it becomes more difficult to measure the magnetic field with sufficient precision as the current becomes smaller (under 1 mA).

That brings us to shunt resistors. A resistor placed in the path of current produces a voltage according to Ohm’s Law: V = I × R, or I = V /R when solved for current. If the resistance is known and we measure voltage across the resistor, we can compute current. Resistors used for current measurements are called shunt resistors. Most modern ammeters and DVMs measuring current use shunt resistors. The best part about this approach is that we can select a shunt resistor value that gives us a suitable voltage range!

A shunt resistor is also called a “current-sense resistor,” or simply “sense resistor.” By design, shunt resistors cause a voltage drop, also called burden voltage or insertion loss. If this voltage is too large, it affects the load. The additional resistance also changes the source impedance as seen by the load, which can cause some load circuits to behave differently. Ideally, the shunt resistance would be so small that it would not affect the target circuit. Practically, the shunt resistance has to create a measurable voltage.

It’s difficult to measure a large current range with a single shunt resistor. The voltmeter has a fixed range. To expand the range, most ammeters use multiple shunt resistors, each with different resistances. However, if the current changes over time, a shunt resistor that is too large can cause an excessive voltage drop that affects the behavior of the target circuit. If the shunt resistor is too small, it cannot accurately measure the current.

Multimeters are well-suited for measuring currents that are constant, either as direct current or “constant” RMS alternating current. Multimeters cannot easily measure currents that vary rapidly or that change dramatically over time.

Most ammeters, including those in multimeters, have significant limitations including:

Burden voltage: The voltage drop (also called insertion loss) across the ammeter which results in a lower voltage being delivered to the device under test.

Leakage current: The amount of current diverted through the ammeter and not delivered to the device under test.

Bandwidth: The response of the measurement in the presence of a time-varying signal. For target devices that use a positive dc supply, the bandwidth relates to the change in load presented by the target device.

Dynamic range: The variation between the minimum current and the maximum current used by the device under test.

Consider the specifications for a well-known, quality hand-held multimeter, the Fluke 87 (See Table 1). The specification is silent on leakage current. The dc bandwidth is on the order of 1 Hz. The ac bandwidth has much worse performance (±1%) and the bandwidth is 45 Hz to 2 kHz.

Now suppose we connect the multimeter to estimate the energy consumed by a target device. Further suppose the target device periodically takes sensor measurements and reports them over RF. The target device must take the measurement from the sensor, send the measurement over RF and then go back to sleep, a typical sequence for IoT devices. In our simple example, the target device has three states: radio, active and sleep.

To estimate the total energy consumption, recall energy is the integral of power over time (P = I × V, E = ∫ P dt). For constant power, the integral can be simplified to just the term for power multiplied by the time duration, E = P × t. The classic way to estimate energy is to first measure the duration of each state, often either via an oscilloscope inspecting the voltage across a fixed shunt resistor or with a logic analyzer inspecting bits set by the microcontroller. You can then force the system into each state and directly measure the current using the multimeter.

Suppose the device uses a 3.3-V supply and we found the device drew 200 mA during its 50 msec radio state, 50 mA during its 100 msec active state, and 1 µA during its sleep state where it spends the rest of its time. We can estimate the energy consumed by the target device per sensor measurement as:

Energy = (3.3 V × 200 mA × 0.050 sec) + (3.3 V × 50 mA × 0.100 sec) + (3.3 V × 1 µA × (measurement interval - 0.15) sec)

If the device takes one sensor measurement hourly, the total energy per sensor measurement is then E = 0.033 J + 0.165 J + 0.0119 J

So, how accurate is this estimate? Start with the first radio state energy estimate. The Fluke 87 states that the burden voltage is 1.8 mV/mA in the 400-mA range. For our measurement, we have

1.8 mV/mA × 200 mA = 360 mV drop

Due to the voltage drop across the multimeter, the target only receives 2.94 V rather than the supplied 3.3 V. This reduced voltage may have caused unexpected behavior, such as brown outs, on the target during the measurement. If the target contains a dc-dc converter, the measured current will be higher than in the final product. We would reduce the burden voltage by setting the multimeter to a larger range at the expense of resolution.

Fortunately, the active state uses a current range with the same burden voltage specification as the radio state. If the active state was only 6 mA and the multimeter was on the 6-mA range, the burden voltage would be 0.6 V! Because the multimeter switches current-shunt resistors with the current range setting, reducing current does NOT necessarily reduce the burden voltage.

This multimeter is also not able to accurately measure the sleep state current, which is 19.4% of the total energy! In the 0.6 mA setting, the accuracy is:

±(0.2% × 1 µA + 4 × 0.1 µA) = 0.402 µA

This amounts to 40% error on 19.4% of the total budget, or 7.7% total error!

Bench multimeters usually provide additional resolution and accuracy. However, the burden voltage specifications are similar and often in the range of 0.7 V for fullscale measurements. You can sacrifice the additional resolution to provide a reasonable burden voltage.

A multimeter is a vital tool, but the operator must be constantly aware of the burden voltage and resolution. Developers must be diligent in performing this tedious task regularly. In practice, developers using multimeters to measure power rarely perform testing frequently. Infrequent testing allows the product to collect “surprises” that are not discovered until late in the design cycle.

Oscilloscopes

Oscilloscopes sample voltages at regular intervals, often over a million times per second, to construct a voltage waveform. Oscilloscopes then display a graph showing changes in voltage over time. By measuring the voltage over an external shunt resistor, oscilloscopes can effectively display changes in current over time.

However, current measurements via scope have two primary challenges. First, the shunt resistor measurement technique has the dynamic range issues associated with shunt resistors. Oscilloscopes usually trade-off speed for limited dynamic range and typically have just 10 or 12 bits of dynamic range.

Second, oscilloscopes are usually earth-ground referenced. The oscilloscope measures the voltage difference between earth ground and the signal. However, we want the differential measurement across the shunt resistor. Introducing shunt resistance into the ground path often causes signal integrity issues. We often want “high-side” shunt resistors on the positive power supply. However, if the test circuit is also earth-ground referenced, we cannot use the oscilloscope’s standard probe to measure the voltage difference across the shunt resistors. We can either use two oscilloscope probes and use a mathematical subtract feature, which introduces additional measurement error, or we can use differential oscilloscope probes, which are often quite expensive. Either way, we are still left with the dynamic range issue.

Oscilloscope manufacturers also provide current probes, which are usually just a combined shunt resistor and differential probe. These probes also allow the oscilloscope to get the units right, so you needn’t do Ohm’s law calculations every time you measure current. However, dynamic range is still limited. Oscilloscopes also have current-clamp probes, which are limited to around 1 mA resolution.

Specialized equipment

A variety of other equipment can measure current, sometimes while sourcing or sinking current. Equipment of this type includes electrometers, picoammeters, and Source Measurement Units (SMUs). These products are specially designed to overcome some of the standard multimeter drawbacks, and many do have lower burden voltages and lower input-bias currents. However, the primary drawback is cost. These devices often employ multiple, more complicated, active-feedback ammeter sensing methods.

Some current-measurement equipment automatically and instantaneously selects the shunt resistor to keep the voltage in range. This approach maintains a maximum burden voltage while also accurately measuring current. Until recently, this type of dynamically switching equipment was either too slow (introduced too large of a dynamic burden voltage) or expensive.

This approach does have two drawbacks, but these can be mitigated. The first drawback is the shunt resistor switching time, especially when the current exceeds the range for the current-shunt resistor value. If the resistor value does not switch quickly enough, the burden voltage becomes excessive and affects the target device.

The required switching time can be calculated. A simplified equation, suitable for many practical applications, is:

t = C × ΔV / ΔI

where t = resistor switching time, sec.; C = system capacitance, F; ΔV = amount of tolerable voltage change, V; and ΔI = current change through the resistor. For example, suppose the target system takes 3.3 V and can tolerate a temporary 3% voltage glitch on a 1-A change. If the system has 10 μF of capacitance, the required shunt resistor switching time is:

10 μF × 3.3 V × 0.03 / 1 A = 1 μsec

The second drawback is that this approach presents a variable impedance to the target circuit. Some circuits may exhibit unusual behavior to a changing supply impedance. However, we can mitigate this susceptibility by adding decoupling capacitors, which effectively lower the input impedance at the higher frequencies of interest. Most modern electronics already require bypass capacitors, so this drawback is often not a concern when measuring current to target devices.

This sort of specialized current-measurement equipment must also account for Johnson-Nyquist noise, the noise any resistor generates. This noise, the voltage measurement accuracy, and bandwidth are the critical design factors.

An example of specialized current-measurement equipment that uses this approach is the Joulescope. It switches shunt resistors in approximately 1 μsec on over-range to keep the target device running correctly. It maintains a maximum burden voltage of 20 mV across the shunt resistor for any current up to 2 A. The Joulescope is electrically isolated to avoid any grounding and ground loop concerns.

In addition to being an ammeter, a Joulescope simultaneously measures voltage so it can compute power (P = I × V) and energy (E = ∫ P dt).

Jetperch LLC | www.joulescope.com

The recently released Joulescope is designed to automatically handle wide current ranges and rapid changes in energy consumption, while allowing the target device to run normally. This instrument displays data via a connection to a PC and accurately measures electrical current over nine orders of magnitude from amps down to nanoamps. This wide range allows accurate and precise current measurement for modern devices where sleep modes are often just nanoamps (nA) or microamps (μA). The Joulescope also has a total voltage drop of 25 mV at 1 A, allowing the target device to run correctly. Joulescope’s extremely fast current range switching maintains a low voltage drop even under rapidly varying current demands. Via a connection to a PC, Joulescope reports cumulative energy consumption along with real-time current, voltage, and power. The multimeter view shows the most recent value while an oscilloscope view allows you to explore changes over time.

An expanded display of an Arduino current waveform at turn-on, top, revealing details of the turn-on sequence. The bottom display depicts a view of the Arduino current draw that includes the max and min measured current (red lines) and the average current (yellow line). Both displays were generated by a Joulescope which uses switched current-sense resistors to accurately gauge current.

This article is from: