Pages: [1]   Go Down
Author Topic: Ammeter to measure current flow in and and out of car battery  (Read 1135 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a 100A 75mv shunt across the negative terminal on the leisure battery in my campervan, and a simple digital ammeter which measures current flowing out of the battery. I also have a switch installed which flips the polarity on the meter and allows me to measure current flowing into the battery - from the alternator when the engine is running, a solar panel or mains hookup when parked up.

Could this be achieved using the Arduino (and preferably my existing shunt) without the need for a polarity reversing switch? I'd like to throw up a value on an LCD display which automatically moves from positive to negative as current flows into or out of the 12v battery.

Thanks in advance!
Logged

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2806
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Could this be achieved using the Arduino (and preferably my existing shunt) without the need for a polarity reversing switch?
An unmodified Arduino measures one polarity only example: 0 to +5Volts with 5V as the A/D reference.
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's what I figured. So is there something clever can be done electronically to use two analogue inputs - one to measure current flowing one way, the other when it flows in the opposite direction?
Logged

Oregon, USA
Offline Offline
Edison Member
*
Karma: 69
Posts: 2387
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No, that can't be done with voltage levels that low, except with additional rather sophisticated circuitry (i.e. precision operational amplifier rectifiers). You will have a hard time measuring those few mV with the Arduino even in one direction only.
Logged

"It seems to run on some form of electricity"

Offline Offline
Newbie
*
Karma: 1
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a 100A 75mv shunt across the negative terminal on the leisure battery in my campervan, and a simple digital ammeter which measures current flowing out of the battery. I also have a switch installed which flips the polarity on the meter and allows me to measure current flowing into the battery - from the alternator when the engine is running, a solar panel or mains hookup when parked up.

Could this be achieved using the Arduino (and preferably my existing shunt) without the need for a polarity reversing switch? I'd like to throw up a value on an LCD display which automatically moves from positive to negative as current flows into or out of the 12v battery.

Thanks in advance!

Do you feel comfortable building the "Improved Absolute Value Circuit" seen here ...
http://www.analog.com/library/analogdialogue/archives/44-04/absolute.html

You will need to adjust some of the R's for a Gain of 50X
50 x 75mv = 3.75 Volts connected to Analog Input #1

Then use Analog Input #2 to detect Charge Mode or Discharge Mode.


Alternatively ...
You could break the connection between Op Amp A1 and Op Amp A2.
Then feed the output of Op Amp A1 into Analog Input #1 (Charge Amps).
Then feed the output of Op Amp A2 into Analog Input #2 (Discharge Amps).

Lots of electronic options here ...
« Last Edit: December 27, 2013, 09:39:03 pm by mrsummitville » Logged

Oregon, USA
Offline Offline
Edison Member
*
Karma: 69
Posts: 2387
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do you feel comfortable building the "Improved Absolute Value Circuit" seen here ...
http://www.analog.com/library/analogdialogue/archives/44-04/absolute.html
That is an interesting circuit, but the gain is only 2, which won't really help for the OP's application. It is certainly possible to change the resistor values, but they would have to be very high precision for the circuit to work correctly.  The advantage of that particular circuit is that all the resistors are already present in the package, and are trimmed to 0.02% tolerance.
Logged

"It seems to run on some form of electricity"

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.

As part of the Arduino Alternator Regulators I needed to make high resolution amperage measurements, using the shunts like you have.  I 1st thought about using Op Amps to shape and shift the voltage, but in order to get quality op-amps needed to work with these low mV levels the costs are rather high.

I found a line of parts from TI, the INA-220 to be specific.  This is an I2C connected device that is able to give very accurate measurements in the mV range.  It has a high quality A/D, and also will do averaging (over sampling) to again increase accuracy and reduce noise and costs under $3.

You can see more what I did here:  http://smartdcgenerator.blogspot.com/2012/10/hardware-design-overview.html  scroll down to the Voltage and Current measurement section.

-al-


Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Do you feel comfortable building the "Improved Absolute Value Circuit" seen here ...
http://www.analog.com/library/analogdialogue/archives/44-04/absolute.html
That is an interesting circuit, but the gain is only 2, which won't really help for the OP's application. It is certainly possible to change the resistor values, but they would have to be very high precision for the circuit to work correctly.  The advantage of that particular circuit is that all the resistors are already present in the package, and are trimmed to 0.02% tolerance.

I see no need for 0.02% Resistors in this application but if you get 'em, them use 'em.
Attempting to make circuits with +/-1% tolerance over the entire range and
under wide temperatures is very difficult.


Logged

Lacey, Washington, USA
Offline Offline
Faraday Member
**
Karma: 162
Posts: 2502
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Accuracy between resistors in an Op Amp circuit may be necessary to prevent offset voltages and currents from being amplified.
Logged

Steve Greenfield AE7HD
CET Consumer Electronics and Computer
Please don't read your attitudes into my messages

SW Scotland
Offline Offline
Edison Member
*
Karma: 17
Posts: 1404
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Swallow your pride and get a hall sensor which will be perfect for your needs. 
With a centre zero output of 2.5 volts and a + range 2.5 to 5 volts and a - range of 2.5 to 0 volts it will measure both input and output current. 
All built into a neat package powered directly by the arduino with total galvanic isolation from the system you are measuring.
Something like one of these  http://www.panucatt.com/Current_Sensor_for_Arduino_p/cs-100a.htm
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, all. The hall sensor seems like the most sensible solution - I'm sure I'd easily burn $15 on parts trying to build something similar myself.

I'll add it to my shopping list...
Logged

Lacey, Washington, USA
Offline Offline
Faraday Member
**
Karma: 162
Posts: 2502
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Careful, that is only rated at 100A. The other one they sell is only rated at 200A. A starter, depending on the vehicle and ambient temperature, can easily draw upwards of 350A.

You can't just parallel a few of these, not without putting a lot of work making sure one doesn't end up hogging the current and burning up anyway.
Logged

Steve Greenfield AE7HD
CET Consumer Electronics and Computer
Please don't read your attitudes into my messages

Oregon, USA
Offline Offline
Edison Member
*
Karma: 69
Posts: 2387
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The sensor itself looks like an Allegro ACS758, in which case it can withstand 350 amps overcurrent with no problem. However, the board on which it is mounted may not survive the starter current! The wiring must also be done with proper sized cabling and connectors, of course.
Logged

"It seems to run on some form of electricity"

Offline Offline
Jr. Member
**
Karma: 0
Posts: 54
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It's OK - I'm only using this to monitor the leisure battery, which is isolated from the starter battery when starting.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Careful, that is only rated at 100A. The other one they sell is only rated at 200A. A starter, depending on the vehicle and ambient temperature, can easily draw upwards of 350A.

You can't just parallel a few of these, not without putting a lot of work making sure one doesn't end up hogging the current and burning up anyway.
You may want to add a Precision Voltage Regulator to your shopping list.
Vout = 1/2(Vcc) + (Current)Sensitivity
NOTE: The sensitivity of these devices vary proportionally with supply voltage(Vcc) used.

CS-200A
Sensitivity @ 5v Vcc is 10mv/A  (+/- 2mv !!!)
NOTE: Calibrating these devices on the host microcontroller against a known
current load will increase accuracy in most applications.


Logged

Pages: [1]   Go Up
Jump to: