Maker Pro
Maker Pro

Op Amp not working properly LM324

TheLacasse

Jun 8, 2015
15
Joined
Jun 8, 2015
Messages
15
Excuse my english

Hi I'm a beginer and I want to amplify the music that out of my iPod using an op amp. I used an app on my iPod that generate sin wave to figure out what is the maximum voltage that my iPod can deliver it turn out that it's around 0.25V. I want my LM324 to output 5V when my iPod deliver 0.25V so the gain of the op amp need to be 5V/0.25V=20 for that I used 2 resistor to set the gain of the op amp 1+100K/5.25K=20.0476. The problem is that when my iPod deliver 0.25V the op amp don't output 5V but around 2.25V also when I disconnect my iPod of the op amp the output voltage of the LM324 goes up to it supply voltage I don't want to wreck my arduino by disconnecting my iPod.

OP AMP.png P.S. it's not a LM321 but a LM324

Thanks!
 
Last edited by a moderator:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Pehaps it would give 5V if the amp were also supplied with a negative supply to give the full waveform.
 

TheLacasse

Jun 8, 2015
15
Joined
Jun 8, 2015
Messages
15
Pehaps it would give 5V if the amp were also supplied with a negative supply to give the full waveform.
I'm not sure to understand what you want to mean can you explain it in detail I'm just a beginner

Thanks!
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Presumably the input signal is centred around GND so that it goes from +0.25V to -0.25V.
Amplifying this by 20 will give +5V to -5V.

However, the op amp does not have a negative supply so cannot provide a negative output voltage.
You can either provide a negative supply of around 9V or lift the input to half the supply voltage. You will need more than 9V, 15V may do it.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
It sounds like your only amplifying the top part of the waveform, which is half 0.25 Volts. This explains why it's 2.5 Volt, and the reason is you don't have a negative supply so the output will only go as low as 0 Volts. You need to either create a virtual point for the output of the opamp or use a split supply. If you decide to use the virtual point option you will need a capacitor on the output because this point will be at 4.5 Volts. You will also have limited output swing as the opamp can only swing within a few volts of the supply so you will have to power the opamp from a higher voltage. I haven't checked this device but 1-2 volts is quite common for non rail to rail types
Adam
 

davenn

Moderator
Sep 5, 2009
14,265
Joined
Sep 5, 2009
Messages
14,265
I'm not sure to understand what you want to mean can you explain it in detail I'm just a beginner

Thanks!

what duke is telling you, but didn't fully explain, is that you need a split (dual)rail power supply

1) take two 9V batteries, connect positive of one to negative of the other, from there take a wire to your GND
in your circuit ( that is your 0V rail)

2) take a wire from the unused + battery terminal to the + power pin (5) of the op-amp ( that is your + rail)

3) take a wire from the unused - battery terminal to the - power pin (2) of the op-amp ( that is your - rail)


Dave
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
What are you trying to drive with this? An LM324 will not drive a speaker.

Bob
 

TheLacasse

Jun 8, 2015
15
Joined
Jun 8, 2015
Messages
15
What are you trying to drive with this? An LM324 will not drive a speaker.

Bob
I want my arduino to read the output of the LM324 (analogRead) but if I use a split rail power supply the LM324 will output -5V to 5V but an arduino cannot read negative voltage.

Thanks!
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Okay, it helps when you tell us what you are trying to do. What you want is a ±2.5V signal with a 2.5V DC offset. This gives you a range of 0 to 5V.

Run your input through a capacitor, followed by 10K resistors to ground and 5V. Connect this to your + input. Change the gain to 10. And use at least 8V to power the LM324, because the output cannot go higher than 2V less than V+.

Bob
 

TheLacasse

Jun 8, 2015
15
Joined
Jun 8, 2015
Messages
15
Okay, it helps when you tell us what you are trying to do. What you want is a ±2.5V signal with a 2.5V DC offset. This gives you a range of 0 to 5V.

Run your input through a capacitor, followed by 10K resistors to ground and 5V. Connect this to your + input. Change the gain to 10. And use at least 8V to power the LM324, because the output cannot go higher than 2V less than V+.

Bob
Sorry I feel like I'm an idiot but what I understand is that the output is going to be +/- 2.5V and then I'll add a 2.5V dc offset that will raise it to 0V-5V but I don't even know how dc offset work and how to create one also when you say "Run your input through a capacitor, followed by 10K resistors to ground and 5V." where the 5V came from it sound like a high pass filter.

Excuse my english.
Thanks.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
No, the output will be 0-5V. The offset is added as part of the amplifier circuit. Here is a complete practical circuit:

upload_2015-8-3_16-59-6.png
The 5V supply should be the same one used to power the Arduino.

The 5.1V Zener clamps the output voltage at a safe level for your Arduino input and is necessary to prevent damage to it.

You can see that the bottom of the sine wave is a little distorted, you can avoid this by making the gain a little less (by reducing R8) so that it does not go all the way to 0.

With no input, your Arduino ADC will read 2.5V.

Bob
 

AnalogKid

Jun 10, 2015
2,896
Joined
Jun 10, 2015
Messages
2,896
No, the output will be 0-5V. The offset is added as part of the amplifier circuit. Here is a complete practical circuit:
The 5V supply should be the same one used to power the Arduino.
The 5.1V Zener clamps the output voltage at a safe level for your Arduino input and is necessary to prevent damage to it.
You can see that the bottom of the sine wave is a little distorted, you can avoid this by making the gain a little less (by reducing R8) so that it does not go all the way to 0.
With no input, your Arduino ADC will read 2.5V.

You can eliminate the dependence on the Arduino's +5V supply by changing R2 to 26.1K. Also, note the addition of C2. This is critical to how the circuit amplifies the AC audio but not the DC offset.

ak
 
Top