Electronic – arduino – Measuring power consumption in Arduino and raspberry-pi system

arduinopowerraspberry pi

I have a system that consists of 1 Arduino, 1 Raspberry-pi, 2 power banks, and a set of different sensors. Each of the Arduino and Raspberry-pi is powered by a separate power bank. I need an accurate method to measure the total power consumed by the entire system.

I also need this power measurement as feedback input to the Arduino to control some sensors. Is it better to tap some power measurement circuit on each power bank or is there a better way to measure it by Arduino/Raspberry-pi.

Best Answer

The average current taken by your "load" can be used to estimate power by numerically multiplying it, at regular intervals, with the battery voltage. However, if there are significant load-associated ripples on your voltage then the accuracy of this method is reduced.

So, if you have a reasonably ripple-free terminal voltage that only exhibits slow droop as the battery becomes discharged, then a simple two-quadrant multiplication of voltage and average current should be acceptable.

I would do this using the circuit shown in Transistors answer or with external ADCs with appropriate filtering. Multiply the two digital numbers representing voltage and current and average a few values to get average load power.

Even if the load is turning on and off at a high rate you can still average current to get true power providing the battery ripple voltage is low.