When designing systems with microcontrollers, it is often necessary to make them low power and to ensure they draw minimal current. Unfortunately, common desktop instruments do not allow for easy verification of these currents. A DMM can really only show DC currents and can’t capture transients. An oscilloscope typically can only measure down on the order of 2mV per division range. These limitations pose a problem for microcontroller systems that typically have to wake up periodically to check things and then go back to sleep: the current waveform is too active for the DMM to measure and too small for the oscilloscope to resolve. A simple and obvious method around this is to amplify the current measurement so that a scope can reliably show the current waveform. This blog entry describes one, easy-to-implement method for accomplishing this.
The figure below shows the schematic for the amplification circuit using an instrumentation amplifier. A brief description of the circuit follows.
The gain of the circuit is set to 1000. With the expected minimum current of the DUT(on the order of 100uA) and a gain of 1000, the output will be about 100mV. This is an easy voltage to see with a scope. In addition the maximum current is about 5mA, so a gain of 1000 gives an output voltage about 5V. Again, this is easy to see with a scope.
The gain bandwidth product of the IA is large enough to show the transitions of the circuit.
The circuit is run off of +-10V so there is enough headroom to output the approximate +5V output. Dual supplies are necessary because the minimum allowed voltage input is V- + 1.5V.
The 10k provides a load so that output of the IA has a return path.
Pin 5 is tied to ground so that the output is referenced to ground.
Outside of the circuit are the Device Under Test (DUT) power supply, the DUT, and the current sense resistor. The current sense resistor is sized to ensure that the current can be adequately measured and that it does not affect the DUT performance. In this case a 1-ohm resistor is used because it meets these requirements and allows for easier math (see below).
The amplifier circuit was only bread-boarded so the actual accuracy is not dialed in, but the results are close enough to show the idea.
A typical low-power micro spends most of the time in a low-power state an wakes up periodically to check conditions. The average current can be modeled as shown in the equation below.
To get the total average current the amplifier can be used to show the current on an oscilloscope and then the equation can be filled in. Below is a scope capture of a typical micro current consumption while in a sleep condition. The asleep/awake behavior can be seen. For approximately 80% of the time the current is low – the voltage is approximately 250mV which is equivalent to 250uA. For the remaining 20% of the time, the micro is waking up and then for a real short time it is at full power as it performs its actions before it goes back to sleep.
By zooming in on the higher current portions the following times and currents can be found for the DUT.
|Micro State||Duration||Current (Measured Voltage/1000)|
Using these measured values, the average current equation can be filled out as shown below.
So in this case, the average current for the micro system is 385uA.
This method can be modified to measure smaller currents by increasing the current measurement resistor and/or increasing the gain of the IA. Also, more accurate measurements can be made by placing this circuit on a PCB. Also other IA ICs can be used to get better performance. Hopefully there are some ideas that you use to help troubleshooting in the future.