Difference Amplifier Circuit Won't Read 0 - Page 1
Forum section: electronics / beginners

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 04:58:57 pm
content: This is my first post and I'm learning as I go. I'm still a n00b at all this. I have been watching Dave's videos and trying to teach myself as I go along.I have been messing with an op amp in differential mode.I am using an OP177 ultra precision op amp.http://www.analog.com/static/imported-files/data_sheets/OP177.pdfMy issue is that for whatever reason I cannot get the circuit to output 0 volts like it does in the simulator. I get a minimum reading of 0.689 volts. Am I doing something stupid?? I have noticed that this isn't advertised as a rail to rail op-amp is that the reason for this?I have tried the trim feature of the chip, however it only trims a tiny range. No where near 0.I'm trying to make a circuit that can read battery voltage 8-16 volts. If the battery is below 8 volts its garbage so I want to maximize the ADC by only measuring the voltage over 8 volts. I'm trying to keep the cost of the project down by using the atmega ADC.EDIT: I should note that it the circuit does work. It just isn't work as I expected. I'm losing a significant portion of my ADC range with that 0.689 offsetEDIT2: I also tried matching resistors thinking it could be an issue there. Went through a bunch and found matching resistors.. No joy

author: ConKbot
author_rank: Super Contributor
timestamp: January 23, 2014, 05:37:22 pm
content: The input voltage range per the datasheet is +/- 13v(min) +/- 14v (typical) but that is with a +/- 15V supply, so it looks like you cant go within 1-2v of the supply rail on the input. How do you have your amp set up? Inputs shorted and floating? shorted to ground? what supply voltages are you giving it?If the input is shorted but floating, then unequal leakage currents could be floating the input against one rail or the other, but it could be so high impedance, that you cant measure it with a DMM

author: fcb
author_rank: Super Contributor
timestamp: January 23, 2014, 05:38:35 pm
content: What are your supply rails doing?

author: robrenz
author_rank: Super Contributor
timestamp: January 23, 2014, 05:51:20 pm
content: AFIK in a differential amplifier arrangement the matchin tolerance of those 100k resistors is very important. My guess is that is 99% of your problem.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 05:54:32 pm
content: fcb:Supply rails are supplied by a Rigol DP832. I'm just bench testing the circuitConKbot:I'm powering the chip with +10 volts.The - on the Op-Amp is being fed 4.096 volts (through the resistors)The + on the Op-Amp is being fed 0 Volts (through the resistors)If I feed anything higher than 4.76 volts into the + pin then it works as expected.Anything under 4.76 volts on the + pin outputs 0.689It does work as expected however I'm missing the 4.096 - 4.76 range.I've tried different voltages on the power supply however it doesn't seem to make a difference.The inputs are floating.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 06:00:41 pm
content: Quote from: robrenz on January 23, 2014, 05:51:20 pmI tried matching resistors. I picked them using my Extech EX330 multimeter. They should be a fairly close match.Honestly I noticed very little difference between matched and unmatched resistors.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 06:06:48 pm
content: I guess its not a huge deal. It just changes the range I can measure to ~9.5 Volts to ~16 volts. I was just shooting for perfection. It has to be because its not a rail to rail deviceIf someone has a solution though I'm VERY interested!

author: tszaboo
author_rank: Super Contributor
timestamp: January 23, 2014, 06:29:32 pm
content: Quote from: Travis on January 23, 2014, 05:54:32 pmAs they already said. The opamp is not rail to rail. You need a negative supply to make your circuit work.Also, please correct the title. This is not a differential opamp, this is a difference amplifier circuit. The two are very different.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 06:35:13 pm
content: Quote from: NANDBlog on January 23, 2014, 06:29:32 pmThanks for the additional information. I will try adding a negative supply.Thanks for the correctionI am still learning.

author: granz
author_rank: Regular Contributor
timestamp: January 23, 2014, 06:48:22 pm
content: I think you've already figured out that you can't get as close to the supply rail (0V) as you'd like without using a rail-to-rail opamp. On a different note: by your schematic, I'd guess you are using the "EveryCircuit" Android app for simulation. You might want to take some time and learn how to use a better simulator, such as LTspice (which is also free). That Android app is really only good for basic concepts, it's not really an engineering simulator. Once you learn something like LTspice you'll also be in a better place to learn to use professional (expensive) simulation tools down the line.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 06:58:22 pm
content: Quote from: granz on January 23, 2014, 06:48:22 pmYou are correct that is EveryCircuit. I have learned a lot from it however I smack up against its limits constantly. As you say its good for basic concepts.Thanks for the tip. I will download LTspice and give that a shot.

author: filip_cro
author_rank: Regular Contributor
timestamp: January 23, 2014, 07:00:24 pm
content: You can't put voltage divider before Dif Amp. Use low impedance source like op-amp.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 07:44:31 pm
content: Quote from: filip_cro on January 23, 2014, 07:00:24 pmThanks for the tip. I wondered if that would require an op-amp of its own. Currently I don't have that voltage divider in the circuit because I was just trying to see if the chip itself would work.I made a split power supply using 2 - 9 volt batteries. It works perfectly with a split power supply (except that it gives negative voltages).Unfortunately that won't work in my final design so I've gotta get a rail to rail op-amp or just live with the range I have with this one. 9.5 volts is still WAY dead for a 12 volt lead acid battery.

author: Rerouter
author_rank: Super Contributor
timestamp: January 23, 2014, 07:55:16 pm
content: try adding a 3.3-10K load to ground on your output, you can overcome its rail to rail output issues a little by helping it get closer to the rail, (single supply)

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 08:05:08 pm
content: Quote from: Rerouter on January 23, 2014, 07:55:16 pmThat helped get it a little closer. However it still seems to behave the same. 4.76 volts required before it reacts.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 08:28:29 pm
content: http://www.digikey.com/product-detail/en/MCP6004-I%2FP/MCP6004-I%2FP-ND/523060Would a cheap part like that work?My goal is to measure the voltage with little error. My first attempt was just a voltage divider driving the atmega. It worked however there was not enough resolution in the ADC and it hopped all over the place. I am shooting for less than 0.01 volt accuracy.The reason I went with 4.096 in the difference amplifier is because I'm already using that in the design for the aref voltage. I'm trying to keep the part count down.This is part of a bigger project that also measures current using a hall effect sensor

author: fcb
author_rank: Super Contributor
timestamp: January 23, 2014, 09:54:57 pm
content: It's the rails. The circuit should do what it's laid out to do (whatever that is) - but only if you supply enough volts to the opamp, and read the datasheet, most opamps won't go to the rails.DP832 - I was interested in the voltages, not what generates it!NB: The MCP600x is great little opamp - but only rated to 6v.

author: Travis
author_rank: Contributor
timestamp: January 23, 2014, 10:30:14 pm
content: Quote from: fcb on January 23, 2014, 09:54:57 pmI've gotta get better at reading the data sheets. I didn't realize it was only rated to 6 volts. Back to the searches with another thing to keep in mind.Thank you very much to everyone who has given info.

author: Odysseus
author_rank: Regular Contributor
timestamp: January 24, 2014, 02:26:43 am
content: Great resource:"Single-Supply Op Amp Design Techniques" - Texas Instruments