# Op Amp not working properly LM324

Discussion in 'General Electronics Discussion' started by TheLacasse, Jul 8, 2015.

1. ### TheLacasse

15
0
Jun 8, 2015
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.

P.S. it's not a LM321 but a LM324

Thanks!

Last edited by a moderator: Jul 8, 2015
2. ### duke37

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

Old Steve likes this.
3. ### TheLacasse

15
0
Jun 8, 2015
I'm not sure to understand what you want to mean can you explain it in detail I'm just a beginner

Thanks!

4. ### duke37

5,364
772
Jan 9, 2011
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.

5,164
1,087
Dec 18, 2013
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

5,164
1,087
Dec 18, 2013
LOL you beat me Trevor

7. ### davennModerator

13,901
1,971
Sep 5, 2009
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

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

Arouse1973 likes this.
8. ### BobK

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

Bob

9. ### TheLacasse

15
0
Jun 8, 2015
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!

10. ### BobK

7,682
1,688
Jan 5, 2010
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

11. ### TheLacasse

15
0
Jun 8, 2015
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.

12. ### BobK

7,682
1,688
Jan 5, 2010
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.

Bob

Supercap2F and CDRIVE like this.
13. ### AnalogKid

2,540
722
Jun 10, 2015
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