So, I ordered this opamp called the MCP602 on a recommendation.
The idea was to run it on the arduino 0-5v power, amplifying my guitar (AC 300mv max), and then reading the output with the arduino ADC.
I posted my circuit image below, as well as the simulation output image. Unfortunately the MCP602 was not available in the sim, so I picked the closest thing, the LM358.
In the simulation, it runs like it should, clipped lows are at zero, and highs hit at around 5v+. But in real life, the output does not stay 0-5v and instead sinks down and goes from negative 2.5v for the lows to positive 2.5v for the peaks. What the hell is making it drop into negative territory?
I know I'm using a different chip, but is there a difference between the MCP602 and the LM386 that would cause this problem? If it's not the chip, then what am I missing?
uberdanzik:
But in real life, the output does not stay 0-5v and instead sinks down and goes from negative 2.5v for the lows to positive 2.5v for the peaks. What the hell is making it drop into negative territory?
Where do you see that? The orange is the output, right? That doesn't go below zero.
Right. Well I just made up your exact circuit, fed in 500 mV sine wave, powered the LM358 from 5V, and got this:
Wow. I wasn't expecting such awesome help. This was a real physical circuit? I guess the MCP602 chip I'm using has some major difference with it then that makes it perform differently.
uberdanzik:
In the simulation, it runs like it should, clipped lows are at zero, and highs hit at around 5v+. But in real life, the output does not stay 0-5v and instead sinks down and goes from negative 2.5v for the lows to positive 2.5v for the peaks. What the hell is making it drop into negative territory?
Negative compared to what? Is there a missing ground connection somewhere, or some source of capacitance?
A dual supply opamp would do that, which the 602 is not
but unless your feeding it with -+ 2.5 volts I don't see how that's happening, how are you reading the output? I assume an oscilloscope? Make sure you connect the ground from the probe to your ground
If so also make sure the input is switched to DC coupling not AC.
You're talking about changing the scope input setting to DC coupling and not AC? This is strange to me. So the scope will incorrectly show a negative voltage on the line if the input is set to AC ? Why is that the case? Does it just try to center my signal or something?
uberdanzik:
So the scope will incorrectly show a negative voltage on the line if the input is set to AC ? Why is that the case? Does it just try to center my signal or something?
If you remove the DC component, then yes. Say an AC voltage of +/- 0.5V is centered around +5V DC. So you get 4.5V to 5.5V. But on AC coupling, the +5V is gone, so you now get -0.5V to +0.5 because that is all that is left.
In AC mode the average (to be precise the mean) voltage will be 0V for a repeating waveform, which means equal areas above and below the 0V line. The way AC mode is done is by connecting a capacitor between the scope probe and the scope's input circuit, which then averages at 0V due to the 1M load resistor to ground at the scope Y-amp's input. In DC mode this capacitor is bypassed.