Author Topic: Building current sense circuit [solved]  (Read 3609 times)

0 Members and 1 Guest are viewing this topic.

Offline StanliTopic starter

  • Newbie
  • Posts: 2
Building current sense circuit [solved]
« on: July 15, 2015, 07:40:00 pm »
I'm trying to build a current sensing circuit which translates the current directly into voltage so it can then be read by a micro.
It is an op amp buffer and an op amp comparator in series; I actually used a circuit similar to Dave Jone's uSupply current sense part hoping I won't forget anything and it could just work.

The OpAmp I'm using is ST LM358 (datasheet); the current shunt resistor is 1R, load resistor is 470R, all other resistors are 10K; the power is provided by a 8.9V battery. Schematic is attached (hopefully not too crusty...)

The voltage on the shunt is about 20 mV and the current is about 20 mA, as expected. But when I measured the voltage between ground and sense output, I got about 2.1V which is ~10^2 bigger than the expected 20mV. When I measured the voltage between ground and the output of the op amp buffer, I got about 7.9V, which is about 1V lower than expected.

The comparator seems to work correctly, however the buffer drops the voltage by about 1 volt and I can't figure out why.

What am I missing?
« Last Edit: July 15, 2015, 08:29:22 pm by Stanli »
 

Online Rick Law

  • Super Contributor
  • ***
  • Posts: 3442
  • Country: us
Re: Building current sense circuit
« Reply #1 on: July 15, 2015, 07:50:03 pm »
LM358 is not rail to rail.  Meaning your Vout of LM358 voltage will not get to the rail voltage which is in your case rail is 0V for low and 8.9V for high.

In fact, for the 8.9V powered LM358 to output 7.9V is just about as good as it gets.  My best LM358 gets to about 1.2V below Vin.

Trying using a rail to rail opAmp or redesign your circuit like:
(a) power your opamp by 10.5V or
(b) using a current sensing IC like INA219 which is designed for current sensing.
« Last Edit: July 15, 2015, 07:57:32 pm by Rick Law »
 

Offline StanliTopic starter

  • Newbie
  • Posts: 2
Re: Building current sense circuit
« Reply #2 on: July 15, 2015, 08:19:08 pm »
LM358 is not rail to rail.  Meaning your Vout of LM358 voltage will not get to the rail voltage which is in your case rail is 0V for low and 8.9V for high.

In fact, for the 8.9V powered LM358 to output 7.9V is just about as good as it gets.  My best LM358 gets to about 1.2V below Vin.

Trying using a rail to rail opAmp or redesign your circuit like:
(a) power your opamp by 10.5V or
(b) using a current sensing IC like INA219 which is designed for current sensing.
I see, thank you for a fast reply.

I confirmed experimentally, when the input voltage for the load is lower, the circuit performs as expected.

I wanted to use this for overcurrent protection independent of the micro, but I guess doing it in software will be fine.
 

Online Rick Law

  • Super Contributor
  • ***
  • Posts: 3442
  • Country: us
Re: Building current sense circuit
« Reply #3 on: July 15, 2015, 08:36:07 pm »
LM358 is not rail to rail.  Meaning your Vout of LM358 voltage will not get to the rail voltage which is in your case rail is 0V for low and 8.9V for high.

In fact, for the 8.9V powered LM358 to output 7.9V is just about as good as it gets.  My best LM358 gets to about 1.2V below Vin.

Trying using a rail to rail opAmp or redesign your circuit like:
(a) power your opamp by 10.5V or
(b) using a current sensing IC like INA219 which is designed for current sensing.
I see, thank you for a fast reply.

I confirmed experimentally, when the input voltage for the load is lower, the circuit performs as expected.

I wanted to use this for overcurrent protection independent of the micro, but I guess doing it in software will be fine.

You are welcome.  Folks here have been helpful so I am just trying to "pay back".  I am no expert - it took me by surprise the first time l came across it as well.

One trick I use for quick and dirty circuit is to send it via a rectifier diode before shunt which drops it by about 1.5V.

With the diode trick: the 9V goes to your opAmp power and to the rectifier diode.  The output of the rectifier diode goes to your shunt's high-side.  Now shunt-high will not exceed Vin-1.5V.  This is "quick and dirty" and just burn the 1.5V away before it hits your shunt+load.  So make sure you have a good size diode that can take the power dissipation.

You should also consider measuring at the LOW side.  That has its draw backs as well, but you can compare which nut is easier to crack.
 

Offline leblanc

  • Regular Contributor
  • *
  • Posts: 51
  • Country: ca
Re: Building current sense circuit [solved]
« Reply #4 on: July 20, 2015, 11:53:43 pm »
You might be interested in allegro's Hall effect current sensors. Not super expensive,  very small part count, and you're isolated from the current being measured. You can get them for small currents and very large currents (some in the hundreds of amps).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf