2 stage op amp, single suppy and an arduino, what is wrong with my circuit? - Page 1
Forum section: electronics / beginners

author: xchip
author_rank: Regular Contributor
timestamp: May 06, 2014, 08:57:18 pm
content: Hi guysI hope you can help me, as a learning exercise I built the circuit in the pic. I'd like to know what is wrong with this particular circuit The input to the amplifier is just a coil.I am sure I am making a pretty basic mistake but I dont see it! :-)Details- I am using the 5v and the GND from the Arduino- The op amp is an LM324- R is 10KI am looking forward to your opinions :-)Cheers!xchip

author: Andy Watson
author_rank: Super Contributor
timestamp: May 06, 2014, 09:17:37 pm
content: The positive input to the second op-amp has no provision for bias current - it is effectively floating. Then you appear to have shorted-out the signal at the input to the ADC.

author: DrGeoff
author_rank: Frequent Contributor
timestamp: May 06, 2014, 09:22:53 pm
content: In addition, why do you need the capacitors on the op amp outputs when you have biased everything at half rail? It looks like you are also wanting to bias the ADC input to half rail, however as Andy points out, you have shorted it to half rail, killing the signal. Just remove the capacitors between the op amps and remove the connection between the ADC input and your bias supply.

author: xchip
author_rank: Regular Contributor
timestamp: May 06, 2014, 09:36:25 pm
content: Hi! Thanks for your prompt reply! Inline:Quote from: Andy Watson on May 06, 2014, 09:17:37 pmHow would you fix this? Should I put a resistor from the + input to ground?Quote from: Andy Watson on May 06, 2014, 09:17:37 pmAfter the cap I am just getting positive and negative values around zero, the ADC wont handle negative values that is why I need to add 2.5volts to center the signal.Thanks!xchip

author: xchip
author_rank: Regular Contributor
timestamp: May 06, 2014, 09:39:20 pm
content: Quote from: DrGeoff on May 06, 2014, 09:22:53 pmAfter each op-amp I get a small DC offset. The second op-amp amplifies the DC offset of the first one and the signal gets clipped. I put a cap after each op-amp to remove that dc offset.Is there any pdf or tutorial that explains how to do this the proper way?? I havent seen any!Thanks!

author: DrGeoff
author_rank: Frequent Contributor
timestamp: May 06, 2014, 09:43:53 pm
content: Quote from: xchip on May 06, 2014, 09:39:20 pmThat's normal. You can calibrate it out by trimming the input offset bias at the first stage.Since you have not given details of your input signal/sensor, then it can't be assumed that it can be AC coupled.

author: Andy Watson
author_rank: Super Contributor
timestamp: May 06, 2014, 09:45:34 pm
content: Quote from: xchip on May 06, 2014, 09:36:25 pmResistor to the 2.5V reference.QuoteConsider the answer to previous question!Although, I have to say I agree with the Dr., remove the caps. With a total gain of only ~100 you won't be (much) troubled by offset voltages.

author: xchip
author_rank: Regular Contributor
timestamp: May 06, 2014, 11:24:11 pm
content: Quote from: Andy Watson on May 06, 2014, 09:45:34 pmHi Andy and the Dr,I removed the caps and it is working nicely, thanks!Now I would like to understand how to make it work with the caps (in case I want to use a higher gain)And what is the principle/reason that requires those resistors to be there? I've been googling for a while but couldnt find anything! Feel free to point me to a resource/link that I could read :-)CheersRaul

author: Andy Watson
author_rank: Super Contributor
timestamp: May 07, 2014, 12:20:42 am
content: Quote from: xchip on May 06, 2014, 11:24:11 pmIn a nutshell: nothing's perfect! You need to consider what happens if, bysome means, those capacitors become charged. The resistors are there to "leak" away that unwanted charge - in this case to your 2.5V reference level. The LM324 is a bi-polar op-amp, its input transistors require a "bias" current - 20nA according to the data sheet. This is a very small current but you can't ignore it - it needs to be considered when you design the circuit.Dave did a video a while back - it was primarily about offset errors, but it also explained why and where they arose. At the risk of being flamed to a crisp I'm going to suggest "The Art of Electronics" as a readable introduction to the basics (yes I know it lacks the rigorous mathematics that the pedants require).If you feel you must reduce the offsets consider where/which stages of the amplifier are going to contribute the most error and decouple them. Another trick that you might consider is that it is very easy to subtract offsets in software.

author: DrGeoff
author_rank: Frequent Contributor
timestamp: May 07, 2014, 12:35:47 am
content: Quote from: Andy Watson on May 07, 2014, 12:20:42 amIf the sensor is a DC voltage or current output then decoupling the gain stages will not work. Instead you need to add trimming to the input to trim out the offset that will appear at the output. This is part of the analogue input calibration procedure. Offset nulling and full-scale calibration.