OpAmp not gaining? - Page 1
Forum section: electronics / beginners

author: sci4me
author_rank: Regular Contributor
timestamp: June 15, 2015, 09:15:50 am
content: Hey guys! So I am trying to make a simple opamp circuit. I am using a LM358 in a non-inverting configuration. My R2 is 470 ohm and my R1 is 330 ohm. Using the formula Av = R2 / R1 + 1, we should have a gain of 2.42.Here is where I suspect I am doing something wrong. I am feeding in a square wave from an arduino.Theoretically this should change the signal from 0-5v to 12.1v right?However, my positive supply to the opamp is only 5v.BUT, looking at the input and output signals on the scope, they are almost identical. They have nearly the exact same amplitude and frequency, it just appears to have a little distortion added. This signal is the EXACT same output I get when using a voltage follower configuration.So what am I doing wrong? (besides only having a 5v rail and expecting 12.1v (that should just clamp it to 5v right?)) Let me know if you need more info.

author: mikerj
author_rank: Super Contributor
timestamp: June 15, 2015, 09:29:27 am
content: You already appear to have an idea of what you've done wrong; how can an op-amp possibly output a 12v signal with a supply of only 5v?The output of the op-amp is clipping because the input is attempting to drive it past the op-amp supply rails. Because the arduino and the op-amp have a same supply rails, you get more or less the same voltage out of the op-amp as you do the arduino.

author: sci4me
author_rank: Regular Contributor
timestamp: June 15, 2015, 09:34:56 am
content: Oh... wow... I feel like an absolute idiot now...Haha, thanks! Of course, it's so obvious.

author: sci4me
author_rank: Regular Contributor
timestamp: June 15, 2015, 09:42:53 am
content: Gah, still no go! I put in a voltage divider between my arduino and the op-amp so that the input is much less than 5v, and when I probe the output of the opamp, it's the SAME as the input!Hmm...

author: mikerj
author_rank: Super Contributor
timestamp: June 15, 2015, 09:57:27 am
content: Quote from: sci4me on June 15, 2015, 09:42:53 amWhat is the actual voltage swing going into the non-inverting input? "Much less than 5v" doesn't really help us.Note that the output of the LM358 can only get within about 1v of it's +ve supply rail even for very small loads. This means the output will start clipping with about 4/2.42 ~ 1.6 volts on the input.If you have a suitable potentiometer then hook that up to the input so you can vary the input level all the way from 0 to 5v, and you should then be able to see the point at which the output starts clipping.

author: sci4me
author_rank: Regular Contributor
timestamp: June 15, 2015, 10:06:59 am
content: I originally tried an input of 1.5v, but I just tried up to 2.5v.I am using a potentiometer to adjust the voltage. It doesn't seem to matter how low I go on the input, the output signal stays the same as the input.I would try using a higher voltage supply but I don't have any bananna plugs for my power supplyI've been using a 5V 10A converter.

author: mikerj
author_rank: Super Contributor
timestamp: June 15, 2015, 10:17:36 am
content: Quote from: sci4me on June 15, 2015, 10:06:59 amYou need to go lower than 1.5v, not higher. If the output is still clipping with e.g. 0.5v on the input, then it suggests that either your circuit is wired incorrectly, or the resistor values are not what you think they are. Can you show us a pic of your circuit?

author: sci4me
author_rank: Regular Contributor
timestamp: June 15, 2015, 10:24:49 am
content: Alright guys, I got it.I made a pretty embarrassing mistake... I won't tell you what it is except to say it has to do with the resistors.....Thanks a lot guys!

author: mikerj
author_rank: Super Contributor
timestamp: June 15, 2015, 10:40:43 am
content: Glad you got it working. To err is human; to get your circuit working, divine

author: LvW
author_rank: Frequent Contributor
timestamp: June 15, 2015, 12:10:54 pm
content: Quote from: sci4me on June 15, 2015, 10:24:49 amBloody color code?