1
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ BT103 and op-amp for current draw \$\endgroup\$ – user2497 Mar 10 '18 at 17:31
  • \$\begingroup\$ For practical reasons, you will want to amplify the voltage coming out of the shunt (R2). In future, please use a different number for every resistor. It is potentially confusing to have r1 and R1 in the same circuit. \$\endgroup\$ – mkeith Mar 10 '18 at 17:36
  • \$\begingroup\$ R1, in series with shunt R2 seems to serve no purpose. Also, if you do this, use a Zener diode to protect the ADC input that senses battery voltage. Sometimes automotive systems have large voltage transients. The combination of r1 and a Zener should protect the ADC. \$\endgroup\$ – mkeith Mar 10 '18 at 17:38
1
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

At high current, the sense resistor will need to be small, and the voltage drop across it will be small. You will need a difference amplifier to read it. LM358 has problems reading difference below 0.3mV, but above 10mV should be mostly OK. The output of the difference amplifier is the voltage difference across the sense resistor.

You will need another op amp with some gain to increase it for the full range of the ADC. You might want to do the same (opamp with gain) on the other side for reading voltage to change the scale from 0-1.2V to 0-5V.

It is preferable to have load connected to ground, but then the op amp will need at least 1.5V more than the load supply. But, if this is not connected to anything else, and not part of a bigger circuit, it may be ok to not have the load ground referenced. However, a short circuit on the load will still put the input voltage at the op amp to 12V. I'm not sure if this might be a problem, considering that the gain stage will only have output up to 5V, and LM358 inputs can go upto supply voltage (12V, if there is no 15V separate supply for the op amps).

enter image description here

Sorry, I made a mistake. You will need a negative supply for the op amp so it can sense below 3A. For 25A, please change the resistor to 0.01 Ohm 10W (it will get hot, so might want to add some cooling). Should work reasonably well above 0.5A. If this is an inductive load, I'd definitely have separate power supplies for the op amp. Might even go with an op amp that has null offset pins for accuracy.

enter image description here

\$\endgroup\$

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.