Author Topic: 2 stage op amp, single suppy and an arduino, what is wrong with my circuit?  (Read 4440 times)

0 Members and 1 Guest are viewing this topic.

Offline xchipTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: es
Hi guys

I 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 10K


I am looking forward to your opinions :-)
Cheers!
xchip
« Last Edit: May 06, 2014, 09:02:00 pm by xchip »
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2099
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.
 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
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.
Was it really supposed to do that?
 

Offline xchipTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: es
Hi! Thanks for your prompt reply! Inline:

The positive input to the second op-amp has no provision for bias current - it is effectively floating.
How would you fix this? Should I put a resistor from the + input to ground?

Then you appear to have shorted-out the signal at the input to the ADC.
After 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

Offline xchipTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: es
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.

After 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!

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
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.

After 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.

That'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.
 
Was it really supposed to do that?
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2099
How would you fix this? Should I put a resistor from the + input to ground?
Resistor to the 2.5V reference.

Quote
Then you appear to have shorted-out the signal at the input to the ADC.
After 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.
Consider 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.
 

Offline xchipTopic starter

  • Regular Contributor
  • *
  • Posts: 58
  • Country: es
How would you fix this? Should I put a resistor from the + input to ground?
Resistor to the 2.5V reference.

Quote
Then you appear to have shorted-out the signal at the input to the ADC.
After 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.
Consider 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.

Hi 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 :-)

Cheers
Raul

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2099
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?
In a nutshell: nothing's perfect! You need to consider what happens if, by some 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 :P  ).

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.


 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
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?
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.

If 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.
Was it really supposed to do that?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf