I wish to measure current up to 150A in an car using a shunt. I have three different problems with this. The first is that I cannot place the shunt on the negative wire because I will need to isolate parts like the alternator from ground. This causes the problem that each side of the shunt is 12+ volts and the arduino measures only up to 5. The second is that I need to amplify this signal up to improve its accuracy as I only have 1mv per amp. The third is that one of my loads is an inverter. Being that an inverter outputs AC I have found that the current running into it goes near zero 100 times per second. Because the arduino takes reading very quickly it is sometimes showing a high reading and sometimes showing near zero, pretty much at random.
So what I need is something that will isolate my 12V signal, amplify the voltage drop across the shunt and then smooth it out. I kind of know what I need, an op amp and an RC circuit to smooth it out but not sure of the specifics.
A shunt for measuring 150A is not isolating, its a very low value resistor (a metal bar, basically). 1mV/A means your shunt is 0.001ohm (less than the resistance of the wiring to your alternator etc). It can probably live on the low side (but you probably want to bypass it for the starter-motor, that could take a lot more than 150A worst-case). Having it on the low side simplifies things.
Yes you will need to amplify that signal, a rail-to-rail op-amp would be a good choice. A differential amplifier configuration with gain of 30 or so seems a good choice (differential so you can feed it from the shunt's two sense terminals (the shunt should be a 4-terminal device?) and not worry about ground reference.
The AC component of the current is an issue - you have several choices: do you want to measure average (DC) current or are you happy with peak current? You could even measure RMS current but that is less meaningful here. If you sample at the highest rate the Arduino allows you might get enough samples to do the averaging directly in software.
Alternatively you could do averaging with an RC filter (part of the op-amp circuit would be logical).
Be aware that there are high-side current-sense modules available that use the INA169 chip, which does differential applification and can work on the high-side too (and the gain is set with a single resistor I think).
With opamps you can work with high-side, but you'll need a below-unity differential amplifier first followed by the gain amp. More complex.
Hi Mark, thanks for the reply. That chip looks like it's exactly what I need. I like integrated packages like this From what I understand I can just hook up 12V to power the chip, either side of the shunt to V+ and V-, a resistor to the output and it's done. I would then just need a resistor and cap to smooth out the voltage. I believe it is average amps I am after, whatever you get if you used a voltmeter. Basically I should be able to multiply amps x volts x time to get the amount of capacity taken out of the battery. Is there anything else I would need to add to the circuit, say for protection due to spikes etc?
Can't remember if its surface-mount only though - there are break-out boards with built-in 4-terminal shunt resistor (used principally for RC model current sensing, upto 180A range or so(!).
In my humble opinion you should avoid using a shunt and instead go for a hall type sensor. These measure DC/AC current with a bandwidth up to 10Khz, are totally isolated from your supply, offer zero insertion burden and provide a 0-5 volt output to which you can attach a smoothing capacitor if you want to do simple current averaging, though you'd be far better doing that via an algorithm within the arduino.
I am curious about using a hall sensor but am wondering how they manage to only pickup current from wire in question. Wouldn't they be susceptible to other electrical interference?
With regards averaging using the arduino wouldn't this be a problem if it gets busy doing something for a short period of time? You would end up affecting the readings. On the other hand wouldn't a cap be a lot simpler?
Hi MarkT, I ordered a couple of these chips and they arrived today. Man those things are TINY!! They are so small I lost one when I opened the package. Several times I thought I'd found it but it turned out to be a bread crumb!! I should hopefully be able to solder it still
mikekulls:
I am curious about using a hall sensor but am wondering how they manage to only pickup current from wire in question. Wouldn't they be susceptible to other electrical interference?
The sensor type recommended has a hole through its centre, through which you thread the line you wish to sense current. They sense the current flowing through the hole and generally ignore external interference.
mikekulls:
I am curious about using a hall sensor but am wondering how they manage to only pickup current from wire in question. Wouldn't they be susceptible to other electrical interference?
I suspect that if you placed a strong enough magnet close enough to the sensor you could effect it's measurement output value.
Proximity - place the sensor close to the current-carrying element (used in the ICs with hall sensors)
Ferrite core - concentrate the field lines from the threaded conductor to the sensor.
But you are right, external magnetic fields will cause wrong results with hall sensors. Fortunately magnet effects fall off as the reciprocal of distance cubed, so its rarely an issue.