Still confused about OpAmp gains

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
I posted previously about getting an OpAmp to work. @Audioguru again kindly posted the circuit on the right. I built that circuit and it "kind of" works but I still have a few questions.

I changed the R47K with 5K and I changed the R15K with 1K so I am expecting a gain of -5. I put my frequency generate on a constant 1V DC. My question:

  • My second scope channel shows 9.2V why this value and not 5V
  • If I change the voltage of my power supply by 1V - the value of the second scope channel changes by about 0.4/0.6V so if I put my power supply on 20V the Scope shows an output of 10.4. whilst at 18V it shows 9.2V. I would have expected the gain to remain the same if we stay within the operating range of the OpAmp which with 1V input, a gain of 5 should be well withing the +9 / -9 range?

I'm probably missing something very obvious but can't figure out what it is.

opamp gain of 3.133 times.png
 

Ian0

Joined Aug 7, 2020
9,675
Where do you have your scope earth clip attached?
This circuit would be easiest to understand if you consider pin 3 of the op-amp as earth, and the supply as +/- 9V.
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Where do you have your scope earth clip attached?
This circuit would be easiest to understand if you consider pin 3 of the op-amp as earth, and the supply as +/- 9V.
The scope earth is attached to the bottom rail / effectively pin 11 of the OpAmp. I tried to connect them to pin 3 but the output didn't make any sense then.
 

Audioguru again

Joined Oct 21, 2019
6,674
You did not say the frequency or say the value of the input coupling capacitor.
If the frequency is 1kHz and the input resistor is 1k then the input coupling capacitor must be at least 1uF for a fairly small loss of signal level.

Is the output of your frequency generator "loaded down" when it feeds 1k ohms?
When the frequency generator is driving the circuit, measure the input and output levels of the input coupling capacitor.

EDIT: You said the "frequency" generator is set to 1VDC. Then since the input coupling capacitor feeding the opamp does not pass DC, the DC output is the 0.5 ratio of the 33k biasing resistors, times the power supply voltage. Also, of course the DC output is affected by power supply DC voltage changes.
 
Last edited:

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
EDIT: You said the "frequency" generator is set to 1VDC. Then since the input coupling capacitor feeding the opamp does not pass DC, the DC output is the 0.5 ratio of the 33k biasing resistors, times the power supply voltage. Also, of course the DC output is affected by power supply DC voltage changes.
Thank you - I will continue my analysis tonight and try to figure out what's going on.
 

Audioguru again

Joined Oct 21, 2019
6,674
Thank you - I will continue my analysis tonight and try to figure out what's going on.
There is nothing to figure out.
My opamp circuit uses an input coupling capacitor to pass AC but block the 1V DC from your signal generator. The opamp with an input coupling capacitor has a DC gain of 1 but an AC gain of 5 times. You are correctly measuring the DC output of the opamp that is the same "half the supply voltage" as the two 33k voltage divider resistors.
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
There is nothing to figure out.
For a stupid person like me: I think there is.... I can't get this to work. I tried to build a version of your schematic in EasyEDA, simulated it and it works perfectly. I have now tried to build in three times on a breadboard and one version soldered together and the OpAmp doesn't behave. In my last soldered version, when I switch on the power the Output pin now just doesn't move at all. I've tried 2 TL074CP and 1 TL072CP all with similar results. My frequency generator is playing up as well now so all and all, not a good day. I literally have no idea what I'm doing wrong unless lots of stuff I have (e.g. the ICs, bought from eBay) are broken OR these TL07xCP devices don't work in this way. Very frustrating and any further guidance would be appreciated. Simulator images below.
Schematic.png
Scope.png
 

crutschow

Joined Mar 14, 2008
34,285
I tried to build a version of your schematic in EasyEDA, simulated it and it works perfectly. I have now tried to build in three times on a breadboard and one version soldered together and the OpAmp doesn't behave.
Then there's likely some difference between the simulated schematic and the actual circuit.
 

Audioguru again

Joined Oct 21, 2019
6,674
Your new schematic is tiny with its parts spread apart too much for us to see the resistor and capacitor values.
You said, "It doesn't behave" but you did not say what is the problem.

Please attach a schematic where we can see the values of the resistors and capacitors and what is the frequency (78Hz?).
Please show the part number of the opamp and the pin numbers you used.
Please explain what is the behavioral problem.

The many long wires and rows of contacts on a solderless breadboard usually pickup lots of interference and maybe cause oscillation.
Ebay sells fake and defective junk at low cost.
 

Attachments

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Please show...
Apologies - it all got very frustrating last night and I should have produced more detail. I will contain a "package" which shows everything in proper detail. Whilst going against your other advice, just to demonstrate, I will also add a breadboard setup which is properly spread out so you can see what I have actually built (just to show it, I accept your interference/noise points obviously). Thanks again to everyone who's trying to help. I felt so great yesterday afternoon when I found EasyEDA and got a circuit to work as I thought: great just replicate that and I won! And then I failed:)
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
@Audioguru again and all: here I am again. Still issues. I made the EasyEDA project public so you should just be able to have a look at it. In case that doesn't work, here is a larger schematic. Again this project seems to work perfectly.

E1.png

I also enclose a picture of the TL074CP I'm using.

E2.png

The next picture is my setup. The FeelTech has given up so I'm using this small signal generator on the desk that seems to be OK at putting out a sin wave. Not sure about the frequency but it's between 100Hz and 3Khz. I forgot to look at the scope. The power supply is set to 18V and 1Amp. The circuit uses about 0.03Amp.

E3.png

The next show my breadboard. I know these leads are all too long but I want to make it a bit clearer and I wish I had some noise riding about the OpAmp output. I tried to mimic my circuit as much as possible but Red rail is 18V, Green rail is 9V and purple is Ground. The wire I coding I to help analyse what's going on. Red: VCC, Black Gnd, Green connected to OpAmp Out, Blue OpAmp - and Yellow 9V and OpAmp +. All other components are as in the circuit.
E4.png
I know I should have terminated the un-used OpAmps (2,3 and 4) but didn't do that. Hopefully, that's not the main issue.

With the power on or off Channel 1 has VPP 2.0V, vMax 5.68V
Channel 2 Off: vpp 120mV / 160mV
Channel 2 On: vpp 1.6V / 800mV <- I would expect this to be 39K/5K * 2V = 15V (ish) I tried changing R4 to something much larger (300K) and it made no difference to Channel 2.

Again been looking at this for a week and I can not figure out what I'm doing wrong but hopefully, someone will tell me how stupid I am :)
 

Audioguru again

Joined Oct 21, 2019
6,674
Your 'scope settings cannot be seen. Since you said, "With the power on or off Channel 1 has VPP 2.0V" then the messy long breadboard wiring is probably picking up the 50Hz or 60Hz of your electricity in the air.

Why did you connect the grounds of the signal generator and the 'scope to +9V instead of to the circuit's ground?
Why do you have a resistor between the opamp output and the 'scope?
Why don't you know the VERY important frequency? Your 'scope settings will show it.

I think if the circuit is wired correctly and the messy wiring is fixed then the very low value of C2 is reducing the circuit's gain.
What numbers are on C1, C2 and C3?

I cropped your HUGE schematic and show how it should be wired.
 

Attachments

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Thanks again @Audioguru again - will try your changes later today but starting with the answers to your questions/comments:

  • I did not note the frequency as what I'm trying to do is just proof for myself that I can figure out how to use an OpAmp. I think I don't really care (at this stage) the frequency which is being amplified, just that I can control the amplification. This project started following a udemy course where one of the builds is an LED frequency analyser using an Electrect microphone. I build the thing, it didn't work so started working backwards to the pre-amp stage and that's where I'm still stuck. Obviously by the time I get back to that real circuit: noise is important and I will do everything you suggest to control it.
  • "Connect Signal Gen + Scope to +9V" - I thought that was an earlier suggestion made in this thread by Ian0. Originally I didn't but based on the suggestion above (which no-one rejected outright :-> ) I thought that was the right thing to do. In my crooked mind: it also made sense as I thought it would reference everything to this "virtual ground" as my teacher seemed to call it which I thought would mean they would all now reference to that midpoint than being 9V above it. Also having tried both in the simulator connecting it this way it is "seemed" to give me the results I wanted. But I have to say: I believe you a lot more so I will revert back.
  • On the circuit that resistor is there as a current limiter for an LED which I wanted to add but the moment I did, EasyEDA simulator didn't work anymore so I removed the LED but I didn't think it mattered if I left the resistor in. I'm sure I tried to remove it at some stage as well but will try that again tonight.
  • About the capacitors, below is the box of capacitors I use. C1 and C3 are 106 (10uF), C2 = 104 (0.1uF). I believe we agree on C1 and C3 and I chose C2 at 0.1uF because I wanted to filter out anyE5.png DC coming at the input of the OpAmp and having researched that people seem to suggest as low a value as possible and that's the smallest one I have. I've seen lots of diagrams where they do that at the output stage. Would that be better?

Again I really appreciate your help here and I have learned so much from your suggestions.

E5.png
 

Audioguru again

Joined Oct 21, 2019
6,674
Do you understand that your messy wires all over the place are picking up 2V p-p (as you said) when the power is turned on or off?
The frequency is important since it shows that it is probably the frequency of your electricity (50Hz or 60Hz) in the air.
For audio circuits, compact wiring (a pcb) and shielded audio cables are used to keep out electricity hum from the air. Your blue input wire and most other wires are antennas for interference. Compact wiring and shielded audio cables are not antennas.

The frequency is also importance since the input capacitor cuts the levels of low frequencies. Your 0.1uF input capacitor has a reactance of 32k ohms at 50Hz which is in series with your 5k input resistor then the circuit gain at 50Hz is only 1.05 times instead of the gain of 7.8 times at higher frequencies. The low capacitance even reduces a little frequencies as high as 250Hz. Your guitar plays down to about 80Hz and a bass guitar plays down to about 40Hz.

Your input coupling capacitor is a ceramic type. A ceramic capacitor is never used to couple audio because it behaves like a microphone (it picks up feedback sound and vibrations) which messes up audio.

Your simulator does not know if the ground on your signal generator or 'scope is the same as the - wire of your power supply that kills the virtual ground and prevents your wired circuit from working.
 

BobTPH

Joined Jun 5, 2013
8,813
Do you actually read and try to understand any of the posts? @Audioguru again gave you the answer in post #7, and asked you a question. You never commented on it or answered his question. Now, here we are on post #17 with him giving you the same answer he did before. Why he is bothering, when you refuse to do your part is beyond me.

Bob
 

Thread Starter

doubledutch1962

Joined Oct 27, 2020
37
Do you understand that your messy wires all over the place are picking up 2V p-p (as you said) when the power is turned on or off?
The frequency is important since it shows that it is probably the frequency of your electricity (50Hz or 60Hz) in the air.
For audio circuits, compact wiring (a pcb) and shielded audio cables are used to keep out electricity hum from the air. Your blue input wire and most other wires are antennas for interference. Compact wiring and shielded audio cables are not antennas.

The frequency is also importance since the input capacitor cuts the levels of low frequencies. Your 0.1uF input capacitor has a reactance of 32k ohms at 50Hz which is in series with your 5k input resistor then the circuit gain at 50Hz is only 1.05 times instead of the gain of 7.8 times at higher frequencies. The low capacitance even reduces a little frequencies as high as 250Hz. Your guitar plays down to about 80Hz and a bass guitar plays down to about 40Hz.

Your input coupling capacitor is a ceramic type. A ceramic capacitor is never used to couple audio because it behaves like a microphone (it picks up feedback sound and vibrations) which messes up audio.

Your simulator does not know if the ground on your signal generator or 'scope is the same as the - wire of your power supply that kills the virtual ground and prevents your wired circuit from working.
Thanks again for all your help and detailed explanations. It will be clear that I'm really new to this and I only picked up this hobby during this very difficult year. I did my best to follow all of your advice but clearly sometimes didn't always understand the significance as @BobTPH "kindly" points out in his post below. I'll (again) do everything you suggested above and try to get to a situation where I fully understand what's going on. Thank you @Audioguru again - you have been unbelievably helpful and I really appreciate it.
 

Marc Sugrue

Joined Jan 19, 2018
222
@Audioguru again and all: here I am again. Still issues. I made the EasyEDA project public so you should just be able to have a look at it. In case that doesn't work, here is a larger schematic. Again this project seems to work perfectly.

View attachment 225120

I also enclose a picture of the TL074CP I'm using.

View attachment 225121

The next picture is my setup. The FeelTech has given up so I'm using this small signal generator on the desk that seems to be OK at putting out a sin wave. Not sure about the frequency but it's between 100Hz and 3Khz. I forgot to look at the scope. The power supply is set to 18V and 1Amp. The circuit uses about 0.03Amp.

View attachment 225122

The next show my breadboard. I know these leads are all too long but I want to make it a bit clearer and I wish I had some noise riding about the OpAmp output. I tried to mimic my circuit as much as possible but Red rail is 18V, Green rail is 9V and purple is Ground. The wire I coding I to help analyse what's going on. Red: VCC, Black Gnd, Green connected to OpAmp Out, Blue OpAmp - and Yellow 9V and OpAmp +. All other components are as in the circuit.
View attachment 225123
I know I should have terminated the un-used OpAmps (2,3 and 4) but didn't do that. Hopefully, that's not the main issue.

With the power on or off Channel 1 has VPP 2.0V, vMax 5.68V
Channel 2 Off: vpp 120mV / 160mV
Channel 2 On: vpp 1.6V / 800mV <- I would expect this to be 39K/5K * 2V = 15V (ish) I tried changing R4 to something much larger (300K) and it made no difference to Channel 2.

Again been looking at this for a week and I can not figure out what I'm doing wrong but hopefully, someone will tell me how stupid I am :)
You've look to have connected the your resistor divider and + terminal to 0V in the schematic. The function generator GND and scope GND needs to go to GND
 
Top