Differential amplifier for measuring current - Page 1
Forum section: electronics / beginners

author: Shark
author_rank: Contributor
timestamp: August 26, 2013, 08:54:38 pm
content: Hi guys! I'm trying to create my own SLA battery charger and I'm preparing the current sense part. I would like the circuit to:1) Measure charging current when the battery is being charged, and2) Measure discharge current when I discharge the battery with a load.I came up with a solution to use a low-side current sense 100mOhm resistor which is passed to a differential amplifier with a gain of 10. I used two amps so that I can invert the polarity to get readings in both cases (charging and discharging).First of all I would like to know if I'm on the right track. Secondly, I will be passing output of the two differential amplifiers to Arduino ADC and need to avoid negative voltage, or at least make it minimal.

author: Paul Price
author_rank: Super Contributor
timestamp: August 26, 2013, 11:53:29 pm
content: Some suggestions:Use .01 ohm and set gain to 100, saves wasted power and works as well.Make two x101 gain amps, identical (R output to neg in =100k, R neg-input to sense resistor =1k). Connect both across the .01 ohm sense resistor, but reverse the plus/minus inputs to the sense resistor with the second current sense op-amp. The first op-amp gives you the charging current (+ input of op-amp to battery - terminal side of sense resistor)The second op-amp gives you discharge current (-input of op-amp to battery - terminal sense resistor).Use a LM358 since you only need two op-amps.Let the MCU calculate and correct the gain factors to 100.Ground the neg. power pin 4 on the LM358.There will never be any negative voltage output to your MCU A2D inputs.

author: tszaboo
author_rank: Super Contributor
timestamp: August 27, 2013, 11:33:45 pm
content: Hi,I wrote in my blog a solution for your problem, as I find it an excellent question, and want to keep it for future :http://nandblog.com/current-shunt-monitors/

author: ivan747
author_rank: Super Contributor
timestamp: August 28, 2013, 01:47:47 am
content: Quote from: Paul Price on August 26, 2013, 11:53:29 pmI differ. The power wasted in the resistor is 0.08W, even less than 1/4W. I would consider changing the value only at 10A, when power wasted is 1W. It then makes sense to use a 10m-ohm resistor, but then you have to take into account the op-amp's offset voltage because the gain is 100 instead of 10.

author: Shark
author_rank: Contributor
timestamp: August 28, 2013, 07:53:45 am
content: Hi again!Paul, I used a 0.1 ohm resistor because it was easier to come by and as ivan747 pointed out, power loss isn't very big. I also estimated that the voltage drop when charging (50mV @ 0.5Amp) is negligible as I currently use a slow charger. Thanks for your tip about LM358, as I don't need four channels.NANDBlog, thank you for a very thorough look and explanation, I promise to be more doubtful of the simulation software (Multisim). You exposed a problem of two different grounds. I tried with the grounds joined and the results were pretty much alike, huge negative voltage on U2B. Then, yes, I've been avoiding instrumentation amplifiers because I've never dealt with them before, but I'll give a look at them now and the datasheet you recommended.Thanks to all, I'm learning a lot!

author: tszaboo
author_rank: Super Contributor
timestamp: August 28, 2013, 05:56:01 pm
content: Analog devices has a very thorough application note on In-amps, i highly recommend to at least read the first 2 chapters. After they understood, it is clear, that they are superior in a lot of aspects, compared to opamps.But for this application, a current shunt monitor should be enough.http://www.analog.com/en/power-management/power-monitors/ad8557/products/CU_dh_designers_guide_to_instrumentation_amps/fca.html