Electrical – Is it possible to measure the voltage and current of a load with this circuit and Arduino

current measurementdc-acshuntvoltage dividervoltage measurement

I'm trying to measure the voltage and current for a DC-AC converter in my car with Arduino.

I know it would be easier, more accurate and cheaper to use breakouts with INA226 like this. But this question is purely from my curiosity.

I'm thinking about a circuit like this with a shunt resistor.

enter image description here

  • Voltage : V0
  • Current : V1/R

(V0 : the voltage at analog input 0, V1 : the voltage at analog input 1)

But Arduino can't measure voltage higher than 5V (Arduino Reference, analogRead()). Besides, if the voltage drop in the load was very low, voltage higher than 5V might be applied to V1.

Then I came up with an idea using a voltage divider.

enter image description here

  • Voltage : V0 * (r1 + r2) / r2
  • Current : V1/R2

r1 + r2 should be large enough to avoid drawing too much current to the tributary. R1 + R2 should be small enough to prevent voltage drop.

But I feel I'm missing something. Can this quite simple circuit measure the voltage and current?

EDIT 2018-3-11 15:49 GMT

The current will be up to 25A since the max power consumption of the load is 300W.

Best Answer

In your circuit:

it is, in theory, possible to measure the voltage across and current thru the load. The voltage is IN0 - IN1, and the current is IN1/R.

However, for a useful current measuring circuit, R would need to be very low. You want the worst case voltage dropped across R to be a small fraction of the total 12 V that is available. You don't say what the maximum current is you need to measure, but I'd start with not wanting to have more than 100 mV across R. In reality, that means you need to amplify the IN1 signal before presenting to a A/D that has a 5 V or 3.3 V input range.

Another option is to use such a high resolution A/D so that you still have enough resolution left after using only a small portion of its range. With a 20 bit delta-sigma A/D, for example, with 3.0 V reference, 100 mV would be 1/30 of its range. That still leaves about 15 bits of resolution.

As for IN0 being a higher voltage than can be measured directly, use a resistor divider to scale it down to the range you can measure. For example, a top resistor of 20 kΩ and a bottom resistor of 10 kΩ attenuates the signal by 3. If using a A/D with 5 V range, that means the input signal can be measured over a 15 V range.

Related Topic