(Sorry) op amps. - Page 1
Forum section: electronics / beginners

author: paulca
author_rank: Super Contributor
timestamp: November 20, 2017, 01:24:12 pm
content: I've spent two days playing with op amps. Everything is grand with DC: comparators, followers, neg fb gain etc.It's when I put a small AC signal in that I run into problems.I have an input from my sound card, it's line level, +- about ~250mV around the ground on the RCA lead (normal 0V, it's 0V potential to the 0V rail on my breadboard)The opamp has 0V-12V rails.I have a 6V virtual ground from either a (variable) voltage divider or an opamp buffer producing 6V.TLDR;How do you correctly lift the input "ground" to the rail split virtual ground so you get VMax - Virtual Ground - VMin. In my case 6V +- 250mV and 6V +- 2000mV on the output?Skipping many hours of reading, you tubing, tinkering and genuine concern for my sound card RCA outputs. I did manage to get an amplified signal. But it had issues.Basically I had to decouple the input via a series cap, apply a pull up voltage onto that signal to raise it up above the lower rail and I got a signal.It felt very wrong applying (at first 2.5V) to the "output" of the RCA though even with the series cap "decoupling" it. I tried the opamp buffer (rail splitter) to get 6V which tested out fine, but when I applied that to the input signal I got a pop and the channel went mute ( I mean the sound card cut it's output off and the headphones went off). I don't think it liked it, but it thankfully recovered when I removed the voltage.Back to using a voltage divider for the "virtual" ground at 2.5V. I was able to get a maximum gain of about x4 before the op amp either clipped or just stopped working and the output collapsed. So that was something like 800mV p-p. If I wound the gain higher I clipped on the top rail, if I wound the reference voltage up the output collapsed.I gather the issue is the op amp is amplifying the virtual ground as well, so if I give it +2.5V and add my +-200mV AC signal @ x4 gain I getting 800mV peak to peak on a 2.5x4=10V DC offset. 9.2V to 10.8V. I confirmed this with the multi-meter. If I took the ref voltage up the amp clipped until it collapsed against the top rail. If I took the ref voltage down it collapsed against the lower rail.So do I apply the virtual ground voltage to both inverting and non-inverting or ... more likely am I just in a muddle.I think I'm just missing one piece of the puzzle or have miss interpreted something fundamental along the way regarding virtual ground on the op amp, versus the input signal ground.(Also... assuming I get this working, how would I then be able to bias the output 6V -+1000mV back down to normal 0V ground to send on to something like a speaker? Thinking out load, if I pass it through a series cap pulled to 0V ground on the speaker side, will that work?)

author: ogden
author_rank: Super Contributor
timestamp: November 20, 2017, 01:41:31 pm
content: Quote from: paulca on November 20, 2017, 01:24:12 pmThis is how it is usually done. You shall seek for application notes and reference designs from IC manufacturers, see how they suggest to implement stuff.Example:http://www.ti.com/lit/ds/symlink/tpa4861.pdfQuoteWhen use series capacitor, you don't apply voltage. You just create a "pop" when it is chargedAgain it is ok.

author: aiq25
author_rank: Regular Contributor
timestamp: November 20, 2017, 01:45:02 pm
content: Do you have a schematic?I'm not familiar with audio applications. You can use differential amplifiers to adjust DC levels or just a DC blocking cap with a resistor divider.

author: danadak
author_rank: Super Contributor
timestamp: November 20, 2017, 01:46:21 pm
content: This might help -https://www.ti.com/lit/an/sloa030a/sloa030a.pdfA calculator/design tool -http://www.analog.com/en/design-center/interactive-design-tools/adi-diffampcalc.htmlRegards, Dana.

author: paulca
author_rank: Super Contributor
timestamp: November 20, 2017, 03:31:12 pm
content: The pop was probably the large 1uF cap, I replaced it with a 50nF cap and the pop is now tiny and the RCA backs off less.I'm still lost. So I took a step back and removed the op amp completely.I put two probes on the input. One before the cap (direct from the RCA).RCA Output (Probe1) ---||--- (Probe2)|0VWith just that I get about 400mVpp on Probe1 and 200mVpp on Probe2. Is this just expected loss across the coupling cap?If I then pull the Probe 2 side up to 6V using a voltage divider I get about 100mVpp at Probe2 and a 6V DC offset (what I wanted).RCA Output (Probe1) ---||--- (Probe2) --- 6V|0VHowever if I try and pull Probe2 side up to 6V with the opamp buffer rail splitter the RCA output drops way down and I get about 70mVpp at Probe2 ... most of which is computer RF and it's virtually impossible to distinguish a signal on the oscilloscope.So I'm thinking I'm screwing up the impedances. Should the +6V from the virtual ground have a resistor on it?I tried pulling Probe2 side to ground with a 10K resistor, but it didn't make any difference or muted the signal all together.RCA Output (Probe1) ---||--- (Probe2) --- 6V --- 10K --- 0V|0VIf I can get this bit right, then it's a start.

author: ogden
author_rank: Super Contributor
timestamp: November 20, 2017, 03:35:29 pm
content: Quote from: paulca on November 20, 2017, 03:31:12 pmI would say unacceptable signal level loss. Decoupling capacitance is too small. Don't go below 0.1uF (100 nF). 1uF seems about right. And don't worry about pops. They are expected for simple/single_power_rail amps.Further reading:https://www.allaboutcircuits.com/tools/capacitor-impedance-calculator/

author: paulca
author_rank: Super Contributor
timestamp: November 20, 2017, 03:46:08 pm
content: I found this:QuoteSource:https://en.wikipedia.org/wiki/Line_level#Line_outDoes that mean I should have something like this, below, to AC couple it and give it the 10k impedance it expects to drive?RCA Output ---||---> 6Vgnd --> amplifier input|10K|GNDThe capacitor impedance is tiny compared to 10K it's like 100Ohms.Quote from: ogden on November 20, 2017, 03:35:29 pmI'm less worried about the pops and more where I hear them and the result after them. The headphone amp has a line level pass through, it's just electrically wired through. As the same time it's driving the headphones via it's own amp. I hear the pop through the headphones and the channel I just hooked up drops to considerably lower volume that the untinkered channel.

author: paulca
author_rank: Super Contributor
timestamp: November 20, 2017, 03:57:12 pm
content: Actually I think in my original circuit the signal (Probe 1 side) has no circuit path. It's floating in the breeze. The oscilloscope sees the 400mV only because it has a GND on the probe shared with the line input. The left side of the circuit before the cap has no route to GND, so no current. When I then pull that floating voltage through the cap and up to 6V it gets all but lost in the noise.I don't have anymore time to play this afternoon, I'll have to pick it up later.

author: rstofer
author_rank: Super Contributor
timestamp: November 20, 2017, 04:03:39 pm
content: Here is a discussion of a simple amplifier with rail splitter circuit and it talks directly about the problems you are having:https://electronics.stackexchange.com/questions/153911/single-supply-op-amp-audio-amplifierHere is a much better article but for more advanced circuits:http://www.ti.com/sc/docs/apps/msp/journal/nov2000/nov_08.pdf

author: paulca
author_rank: Super Contributor
timestamp: November 20, 2017, 04:30:06 pm
content: Quote from: rstofer on November 20, 2017, 04:03:39 pmAh ha!QuoteThat solves the "amplifying the DC offset" issue.I might get somewhere now.Thanks.

author: ogden
author_rank: Super Contributor
timestamp: November 20, 2017, 06:35:31 pm
content: Quote from: paulca on November 20, 2017, 03:57:12 pmWhat you say actually does no makes sense unless youdo notconnect GND of the signal source to GND of the amplifier. If GND of the both are common and ground of both probes are connected to said GND connection - nothing is floating in the breeze. You shall try to show circuits you are talking about - to avoid misunderstandings

author: paulca
author_rank: Super Contributor
timestamp: November 20, 2017, 08:10:18 pm
content: It works!The output from my PC is foul for noise, but the caps filter it right out.It's an LM741 and it obviously doesn't make a good audio amp, so I'm not even going to connect it to a speaker. It was just an exercise in opamps and AC.It responds to anything above about 30Hz and cuts off hard at about 15KHz. Not sure if that's the LM741 or more likely the RC values.Thanks for all the help I learnt a lot today.Next on the list is back to digital stuff (programming an LCD display from the PI), thankfully as this analogue stuff is hard on the head.

author: paulca
author_rank: Super Contributor
timestamp: November 22, 2017, 12:56:27 pm
content: Quote from: ogden on November 20, 2017, 06:35:31 pmI was getting all confused with the whole AC coupling cap considering it as being effectively an insulator and only the fluctuations in current influencing the other side. So I then seen the signal wire from the RCA as "floating" with no connection to ground.Of course this is not true, but it's still an area of confusion.Out of interest, I did connect it to GND on the input side of the AC coupling cap via a 10K and it did absolutely nothing (visible).

author: rstofer
author_rank: Super Contributor
timestamp: November 22, 2017, 02:21:31 pm
content: The RCA jacks on your sound card are probably connected to earth ground inside the PC. Is there any part of your amplifier that is referenced to earth ground? Probably not... It depends on the power source.However, the ground lead on your scope probe IS referenced to earth ground. So, the ground side of your signal is probably going to earth by way of the power cord and then coming back in via your scope probe.There really are no one wire circuits.

author: paulca
author_rank: Super Contributor
timestamp: November 22, 2017, 02:48:05 pm
content: Quote from: rstofer on November 22, 2017, 02:21:31 pmThe anomaly is that my scope probe is not referenced to earth ground in any way when I pull the power cord out of the laptop just it's internal battery 0V. Note the scope is on the laptop, RCA outputs from the PC. Using a scope on a laptop battery allows this test and allows me to be absolutely sure I cannot short the probes to ground and fry stuff.One route the signal has to complete a circuit is through the AC coupling cap, through the amp breadboard circuitry and into the PSU GND which (IIRC) is floating, not clamped to the earth binding post. Eventually I assume that ends up some how onto the mains neutral.The shorter path is of course that the signal ground on the breadboard is shared with the PSU ground, so it will take the shortest route to that ground after passing through the AC coupling cap.Of course if I disconnect the RCA GND from the breadboard I still get signal but with a huge 50Hz mains hum as the signal circuit is forced to travel all the way through the whole Breadboard, PSU, Mains plugs etc. I expect if I used my phone as audio source (assuming it was running on battery) this route would not be available and I would get no signal at all. Similarly if I ran the breadboard amp on a battery there would be no GND path either and no signal.My only confusion was with the AC coupling cap as I was thinking of it as an isolator/insulator when of course it's not and current does pass through it and potential does exist across it. The fact the only route to GND for the signal exists beyond it doesn't matter, it is still a route. I watched some videos on the theory of capacitors and it gets pretty complicated pretty quickly.