# Automating the measurement of current consumption of an embedded system

I have two circuit board. 1.PCB for battery pack 2.Embedded PC with various modules.

I was wondering if there could be an automated way of measuring current consumption by the embedded module during various operations. I need to automate this measurement as I will more than 200 pair of this boards for testing purpose in the next one month.

-
Is this something just for final testing, or meant to be used and checking during operation of the end device? –  Kris Bahnsen Oct 23 '12 at 20:47
It would be for final testing. –  john Oct 23 '12 at 20:50
You said in a comment below, you have a dmm available. What model? –  The Photon Oct 25 '12 at 4:07
Keithley 6 1/2 DMM. Thanks. –  john Oct 25 '12 at 14:05
Related thread: electronics.stackexchange.com/questions/45259 –  Nick Alexeev Oct 25 '12 at 23:20

Dedicated, low cost current shunt monitor ICs such as the INA195 or INA198 would allow low cost, low perturbation current measurement direct to an ADC input of a microcontroller for your purpose.

A typical schematic and overview is provided here.

The INA195/198 has a 100V/V gain and common mode voltage of -16 to +80 volts. Thus a low value shunt resistor such as 0.1 Ohm would provide 1 volt full-scale sense voltage at 100 mA peak current. If your device-under-test typically works in a 10 mA range, then a 1 Ohm shunt resistor would provide the same 1 volt scale.

High common mode voltage allows you to design for a separate power source for your sensing application if desired, so as to not load the system under test and skew the results.

The device output voltage is ground-referenced, hence effectively independent of the actual Vcc of the system under test. This permits a current sense and logging device to be built, that would have two connectors, "from battery" and "to device", and be portable to future test targets which work at very different voltages if needed.

-

A shunt that is then amplified and measured with a little embedded system with a serial port seems to be the most obvious solution; the shunt would of course be in the test bed so when you put the board under test in the test bed, the shunt measures the power draw.

If a shunt would either be too low a resistance to measure properly or offer too much voltage drop to the DUT, then you can always go with a standard LEM or Rogowski coil to measure the current. LEMs are generally VERY sensitive and come in a variety of sizes/measurement ranges.

This is something you should be able to knock together in a day or two with an Arduino and appropriate current measurement device (shunt, LEM, etc.). It doesn't have to be fancy or optimized, which is exactly what those little 'duinos are good at.

Edit to add example for Arduino-style measurement:

Take a low-current sensor breakout board from Sparkfun. $15, and will let you measure up to 5ADC. It gives a straightforward voltage output which is proportional to the current through the sense pins, and can be scaled and filtered to match your application. The voltage output from this sensor is connected to an analog input of an Arduino. The Arduino would probably have a switch to tell when a board is inserted or removed, and a couple of LEDs (say red and green) to indicate pass/fail or error conditions. The serial port or USB port on the Arduino would connect to the computer that the person running the tests works on. The program on the Arduino would wait for the switch to indicate a board is inserted, wait 'x' seconds for the board to power up and enter its operation phase, record the voltage on its ADC pin and convert it to a current level based on the desired scaling. I'd write the current level to the serial port so the PC can automatically record the value in its database, along with the serial number or other data that the operator enters. That value would then be compared to a 'pass' range and if it's within spec, light the green led. Otherwise light the red one. Now the Arduino program would just wait for the switch to indicate that the board was removed and the cycle repeats. Now that's just a simple example. If I were to design it I would add a relay to control power to the DUT, and I'd also probably have a serial port or at least a few digital outputs to be able to tell the DUT to enter various test phases so I could measure the data. If I did have a serial port to the DUT, I could either read the board's serial number or program the serial number into the DUT from the PC, as well as program the test parameters and operator ID into the board for tracking/service info. But you can see, for maybe$50-\$100 in parts and a day or two of work and tweaking, your automated test jig would be operational and making you money, rather than trying to design something totally custom and spending money making the test unit instead of building units. :-)

-
Thanks for the comment. I would like to utilize the Tek MSO 3014 and a DMM(6 1/2) that we already have. Is there a way to use these equipments in a automated way? –  john Oct 24 '12 at 16:27
I'm not familiar with the scope and don't know your DMM, but if they don't have a serial port and you don't have the protocol specification and equipment to talk to them then the answer would be no, it can't be automated with them. Generally speaking you wouldn't want to tie up expensive equipment for production tests anyway. I try to use cheap components with precision references for go/no-go type production testing and calibration. –  akohlsmith Oct 24 '12 at 19:53
THanks. Can you explain more on how to have the arduino and a shunt together ? –  john Oct 24 '12 at 19:57