3
\$\begingroup\$

Iam doing a DC only backup system with ATMega328 MCU. It supplies full time DC to vaious devices. How can I measure the current usage of each device. The power loss for measurement is thought to be very less. Would you pls suggest a best way? Thanks.

\$\endgroup\$
  • \$\begingroup\$ Approximately what would be the scale of current needed by each device? \$\endgroup\$ – Anindo Ghosh Jan 7 '13 at 8:54
  • \$\begingroup\$ Refering the solution given by Anindo Ghosh, I think it would be easy to use LM324 Quad Op-amp for measuring the voltage from shunts. Got a simple op-amp reference here intro2electro.blogspot.in Thanks to all. mitz \$\endgroup\$ – Mitz Jan 7 '13 at 10:01
  • \$\begingroup\$ @AnindoGhosh (from OP, posted under my answer) Thank you Anindo Ghosh. The power for each device would be from 100 mA - less than 5A. To minimize power loss(heat) while using a shunt, I managed to get a think insulated copper wire but couldn't get its resistance with multimeter. \$\endgroup\$ – Garrett Fogerlie Jan 7 '13 at 10:08
  • \$\begingroup\$ Welcome to EE.SE (Electrical Engineering @ Stack Exchange,) and glad we could help. However you should refrain from posting a comment as an answer. You can add extra information by editing your original question, or by commenting on it. \$\endgroup\$ – Garrett Fogerlie Jan 7 '13 at 10:14
  • \$\begingroup\$ @Mitz: The solution was posted by Garrett Fogerlie not me! :-) Credit where credit is due! \$\endgroup\$ – Anindo Ghosh Jan 7 '13 at 10:21
4
\$\begingroup\$

Atmel has a development board and app-note that I highly recomend you take a look at: ATmega64HVE2

How can I measure the current usage of each device.

You need to use a current shunt to measure the current. Basically this is just a resistor of a known value (and able to handle the wattage you need,) in series to the load.

Current measurement

You will use the ADC of the ATMega328, to measure the voltage drop across the shunt. The voltage drop is proportional to the current flowing through it; since the shunt is in series with the load, this is the current the load is using. So since you know the resistance of the shunt, and the voltage drop, you can calculate the current using Ohms law, I = V/R.

Current measurement shunt load

The power loss for measurement is thought to be very less.

I'm unsure what you mean here, I assume you don't want the actual 'measurement circuitry' to use much power. To do this you just need to select a shunt that has a very low resistance, since power equals current squared times Resistance (\$ P = I^{2} * R \$).

Make sure you pick a shunt that can handle the power of your load safely!

Ohms Law equation cheat sheet

Edit

Here is a tutorial for Measuring Current with the Arduino that goes over everything fairly well, including using a OpAmp for better step resolution.

\$\endgroup\$
  • \$\begingroup\$ Thank you Anindo Ghosh. The power for each device would be from 100 mA - less than 5A. To minimize power loss(heat) while using a shunt, I managed to get a think insulated copper wire but couldn't get its resistance with multimeter. \$\endgroup\$ – Mitz Jan 7 '13 at 9:34
  • 2
    \$\begingroup\$ @Mitz - copper wire as a shunt is not a good idea as it won't have an easily measured/calibrated resistance. There are plenty of accurate low-ohm resistors out there in standard ranges. If you do not require great accuracy you can use a very low value which means it won't get very hot even at high current, so you can use a small/cheap component. \$\endgroup\$ – John U Jan 7 '13 at 9:42
  • \$\begingroup\$ +1 for a nice comprehensive updated answer... I wonder why the OP is giving me credit for it :-) \$\endgroup\$ – Anindo Ghosh Jan 7 '13 at 10:22
4
\$\begingroup\$

While Garrett Fogerlie has provided an excellent solution for the current sensing requirement in the question, an alternative exists for sensing currents in the range specified by the OP, 100 mA to 5 A: The Allegro ACS712 Hall-Effect-Based Linear Current Sensor IC.

This part has an integrated sense conductor with extremely low resistance (1.2 mOhm!), since it works on the Hall Effect rather than voltage developed across a shunt resistor. Heat dissipation / power wastage is thus extremely low.

An added advantage is that the sense path is fully isolated from the output. This allows the part to be used for high-side or low-side current sensing, or even current sensing directly on the power line side of your device, if required.

The ICs are factory trimmed for very high accuracy, an advantage over discrete shunt resistors, and tolerances within the op-amp and other components needed for a discrete solution.

All in all, if your project can bear the component cost, this is a single-IC solution that provides an ADC-ready signal for real-time current measurement.

\$\endgroup\$
  • \$\begingroup\$ Thank you Anindo. I've planned to use more than 5 devices and current sensing using ACS712 would be bit costlier now. I've planned to do auto adjustments in the arduino program using VB. Working on it. \$\endgroup\$ – Mitz Jan 8 '13 at 4:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.