Solar PV system battery monitor current sensing

So I'm working on a Battery Monitor for an off-grid solar photovolotaic system...

I need to sense up to +/- 50A (going in or out of the battery) on a 24V system.
The aim of this project is to be very cheap and open source and to make use of (basically free) a stainless steel threaded rod as the current sense shunt (to replace the ones that are commercially available for around €25). I have done tests with this shunt on commercial battery monitors and it works perfect with negligible temperature effects.

I am using a 1mOhm stainless steel shunt resistor which serves as one pair of inputs of an LM324 (chosen based on availability and price). I'm adding 2.5V/47[V] to this signal and then amplify it *47 to get an output with 0A @ 2.5V going to -56A @ 0V and +56A @ 5V (roughly). This allows me to use a single rail opamp and keep the circuit really simple. (the schematic should be attached)

I do know about instrumentation amplifiers with built-in matched resistances and preset amplification, however the challenge of this project is to keep it really simple and cheap for anybody to easily replicate it.

The first tests showed that precision in terms of current value is satisfactory - there is no need for a really low error as this is a battery monitor not a scientific device - it shows the State of Charge of the solar battery and I'm happy with the approximately 5% precision I have measured.

However, I have problems with the offset (2.5V @ 0A) - and this IS a problem as for example even a small negative offset summed over a certain amount of time will lead to the monitor saying that my battery is empty .

  1. It is really temperature dependent (obviously) so I added a €0.2 thermistor to the circuit and made a series of measurements for temperature compensation. It works kinda well, but to see a non-zero offset when everything is off is kinda irritating.
  2. The signal is kinda noisy. I'm sampling @1kHz and averaging over 2sec periods which gives fair results while still allowing for integer maths and remaining sortof "real-time". The offset goes off by as much as 0.1A occasionally and I'd like to reduce this further.

So my questions:

  1. Any better idea for temperature compensation then adding a thermistor? Any tricky way of getting that 2.5V rock solid as that is my zero point?
  2. Any ideas for reducing signal noise? As my signal from the shunt resistor is tiny, I haven't put any filters between it and the LM324 as I was concerned its effect on the low signal. The wiring is pretty heavy-duty for this application (1.5mm2) twisted pair maybe 0.5m long only.
  3. Or is the LM324 so noisy that it might be causing the offset problem? In this case any suggestions for a similar category opamp that is better suited for this type of application?

And in general if you have any global suggestions to the improvement of this project - more then welcome.

Thanks

Any reason not to use a current sensor or transducer? You mentioned price but for example the ACS758 is only $7 for one-off and should be a plug and play with no shunt required.


Rob

Why don't use 2 analog inputs on the arduino and use an inverting + non-inverting opamp combo. I did something similar and it worked perfectly. Most of the opamps come in packs of 2 so won't need any extra components. just 2 extra resistances for the inverting gain. but that's it. this way one signal will give you zero and the other a value, depending on which pin it is, you know if it's positive or negative.

I'm adding 2.5V/47[V] to this signal and then amplify it *47 to get an output with 0A @ 2.5V

My calculator shows: 2.5 / 56 = 44.64

going to -56A @ 0V and +56A @ 5V

No, according to LM324 datasheet max output 3.5V, so your upper limits is (3.5 - 2.5)/44.64 = 22.4 Amps.
Looking at the drawings, I'm not convinced that gain 47, probably around 470 / 6.66 = 70.5, as R2 has || R1 & R4.
If buying specially design current sensor / chip isn't an option, than I'd suggest to make 2 current sensing resistors, place them in close proximity to have same temperature, than periodically (let say every 10 min) re-calibrate all hardware set-up. Timer will run in software , triggering every 10 min, than input multiplexing circuit would switch inputs from current- passing resistor to its idle counterpart, take a fast measurements ( a few msec should be o'k not to introduce big error in the results), calculate "0" level for this time period. This way all 3 sources of error ( temp-resistance dependence of sensor, OPA offset, ADC offset) could be suppressed.
For noise reduction, simple RC LPF at the input should be sufficient.

Replace the '324 with an LMC662... it is a dual Cmos opamp whose inputs work well around ground. A split (Bi-polar) supply would make this a Piece of cake however If you bias the opamp to mid voltage or Vcc/2 it will work well from a single ended supply AND it's outputs will swing rail to rail, it is also low current 150uA/section... and a max Vcc of 15 Volts... Come to think of it I did use one once in a dc amplifier for a moisture probe and it was ok, nothing special... IMO

Doc