PDA

View Full Version : Discussion For the Circuit Gurus What's wrong with this circuit?


rocky79
May 05, 2006, 09:56 PM
Hello
I am using a voltage substraction circuitry to substract a voltage reference that is set to 4.2v from a sensor output. the circuit doesn't work, please look at the schematic for more explanation.
For all the circuit gurus! any idea what's wrong with this circuit?

Thanks a lot

JimDrew
May 05, 2006, 11:06 PM
The results you are getting are not surprising based on the voltages you see at each point and how the op-amps are wired. What exactly are you trying to accomplish here? If it's just a simple switch when the voltage peaks at 4.2v (like you would do for a Lipo charge circuit), and you really have a microcontroller, just use it to measure the voltage and forget the op-amps completely. If you use successive approximation with a 10 bit A/D, you can exceed 1mv resolution. This is what we do with our balancer.

Dan Baldwin
May 05, 2006, 11:17 PM
The reason that the follower isn't tracking the 4.2 volts on the voltage divider is that the LM324 is not a rail to rail op amp. The closest it can get to the positive rail is about 1.5 volts, which is about what you are seeing.

Dan

pmackenzie
May 05, 2006, 11:19 PM
The data sheet for the LM324 specifies a voltage swing of from 0 to Vcc-1.5.
http://cache.national.com/ds/LM/LM124.pdf
You will need an op amp that can swing rail to rail for your circuit to work.
Pat MacKenzie
edit - Dan types faster than I do!

rocky79
May 06, 2006, 02:21 AM
Thanks guys for Pointing that out. but what about the reason that the ouput of opamp#2 is 0.8v while the difference at it's input is 0.05v or 50mv. the data sheet mentions that the Voutput low is about 5mv.

vintage1
May 06, 2006, 05:45 AM
Thanks guys for Pointing that out. but what about the reason that the ouput of opamp#2 is 0.8v while the difference at it's input is 0.05v or 50mv. the data sheet mentions that the Voutput low is about 5mv.

Dunno, biut you are unlikley to get any op amp to drive much below 0.8v - thats a saturated transitor.

If you want to swing closer to the rails, use pull up or pull down resistors on the output. This works fine on low current appliactions like this..the push pull natire of te output is overridden by te resistor, and you get sngle ended operation.

I'd say a 470R resistor TO the rail on the first opamp, and another to the deck on the second one, would make this all work the way you want.

pmackenzie
May 06, 2006, 08:45 AM
Thanks guys for Pointing that out. but what about the reason that the ouput of opamp#2 is 0.8v while the difference at it's input is 0.05v or 50mv. the data sheet mentions that the Voutput low is about 5mv.
Similar problem.
The common mode input range is also Vcc-1.5 volts.
Pat MacKenzie

Dan Baldwin
May 06, 2006, 09:17 AM
Another problem is that you have the inverting (-) and non-inverting(+) ouputs reversed if you are trying to make a differential to single ended converter. You have feedback to the + input meaning that the amp output will always be latched either high or low.

Dan

Nicetie
May 06, 2006, 10:30 AM
You are trying to operate outside the common mode range of the first op-amp.
A 5V supply is insufficient to power this circuit within the op-amp spec for common
mode range. To verify this just increase the supply voltage to 6 or 7 volts.

Ken K5MBV

rocky79
May 06, 2006, 11:54 AM
I see, now it makes sense,. Any suggestions for a dual opamp that is rail to rail output swing
thanks

GlowFly
May 06, 2006, 12:24 PM
I see, now it makes sense,. Any suggestions for a dual opamp that is rail to rail output swing
You will likely find the CMOS op-amps more suited for rail-rail swing. I seem to remember the old CA3130 offered rail-rail ouptut.
--
Steve

rocky79
May 06, 2006, 12:37 PM
(1).I was browsing the mouser catalog and i found the microchip MCP6002. It's got a rail to rail input output for $0.28 in a dual package.Supply from 1.8v to 5.5
Is there anything else i should be looking at?

(2).I am also wondering if am missing something in the substracting amplifier configuration? Can anyone suggests a better configuration?
All i am trying to do here is substract 2 voltages.( sensor from a reference voltage)

P:S Thanks Dan, i will flip the polarity on the opamp.

Nicetie
May 06, 2006, 11:15 PM
(1).I was browsing the mouser catalog and i found the microchip MCP6002. It's got a rail to rail input output for $0.28 in a dual package.Supply from 1.8v to 5.5
Is there anything else i should be looking at?

(2).I am also wondering if am missing something in the substracting amplifier configuration? Can anyone suggests a better configuration?
All i am trying to do here is substract 2 voltages.( sensor from a reference voltage)

P:S Thanks Dan, i will flip the polarity on the opamp.

(1). Make sure that the common mode spec of the rail to rail device
allows the full range of sensor output voltage deviation.

(2). If you are using the second stage of the op-amp as a comparator you
don't absolutly have to use the first stage (buffer), although it's always
a good design technique in order to eliminate any possible deviation of
the reference voltage due to "loading".

Ken K5MBV

JimDrew
May 07, 2006, 12:08 AM
Another problem is that you have the inverting (-) and non-inverting(+) ouputs reversed if you are trying to make a differential to single ended converter.

This is what I saw right off the bat, I didn't even bother to see what op-amp was actually being used. I would recommend the MCP602 for this application. It is nice single supply, rail-to-rail, op-amp with plenty of bandwidth product for virtually any application.

INewton
May 07, 2006, 01:22 AM
Hello
I am using a voltage substraction circuitry to substract a voltage reference that is set to 4.2v from a sensor output. the circuit doesn't work, please look at the schematic for more explanation.
For all the circuit gurus! any idea what's wrong with this circuit?

Thanks a lot

You need to switch R2 and R4 connections to the inputs of the second op amp to get the feedback right. And you need to supply -5V to the second op amp if you want the output to go from 0V to 2.2V.

Also what's the output resistance of the sensor? If it's too high you'll need another voltage follower like the first op amp. Or you can just change the 1k resistors to 100k around the second op amp.

rocky79
May 07, 2006, 01:35 PM
You need to switch R2 and R4 connections to the inputs of the second op amp to get the feedback right. And you need to supply -5V to the second op amp if you want the output to go from 0V to 2.2V.

Also what's the output resistance of the sensor? If it's too high you'll need another voltage follower like the first op amp. Or you can just change the 1k resistors to 100k around the second op amp.

I measured the resistance from the sensor output and it was 17 K ohms.Yes your right i need to buffer that output too. Thanks for the feedback

rocky79
May 07, 2006, 05:36 PM
You need to switch R2 and R4 connections to the inputs of the second op amp to get the feedback right. And you need to supply -5V to the second op amp if you want the output to go from 0V to 2.2V.


I changed the polarity like you said.I tried to power the amplifiers with a 10v single supply.The voltage followers worked fine. But i am not getting a correct substraction of Opam#2. I keep getting 0.8 v output.
The datasheet mentions that with a single supply, Vout can get as close as 25mv to ground.

INewton
May 07, 2006, 07:29 PM
I changed the polarity like you said.I tried to power the amplifiers with a 10v single supply.The voltage followers worked fine. But i am not getting a correct substraction of Opam#2. I keep getting 0.8 v output.
The datasheet mentions that with a single supply, Vout can get as close as 25mv to ground.

Well, you need to trim out any offsets (the difference between the voltage output of the two voltage followers).

But... If it were me, I'd just take the output from the sensor's voltage follower and give that buffered signal to the A/D converter. You can do the zeroing and gain adjustments in software. All you really need is one op amp!

rocky79
May 07, 2006, 08:37 PM
Well, you need to trim out any offsets (the difference between the voltage output of the two voltage followers).

But... If it were me, I'd just take the output from the sensor's voltage follower and give that buffered signal to the A/D converter. You can do the zeroing and gain adjustments in software. All you really need is one op amp!

well the idea here is to gain resolution. The A2D vref will be only 2v.

INewton
May 07, 2006, 08:48 PM
well the idea here is to gain resolution. The A2D vref will be only 2v.

At most you're only throwing away 1 bit of resolution (2.2V vs 5V swing), but you'd be gaining some linearity because you'll be away from the supply rails.

In fact if you really wanted resolution the differencing amp should have a gain of two.

To do it your way, you'll need two pots, one for offset and one for gain.

BTW. I'm not really an EE, I just stayed at the Holiday Inn Express this weekend.

Dan Baldwin
May 08, 2006, 12:49 PM
Rocky could you give us a schematic of exactly the way you have it hooked up now as well as voltages?

Dan

rocky79
May 08, 2006, 02:42 PM
Rocky could you give us a schematic of exactly the way you have it hooked up now as well as voltages?

Dan
Sure, Dan. Here is the new schematic of exactly how i connected it.Why am i getting that 0.8v ? that's what i don't understand.
Note: i powered the circuit of a 10v supply. Now i am operating away from the rail.

INewton
May 08, 2006, 03:32 PM
Sure, Dan. Here is the new schematic of exactly how i connected it.Why am i getting that 0.8v ? that's what i don't understand.
Note: i powered the circuit of a 10v supply. Now i am operating away from the rail.

As I mentioned before, R1, R2, R3 and R4 need to be at least 100k since the sink current of the LM324 is limited to about 10 uA near the negative supply.

I'd use 1% 220k RN55C resistors.

Dan Baldwin
May 08, 2006, 06:22 PM
The LM324 can only get to within 20 mv of the negative supply rail if it is not sinking current. About .8 volts is as low as it will go if you are sinking current. In your configuration it will always be sinking current because of the feedback path. You need to get a true rail-rail input/output op amp, and use larger feedback resistors.

You could also adjust your range such that about 1 volt is as low as the output of the LM324 will ever have to go if you don't want to get a new op amp.

Dan

rocky79
May 08, 2006, 06:39 PM
As I mentioned before, R1, R2, R3 and R4 need to be at least 100k since the sink current of the LM324 is limited to about 10 uA near the negative supply.

I'd use 1% 220k RN55C resistors.
Can you explain how you got the 100k? or you just want to make sure you don't exceed the 10uA at the Opamp inputs?

rocky79
May 08, 2006, 06:57 PM
Yes, It finally worked !! using the same Opamp, just by using bigger feedback Resistors.
Newton and Dan, i appreciate very much your response.You guys saved me from the maze i was in. Keep up the good work
Thank you again