Arduino Forum

Using Arduino => Audio => Topic started by: Marciokoko on Jul 03, 2016, 05:21 pm

Title: Opamp setup doubt
Post by: Marciokoko on Jul 03, 2016, 05:21 pm
I've been learning about opamps for a while now (2 weeks).  I found this YouTube video and tried the  setup in one of the videos.  The setup calls for a small pc mic, a headphone set, two 9V batteries and everything else shown here but I get no sound from the mic.  Im not sure why, but Im reading the voltage between ground and the 9V+ rail and I get 15.50 instead of +9V.  I'm not sure why I would get 15.50V.

Im not using a LM324, all I could find was a TL071cp.

Here is an image of the sketch and the picture of my setup:

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=172518)
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 03, 2016, 05:39 pm
On your diagram, it shows Vcc- as being -9V. the potential between Vcc+ and Vcc- is 18 volts. Given that your op-amp is not rail to rail, your measurement of 15.5 volts seems entirely reasonable.
Title: Re: Opamp setup doubt
Post by: DVDdoug on Jul 03, 2016, 06:43 pm
Quote
I found this YouTube video and tried the  setup in one of the videos.
That's a TERRIBLE design!!!   ...I tried to tell you that when I replied to your other post but maybe I was too subtle.

Get a chip that's designed to drive headphones/speakers and follow the chip manufacturer's recommended schematic.  The LM386 (http://www.ti.com/lit/ds/symlink/lm386.pdf) is popular and easy to use, or there are plenty of other options.   Op-amps are great as microphone preamps, but NOT for driving headphones/speakers.


Quote
The setup calls for a small pc mic, a headphone set, two 9V batteries and everything else shown here but I get no sound from the mic.  Im not sure why, but Im reading the voltage between ground and the 9V+ rail and I get 15.50 instead of +9V.  I'm not sure why I would get 15.50V.
The batteries have to be grounded (the negative terminal of the +battery and the positive terminal of the -battery).

If the circuit is working properly the op-amp's output should be zero volts (with no input/signal).

Try taking-out the 10K pot.   Or at least try both extremes in case it's wired backwards.   A 10K pot is not going to work as a volume control with ~32 Ohm headphones, but you might  get some  signal with the pot at "maximum volume".   At "half-volume" you're not going to get any sound, because the resistance is too high compared to the headphones.

And if you do get sound, you might burn-up the op-amp because of the low impedance load.


P.S.
There is one thing from that terrible design that you will need...    The 5k resistor and 0.1uF capacitor supply power to an electret "computer microphone" and isolate that power from the op-amp while letting the audio through.   
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 03, 2016, 07:45 pm
Ok

I was just trying to make use of what I have. 

Your explanation was too complicated for me to understand.

I need to read up on what a rail to rail amp is first and how to find out when an opamp is such.

One more thing, what is a pre-amplifier?

I just checked the Vout on the amp and I get -6v to about 9v depending on where the pot wiper is.
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 03, 2016, 10:01 pm
Quote
Your explanation was too complicated for me to understand.
Then ask about what you don't understand - that is what this forum is all about.
Title: Re: Opamp setup doubt
Post by: DVDdoug on Jul 03, 2016, 11:39 pm
Quote
I was just trying to make use of what I have.
What you have wont' work... An op-amp can't put out enough current to drive a headphones or a speaker.   Typically you can drive a load of around 1K Ohm or more.   I don't know the specs for your op-amp but no standard op amp can drive headphones.   

You'd need to check the datasheet for the chip to find out how much current it can put-out, and then apply Ohm's Law (https://en.wikipedia.org/wiki/Ohm%27s_law) to determine the minimum load impedance/resistance.

If you take an electronics class the first thing you learn is Ohm's Law (the relationship between voltage, resistance, and current).    You really should understand Ohm's Law before you try to understand op-amps.



Quote
I need to read up on what a rail to rail amp is first and how to find out when an opamp is such.
That won't solve your problem.   Your problem is current, not voltage.    Current and voltage are related (as described by Ohm's Law) but the problem with a regular op-amp is it's current limits.


Quote
I just checked the Vout on the amp and I get -6v to about 9v depending on where the pot wiper is.
Something's wrong.   Did you ground your batteries?  Are you measuring +9V and -9V now (with ground as your reference)?   Both inputs on the op-amp should also be approximately zero volts.   If one of the inputs is not zero,  that may help you track down the problem.

Quote
One more thing, what is a pre-amplifier?
A preamp (http://www.musiciansfriend.com/pro-audio/golden-age-project-pre-73-mkiii-mic-preamp) takes a signal from a microphone or a phono cartridge (a few millivolts) and converts it to line level (https://en.wikipedia.org/wiki/Line_level) (about 1V).  There is a preamp built into your soundcard and preamps are built into audio mixers.    Older stereo receivers had a phono preamp but most newer receivers don't have phonograph inputs.     (Stand alone preamps are expensive specialty items.)   

A power amplifier (http://www.musiciansfriend.com/pro-audio/crown-xls1002-2-channel-350w-power-amplifier-with-onboard-dsp)  takes a line-level signal and boosts the voltage & current to drive a speaker.   A headphone amp is a special low-power power amplifier.

Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 04, 2016, 12:27 am
Ok I have taken electronics online courses.  I know about Ohms law and I have basic knowledge of an opamp.

Thanks for the preamp and amp explanation. 

I'm looking at the data sheet but what parameter do I need to look for regarding the output current?

I did ground them and I do get +9 and -9V with reference to ground on each respective terminal out of the battery so there supply is good
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 04, 2016, 12:31 am
Quote
I'm looking at the data sheet but what parameter do I need to look for regarding the output current?
Figure 6. Maximum Peak Output Voltage vs Load Resistance
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 04, 2016, 01:28 am
Ok so the headphones are 32 Ohms.  So that means the maximum voltage output would be around zero?  Is that why it fails?

I DO have the 5k ohm R and 0.1uF capacitor in the circuit.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 04, 2016, 02:29 am
I think the opamp tl071 can be used as a split supply amp because in the reference sheet on page 4 it states at the bottom the Vcc- and Vcc+ power supply voltages:

http://www.ti.com/lit/ds/symlink/tl071.pdf

Doesnt that make it a rail-to-rail opamp?  So the problem is as Doug stated, that the current output is too low, not so much as ChrisTenone said that:

Quote
On your diagram, it shows Vcc- as being -9V. the potential between Vcc+ and Vcc- is 18 volts. Given that your op-amp is not rail to rail, your measurement of 15.5 volts seems entirely reasonable.
Right?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 04, 2016, 07:15 am

Rail to rail means the output of the op-amp can be set to be a fraction of a volt of each rail. This is not true for all op-amps, look at the maximum voltage output figure in the spec.
Page 7 shows the maximum output swing is only 12V when you have a supply rail of 15V, so this is not a rail to rail op-amp by a long way


As stated before, that op-amp can not drive such a low impedance load. If you want it to then you have to put a transistor in an emitter follower configuration in the negitave feedback loop.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 04, 2016, 04:51 pm
ok so my first confusion stemmed from the fact i thought:

single supply = normal opamp

split supply = rail-to-rail opamp

I read here (http://electronics.stackexchange.com/questions/182636/what-is-rail-to-rail-supply) that rail-to-rail opamp meant that the output voltage could swing from V supply + to V supply -.

Now I understand that a rail-to-rail opamp can be identified from the fact that, as Mike stated, its Max Output Voltage swing is +/-12V which is not a fraction of the supply voltage of +/-15V.  So I looked over at the LM324 which is the one the afrotechmods author uses and I found its supply voltage can be 32V or +/-16V (http://www.onsemi.com/pub_link/Collateral/LM324-D.PDF).  I guess the Output Voltage High Limit and Low Limits on page 4 is what I should be comparing with.  But if Im reading it correctly itll output 3.5 if supplied with 5V, thats still 7/10 of the supply voltage.

I have 3 questions:

1. Im still not sure what it means for it to be a rail-to-rail opamp because Mike says:
Quote
Rail to rail means the output of the op-amp can be set to be a fraction of a volt of each rail.
but that link says that it means the voltage can swing anywhere from Vsupply + to -.  So maybe both explanations are the same but Im not understanding it that way.  I guess Im trying to read the datasheet and try to determine why the LM324 IS a rail-to-rail and the TL071 IS NOT rail-to-rail?

2. What do you mean when you say the TL071 cant drive a low impedance load?  Im sure this is related to my next question but it may be the critical piece I have yet to connect.  If I plug in 9V = 500Ohms * mA I get 18mA.  This means thats how much current the opamp can produce at 9V?  If the headphones are 32Ohms, then 9V/32Ohms, would require 281mA?  Is this why I would need the bjt?

3. As for the comment about the output current, I tried looking for both these specs on the datasheets and couldnt find them.  I saw the Figure 6 for TL071 (that Mike suggested) but Im not sure how to interpret it.  If Im supplying it +/-9V, I should be able to drive a 0.5kOhm load?  On the other hand the LM324 does have an output current parameter of 20-40mA.



Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 04, 2016, 11:32 pm
Rail to rail means the output goes from V- to V+. Non rail to rail op-amps, like your lm324 typically have a range 2 or 2.5 volts less than the range of input.

For use with Arduino, a rail to rail op-amp that goes from 0 to 5 volts is especially useful.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 04, 2016, 11:45 pm
Ok I may have caused confusion because although the diagram shows a lm324, but as I mentioned in the OP, I actually only have a tl071.

Anyways, you say rail-to-rail means it's output goes from -V supply to + V supply.  Ok so for lm324 I can see that Vsupply is 30V and maximum output swing is up to 28V.  So this is not rail to rail, great got that.

Now I'm using a tl071, it appears Vsupply is 15V and max output is 13.5V.  Ok so I see how neither of theses is a r2r opamp.  Thanks.

With that out of the way, a few questions remain:

1.  How does not being r2r affect my circuit example?  Is it because it can't reach a high enough voltage to produce the current necessary to drive the headphones?

2.  Is my interpretation of Fig 6 (from Grumpy_Mike's post) in my post #11, correct about the resistance calculation correct or at least makes sense?  Or am I way off and if so, how do I interpret what he said about the tl071 not being able to produce enough current?
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 05, 2016, 12:10 am
Not being rail to rail isn't a problem at all, just realize that you need to supply slightly more voltage than you need out of it.

Op-amps also have a maximum current they can supply. I'm not familiar with the tl071, but many op-amps are designed to amplify tiny signals, and so cannot supply sufficient current to drive an inductive load such as your headphones. I trust Mike's knowledge that your op-amp does not output enough current. Some amplifiers are made for driving audio, so that is the kind you should be looking at. I believe DVDoug mentioned the LM386, a basic audio amplifier. If you want to use a bare chip, that one will do it.

Using an op-amp and a transistor should work, but that would not be the best way to do it. If your intent is to learn about op-amps, then sure you could do it that way, and it would be instructive. But if your goal is to make an small amplifier for audio use, then get an audio amplifier. Not sure where you are located, but both Sparkfun and Adafruit have little breakout boards (for less than $10) that have an audio amp, and all the supporting circuitry on them. Should make powering your headphones a quick job.
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 05, 2016, 12:13 am
...
(Stand alone preamps are expensive specialty items.)   
...
Right!? Back in the day, having a separate preamp was a sign that you were a true audiophile. That and a Macintosh (tube) amp. (no relation to the computer.)
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 12:34 am
Im in Honduras which is why getting these parts is rather troublesome.  It takes me a while to get the exact part down from the US, so I end up trying whatever I can.

I can get an audio amplifier but I want to learn about opamps so I found that youtube tutorial from afrotechmods and tried following it using a TL071 instead of the LM324.  I know its not always going to work (replacing whats required with what I have) but I wanted to give it a shot anyway.  And as it turns out, Im learning from it.

I understand the tl071 may not output enough current as Mike said and I know he is very knowledgeable but I want to be able to discover that from looking at an opamp data sheet by myself.  I still can't find that in the TL071 data sheet.  It must have something to do with Fig 6 he mentioned and how the Max Output Voltage vs load resistance are related, but I really can't connect the dots.  I know ohms law, but that is far from being able to use it properly. 
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 05, 2016, 12:37 am
Quote
but that link says that it means the voltage can swing anywhere from Vsupply + to -.  So maybe both explanations are the same but Im not understanding it that way
No op amp can go from + supply to - supply. But a rail to rail can get say to just 0.1V short of the supply value, so in effect is is nearly rail to rail. Often it is simpler to say it can get to that value, but it is a simplification, so your confusion is the result of thinking a general simplified explanation some how contradicts my more accurate answer.

Chris is right the fact that nether of those op-amps you have is rail to rail.
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 05, 2016, 12:42 am
Quote
It must have something to do with Fig 6 he mentioned and how the Max Output Voltage vs load resistance are related,
Use the graph to see what maximum voltage you can get for a specific resistance. Then voltage / resistance will give you the output current.

You will see the resistance you want to use is not even on that graph so what you are trying to do is not possible with that amp.

In fact you will not find any op-amps that will do what you want. That is a job for power amps.
Title: Re: Opamp setup doubt
Post by: CrossRoads on Jul 05, 2016, 01:01 am
How much current do you need? You can find op amps with pretty high output current/channel:
http://www.digikey.com/product-search/en/integrated-circuits-ics/linear-amplifiers-instrumentation-op-amps-buffer-amps/2556125?k=op%20amp (http://www.digikey.com/product-search/en/integrated-circuits-ics/linear-amplifiers-instrumentation-op-amps-buffer-amps/2556125?k=op%20amp)
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 01:46 am
TThanks.  I guess I would have to know what values I would need and I don't even know that.  I just saw the example and wanted to try it.

So I don't even know what Vin and Iin I was working with or what Vout and Iout I needed.  I didn't even know headphones were 32 Ohms.

I guess it would help to know those.  What voltage does a small mic like that generate?  I think I saw 300-400mV?
Title: Re: Opamp setup doubt
Post by: CrossRoads on Jul 05, 2016, 02:08 am
Yes, something very small.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 03:12 am
Ok so if I have 300mV on the I out end, I need to know how much I need on the output end.  So if a headphone set is a 32Ohm load, How do I make "the connection"?
Title: Re: Opamp setup doubt
Post by: CrossRoads on Jul 05, 2016, 03:44 am
Your power supply will limit how much you can get on the output end.
Have a 5V supply? Then 0-5V, or +/-2.5V, will be the max you can get.
Power = IV (current x voltage), subbing in V=IR or I=V/R, you get power = V/R * V (V^2/R).
5V x 5V/32 ohm = 0.78W
There is some loss for transistors, so you won't get the full 5V, so power will be somewhat less.
If your supply can't provide enough current, 5V/32ohm = 156mA, then power will be reduced also.
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 05, 2016, 09:24 am
One thing that should be pointed out, since the OP is an op-amp newb: As stated (but not emphasized) in CrossRoads' post above, the power supply need not be +V and -V of the same magnitude. Often you will see op-amps listed as "single supply". This just means that you can make V- equal to zero volts (ground.)
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 01:59 pm
Ok but I have a +/-9V supply made by two 9V batteries as shown in post #1, so I can use P = 18V^2 * 32 = 10,368W, is this correct?



Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 05, 2016, 02:55 pm
Does ten kilowatts from two 9 volt batteries sound reasonable?
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 03:54 pm
No, not at all!  I'm obviously confused.  Oh I see what I did wrong....its 9 * 9/32 = 2.5Watts.

OK I would like to understand from the beginning.  If a small mic can generate a 300mV potential, what do I need to do to that to make it "hearable" on headphones or a speaker?

So basically I need 1 opamp to preamplify the mic sound and then could I use another opamp (or would it have to be a power amp) to amplify the sound for a headphone set?

I found these images from another site:

(http://67.media.tumblr.com/tumblr_lq1tidbBjs1qf00w4.gif)

and

(http://66.media.tumblr.com/tumblr_lq1u3nUnQd1qf00w4.gif)

which talk about those 2 stages of amplification.  Does this look like a better circuit to learn from?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 05, 2016, 07:00 pm
Ok but I have a +/-9V supply made by two 9V batteries as shown in post #1, so I can use P = 18V^2 * 32 = 10,368W, is this correct?
No the , is the delimiter for thousand not a decimal point.

However the problem is the same you can't get 10W from a 9V battery. A voltage of 18V through a 32R resistor gives a current of 18 / 32 = 0.5625 Amps. Those batteries will not supply that current.

Quote
If a small mic can generate a 300mV potential,
Can it? I would say more like 30mV myself.
You have to do two things:-
1) Amplify the voltage
2) Reduce the impedance of the driver.

An op-amp will do 1) but as you have found the op amps you have used will not do 2). Therefore to do 2 you need a power amplifier. That is why there are often two stages of amplification. One to boost the voltage to the right level and the other to reduce the output impedance ( drive current ).

About 600mV will be enough if you can develop it across a 32 R earphone. If you put 10W into an earphone then it is a race to see which melts first your ear or the ear phone.

That last circuit will do 2) and either of those first ones will do 1). You need a voltage gain of about 10 times on the first circuit and a voltage gain of 1 on the second.


Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 09:30 pm
Well that's the kind of thing that's confusing because the 1.  Amplification stage there is done by bjts whereas 2.  Impedance reduction is done by the opamp.

I'm reading a few more sources on opamps and I'll see if I understand the circuit from start to finish.  What I want is to be able to calculate from beginning to end what happens.
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 05, 2016, 09:50 pm
Quote
1.  Amplification stage there is done by bjts whereas 2.  Impedance reduction is done by the opamp.
Why is that confusing? There is no rule that says it can't be like that, and there should be no expectation of it being different.

Quote
What I want is to be able to calculate from beginning to end what happens.
You can't do that because you do not know what voltage you need to feed to your earphone to give what you think is an adequate level. There is also no information as to how much voltage your microphone produces when you give it what you think of an adequate sound input. These are hand waving woolly concepts that stop calculations stone dead.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 10:28 pm
The confusion to me is because I would expect the opamp to to the job of amplifying a sound because of its name, amplifier. 

So how does someone go about designing an amplification circuit that takes input from a microphone as small as one taken from a PC and use it to produce sounds on headphones?  Where does one start?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 05, 2016, 11:13 pm
Quote
The confusion to me is because I would expect the opamp to to the job of amplifying a sound because of its name, amplifier.
It does do the job of amplifying voltage, it does not do the job of impedance matching to a source.

Quote
Where does one start?
One starts by knowing what the inputs and outputs of the system are going to be. That means real numbers, real components and real sound level inputs and outputs values. None of which you seem to know.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 05, 2016, 11:38 pm
Indeed I don't.  Can you give me an example of how I could figure them out? 
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 06, 2016, 01:15 pm
Quote
Can you give me an example of how I could figure them out? 
You measure the output of your microphone on an oscilloscope.
You feed the earphone with the output from a signal generator and see what output is the "right" level.

I assume that you have not got either of these two pieces of test equipment so your wish to:-
Quote
What I want is to be able to calculate from beginning to end what happens.
Is impossible.

Therefore you have to resort to what most people do and that is use trial and error.

Start with a X10 to X100 preamp followed by an audio amp.


Quote
The confusion to me is because I would expect the opamp to to the job of amplifying a sound because of its name, amplifier.
And what about the op bit? It stands for "operational" and an operational amplifier is not what you want to do all the job. There are lots of different types of amplifier that are wrong as well, like an instrumentation amplifier, thermocouple amplifier and a trans-conductance amplifier, to name but three. They all amplify but they are all not suited to what you are doing.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 06, 2016, 09:48 pm
Thanks Mike, great explanation.

And I am definitely thinking of getting an oscilloscope
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 06, 2016, 11:43 pm
Btw can you recommend an oscilloscope?

I'm also thinking of a power supply so is there an oscilloscope that might have an added power supply functionality built in?

Otherwise I'm looking in Amazon at Siglent sds1052dl or hantek dso507
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 07, 2016, 03:04 am
Ok so comparing the LM324 of the original tutorial, my TL071 and the suggested LM386 as well as a true power amp, LM1875:

LM386
-Output 325mW
Small power output, not rail to rail because on Fig Output Voltage vs Supply Voltage it is always about 1-2V less.
So this shouldn't be a good candidate yet it was suggested and it is described in the datasheet as a low voltage power audio amplifier.
Q1/ So does it classify as preamp?  How come it was suggested in post #2 and I saw it in a diagram for a 'power amp' which I referenced in post #27

LM324
Not classified as rail-to-rail
Output 20-40mA, so the current is too small to drive headphones.
Q2/ So it classifies as preamp?

LM1875
Described in datasheet as audio amplifier
Said to deliver 20W to a 8Ω load
Seems to be able to deliver 3-4Amps even at low voltages around 4-5V according to graph.
Not classified as rail-to-rail in datasheet but seems like its more the power amp Mike has been suggesting.
Q3/ Classifies as poweramp?

TL071
Not rail to rail because max output swing 13.5V while 15V supply
Figure 6. Maximum Peak Output Voltage vs Load Resistance shows that for a 32Ω headphone set, Vout would be 0, so...
Q4/ Classifies as preamp?

Opamps do voltage amplification but not impedance matching.  I need to clear up the impedance matching thing because a headphone set is a 32Ω load which will not be "driven" by a preamp such as TL071 because its output current is too small, ok. 

Q5/ But the TL071 Fig 6 says 100Ω/1kΩ/10kΩ load will be driven by it?  So it seems weird the TL071 can drive larger impedance loads but not a 32Ω headset.

Thanks for your time and patience :-)
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 07, 2016, 10:04 am
Quote
So does it classify as preamp?
A preamp is not a classification. It is a circuit function block you can make. You can make them using, amongst   other things, with an operational amplifier.
An operation amplifier is normally defined as an amplifier with a differential input ( + and - ) and a single ended output. It has an extremely high ( unusable high ) open loop gain and to get the gain to be a usable value you apply negative feedback. The output impedance is normally in the range of 1K to 10K.

 
Quote
I need to clear up the impedance matching thing
Yes it is the source of all your misconceptions.

Ever thought why you can't turn over a car engine with 8 AA batteries? After all they can provide 12V just like your car battery. You know that you can't but why? Well it is a lot to do with the chemistry in a cell but all that, and more, gets bundled up in the concept of output impedance. It is the equivalent of a series resistor in line with the voltage generator. It forms a voltage divider with your load and if this theoretical resistor is several orders of magnitude greater than your load the potential divider action insures that there is "stuff all" voltage across your load.

Quote
So it seems weird the TL071 can drive larger impedance loads but not a 32Ω headset.
Any voltage source can drive a high impedance because as long as the load is comparable with the output impedance it will deliver a voltage to it. When the load is the same as the output impedance you get half the voltage across the load as the voltage generator produces.

This link is about Raspberry Pi GPIO output impedance but the principals apply to any voltage generator, battery, amplifier, output pin, transducer.
http://www.thebox.myzen.co.uk/Raspberry/Understanding_Outputs.html (http://www.thebox.myzen.co.uk/Raspberry/Understanding_Outputs.html)
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 12, 2016, 02:32 am
Grumpy_Mike,

Im ready to add that transistor to the negative feedback loop now.  

So what you suggest is that I amplify the current through the feedback loop in order to amplify the sound?

How would that work, like this?

(http://i.stack.imgur.com/w1grQ.png)
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 12, 2016, 05:41 am
Basically yes, but I would also add a 4K7 resistor from the emitter to ground as well as the load. This makes sure there is always a path to ground even when it is not connected to a load.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 01:44 am
4K or 4.7K?
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 13, 2016, 01:59 am
4K7 is shorthand for 4.7K. Saves typing a dot. Either would work. 4.7K ohm resistors are common.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 02:45 am
Figured.  Here is the final schematic I drew up:

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=173566)

Next Ill see if I can translate this correctly onto a breadboard (couple of breadboards :-)) and then Id like to make the calculations to see what I should expect.

Does that sound right?
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 04:38 am
Here it is on the breadboard:

(top part) = Vout to Transistor
(nxt dwn) = Vout-Vin interconnection
(nxt dwn) = opamp
(bottom) = mic entry-cap
On the left +/- rails I have GND with green wires on the black-rail
On the rt +/- rails I have +9V on red-rail and -9V on black-rail

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=173580)

https://www.flickr.com/photos/43666730@N04/shares/55Ds7L
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 13, 2016, 06:38 am
Quote
Does that sound right?
No.
The transistor is all shorted out.
The base goes to the op-amp output no where else.
The 4K7 is missing
You have changed the configuration from the origional diagram.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 05:14 pm
Ok here is a better one...

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=173644)
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 13, 2016, 05:40 pm
R4 and R5 are in parallel. Remove one of them.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 07:00 pm
Like this?



Being in parallel is wrong because why?  The effective resistance is reduced?(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=173660)
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 13, 2016, 10:20 pm
Quote
Being in parallel is wrong because why?
Because it is a waste of a resistor. Two identical resistors in parallel is the same as having just one resistor at half the value.

In that last diagram you seem to have shorted out the speaker.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 10:50 pm
you mean shorted because there is nothing between it and Ground?

But then how can I not have it be in parallel with the Emitter resistor-to-ground you said I should add?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 13, 2016, 10:52 pm
Quote
But then how can I not have it be in parallel with the Emitter resistor-to-ground you said I should add?
Are you telling me that in reply #46 R4 was the speaker? If so why was it given a value of 4K7? I thought we had established it was 32R.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 13, 2016, 11:09 pm
Oh!  Yeah, I just dont know how to draw a speaker in ltspice.  I dont have that component.  Ok, so you want to see the speaker as a 32Ω load, which is what it is.  But you said you wanted a:

"4K7 R from emitter to ground as well as the load. "

I understood that as adding a 4K7 R between Emitter and Ground and between Speaker and Ground.

So like this:

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=173692)
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 14, 2016, 12:32 am
Yes that is better. The R6 resistor is so that things still work correctly when the speaker is disconnected.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 14, 2016, 02:24 am
Well I can hear some rattling sound out of the speaker when I move a resistor which seems loose (R3 mic+toVcc+).  Probably just noise.  So to the schematic...Im assuming it can be calculated, what the voltage and current flow should be at each point in the circuit, right?

Will LTSpice just tell me and then I can check those values against what I see on the board?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 14, 2016, 12:21 pm
Quote
Im assuming it can be calculated, what the voltage and current flow should be at each point in the circuit, right?
Yes

Quote
Will LTSpice just tell me and then I can check those values against what I see on the board?
Yes
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 14, 2016, 04:36 pm
Here are my LTSpice results:

Vin (Signal) = 30mV
Vp ~ 0.18mV
Vn ~ 80mV
Vout ~ 8.95V
Vaudioout ~ 8.05V

BJT = 2.5mA
R1 & R5 (negative feedback Rs) ~ 79uA
R2 ~ 0 mA
R3 ~ 1.3mA
Speaker ~ 250mA
R6 ~ 0mA
C1: Current is in the fA.

Here is the image:
(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=173833)
I can see the 30mV signal amplified to 8.95V and the current bumped from 2.5mA to 250mA.  Seems logical.

But Im only getting 0.48V at Vout in the circuit :-(
Title: Re: Opamp setup doubt
Post by: polymorph on Jul 15, 2016, 09:03 pm
4K7 is shorthand for 4.7K. Saves typing a dot. Either would work. 4.7K ohm resistors are common.
It isn't shorthand, it is because if you print or write 4.7k on a schematic, it doesn't take much to either mistake the dot for a bit of smudge, or it might really be 47k but you mistake a bit of smudge for a dot.

4k7 is much harder to mistake for another value.
Title: Re: Opamp setup doubt
Post by: polymorph on Jul 15, 2016, 09:08 pm
That is a terrible way to drive a speaker. You will only see the positive going cycle on the speaker, as half of the waveform is clipped. That circuit only has the ability to source current into the speaker, not sink it.

You want something more like this:
(http://cds.linear.com/image/6020PushPullCircuit.JPG)

By the way, is the center connection between the two 9V batteries connected to circuit ground?
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 16, 2016, 12:34 am
It isn't shorthand, it is because if you print or write 4.7k on a schematic, it doesn't take much to either mistake the dot for a bit of smudge, or it might really be 47k but you mistake a bit of smudge for a dot.

4k7 is much harder to mistake for another value.
That's the history. Digital files don't smudge.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 16, 2016, 03:13 am
polymorph,

Does Vin keep the cap, the 5k r to Vcc+ and the 100k resistor to ground?

Cause I just burnt one of my transistors.  Its my first time burning a component :-)

OOOOooohhhhhhhh!  I just noticed the bottom bjt is a 2n3906!?  I thought both were 2n3904 so I replaced them both with 2n2222 I had!

That would do it, right?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 16, 2016, 07:52 am
Quote
But Im only getting 0.48V at Vout in the circuit
Why is this a problem?

Polymorph- that circuit is running on a split supply so there is AC in the speaker.
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 16, 2016, 10:45 am
That's the history. Digital files don't smudge.
True....although... a bad printout could have a missing dot.
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 16, 2016, 10:51 am
Here are my LTSpice results:
Put the Vcc on the right hand side of the coupling capacitor....not to left of it. The capacitor is meant to let the source AC signals through to the amplifier and stop dc from getting to the source.

Also.... speaker coils don't like dc current flowing through them.

The push pull scheme mentioned by polymorph is a good approach. Checkout amplifier types... like class AB..... class A .... class C. and class D.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 16, 2016, 01:50 pm
Southpark

You mean in my original circuit?
Title: Re: Opamp setup doubt
Post by: Grumpy_Mike on Jul 17, 2016, 12:12 am
@Southpark
Did you miss the fact that the circuit is using a split supply as well?
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 17, 2016, 12:23 am
@Southpark
Did you miss the fact that the circuit is using a split supply as well?
Yeah.... I just checked again. He/she has got split supply.... so ok. Thanks Grumpy Mike.
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 17, 2016, 01:32 am
Southpark

You mean in my original circuit?
Yeah mate...... the resistor goes after the AC coupling capacitor. See the last figure of this link here...

Also note the low leakage capacitor in series with the resistor at the '-' terminal. That blocks DC, which sets the output voltage to be 4.5 V DC (when there's no AC input)..... click here...... (http://www.radio-electronics.com/info/circuits/opamp_non_inverting/op_amp_non-inverting.php)

The above is for single voltage supply.... eg a battery .... 9V for Vcc, and 0V for ground.

But since you have dual supply +9V and -9V, then you won't need to add any DC offset voltage to your op-amp output. But... in any case..... for the original diagram that you had... the capacitor should be on the left-hand side of that resistor (that connects to +9V). Also, the resistor values 5K for top resistor and 100K for bottom resistor are significantly different.... so make sure to think about why those particular values were chosen or used there.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 17, 2016, 04:15 am
I got those values off a afrotechmods YouTube video.  I just read in your article that the resistors to Vcc+ and Gnd should be similar.  No problem, I can change that.  I just realized the guy at the electronics store gave me 100 ohm R instead of 100k!!!  I checked with the ohm meter but I guess I glanced over and saw 98 and assumed 100k instead of 100 Ohms.

I'd like to understand the capacitor a but more.  Capacitors block DC but not AC as it charges and discharges.  So we want it there to stop the DC from Vcc+.  So why would we want the cap before the Vcc+?
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 17, 2016, 06:53 am
So why would we want the cap before the Vcc+?
I sometimes like to think of it as principle of superposition. The DC voltages set up the amplifier circuit in a way so that the output voltage sits at a particular DC voltage (forgetting about output AC coupling capacitor for the moment). The output DC voltage usually sits somewhere around half the maximum and minimum values of supply voltage. Eg... if 9V battery..then Vcc is 9 Volt and ground is '0' Volt. So the output needs to be configured (or designed) to be somewhere in between .... eg 4.5 Volt. This is the DC condition.

Then..... when you start adding an AC voltage to the input, output voltage will certainly change...... and the change will be relative to that initial DC voltage. So applying an AC signal to the input will make the output have AC too..... but that output AC signal will be centred (vertically) around the initial DC voltage.

But adding an AC coupling capacitor prevents DC voltages from getting through it (eg.... an ideal capacitor be considered to be an open circuit for DC signals). So the other end of the capacitor will be AC signals....but no DC. This is on the OUTPUT side of things.

But.... on the INPUT side of things.... if you don't put an AC coupling capacitor, then the DC voltage considerations would then need to include whatever is connected to your amplifier (on the input side). If you have a capacitor on the input... then there is 'DC' isolation. So the circuit just before the amplifier won't mess with the DC voltages of your amplifier.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 17, 2016, 03:02 pm
I didn't understand.  If the cap is first and then the Vcc+, won't all the DC go "into" the opamp instead of if the cap is after the Vcc+?
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 18, 2016, 01:39 am
I didn't understand.  If the cap is first and then the Vcc+, won't all the DC go "into" the opamp instead of if the cap is after the Vcc+?
In the last figure at ..... click here ..... (http://www.radio-electronics.com/info/circuits/opamp_non_inverting/op_amp_non-inverting.php) if R3 = R4, then you'd get (+Vcc/2) at the '+' terminal due to the voltage divider.

Due to usual op-amp operation, the '-' terminal DC voltage also becomes +Vcc/2. The '-' terminal is very high impedance... so no current flows into it (ideal hypothetical case). No DC current flows through R1 due to the capacitor C2. All this amounts to no DC current through R2. So if no DC current flows through R2, then the output DC voltage becomes identical to the DC voltage at the '-' terminal.... ie +Vcc/2. That's because no current flow through R2 means that R2 has no voltage drop across it.

Consider it as principle of superposition, there's a DC component and also an AC component. The DC voltages are generally considered first. The AC component will later be ADDED (summed) with the DC component. So if you apply a pure sinewave signal at the left-side of C1, then the output will have a sinusoidal component that rises and falls (above and below) Vcc/2 (instead of above and below zero Volt).

However, if you add an AC coupling capacitor at the output, then the DC component gets blocked, and you would end up with the typical sinusoid waveform that goes above and below zero Volt.

Title: Re: Opamp setup doubt
Post by: polymorph on Jul 18, 2016, 06:31 pm
So, is the center point between the two 9V batteries connected to circuit ground?
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 18, 2016, 11:25 pm
Yes, the circuit point is ground.  I just got the 100kΩ resistors and Ill try out the circuit.  FTR, Im trying my original circuit which is this one:

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=174279)
Except that I have a tl071 opamp, the transistor is a 2N2222 and I modified the capacitor by moving it behind the 5k & Vcc+.
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 19, 2016, 02:15 am
the 5k & Vcc+.
Watch the 5K resistor though, since it will form a voltage divider (5K and the 100K) below it. To get half-voltage at the mid-point of the divider, the two resistors should be about the same value.... eg 100K top, 100K below.

Actually.......  since you're using dual supply voltage, I don't think you even need that top resistor at all. No voltage divider needed, since you got dual supply. Just keep the 100K there, and remove the top (ie. 5K) resistor altogether.
Title: Re: Opamp setup doubt
Post by: polymorph on Jul 19, 2016, 06:07 pm
Again - you can't drive a speaker with that unless all you are trying to do is get a "buzz" output. In which case, you could skip all that fuss and just use the 2N2222.

That circuit will only source current, it cannot sink current.

Also, the way it is wired in your schematic puts nearly 9V across the speaker. I have no idea what your description of moving the 5k resistor means.
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 20, 2016, 12:21 am
Yes, the circuit point is ground.  I just got the 100kΩ resistors and Ill try out the circuit.  FTR, Im trying my original circuit which is this one:
With a single transistor output..... it can put a lot of current into your speaker in one direction. (eg...when the input to the transistor goes high. But when the input to the transistor goes low .... to around 0V or so, it will turn off. So....while the 1 transistor circuit can generate a nice large positive voltage, it can't generate the negative voltage. For a pure signal (pure sinusoid), the voltage rises from zero to a maximum voltage, then it drops back to zero and keeps dropping down to a negative (absolute minimum voltage, or could say negative max). The single transistor circuit can't generate the negative voltage part of the cycle.

Well...... I guess it could do it..... if the DC voltages are designed in a particular way, but then you would need to use an output coupling capacitor and maybe run into RC charge/discharge issues at low frequencies ....leading to signal distortion.

So ... to get around this, they use a 'push-pull' configuration.... one transistor turns on to handle the positive voltage cycle, and then the other one takes over to handle the negative voltage cycle. No output capacitor needed........ so output is directly coupled to the transistor amplifier.

In your simulator....could rig up something like this to look at ....

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=174402)

[/quote]
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 21, 2016, 12:46 am
So like polymorph said in post #58?

I ask because I dont have a 2N2907A, but I do have a 2N3906.

I do have 10 & 100uF caps but they are electrolytic.
Title: Re: Opamp setup doubt
Post by: Southpark on Jul 21, 2016, 04:05 am
So like polymorph said in post #58?

I ask because I dont have a 2N2907A, but I do have a 2N3906.

I do have 10 & 100uF caps but they are electrolytic.
Hi there marciokoko. Apologies..... yeah.... the transistors and cap values in my simulation were kind of just examples.... I just chose cap values that were large enoiugh to ensure that the capacitor impedances are very small for the AC signals.

If you have 2N3906, yeah....could certainly try that.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 23, 2016, 02:25 am
Ok so Ive wired it up!  Its quite a feat just wiring it up.

Id like anyone to point out any mistakes in the wiring.  The only thing Im missing is the 1Ω-1Ω bridge between Emitter and Emitter of the 2N2222 and the PNP-3906.  The reason I dont have the 1Ω-1Ω bridge is that I dont have any 1Ω resistors...

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=174783)
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 24, 2016, 03:35 am
Can I skip the 1 ohm resistors?
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Jul 24, 2016, 09:59 am
Skip as in leave them out, or short. Use a very long wire.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Jul 26, 2016, 12:35 am
Ok thanks.  Ill try that.

BTW, I just found this while looking for something else:

https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer

This works because the mic is not producing the voltage signal, the arduino is reading it from the SD card, therefore the signal is stronger?
Title: Re: Opamp setup doubt
Post by: polymorph on Jul 26, 2016, 09:00 pm
It works because they are using an LM386, which is a purpose built audio amplifier, something that someone mentioned very early in this thread.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Aug 09, 2016, 01:32 am
Ok I just got an LM324.  I had already ordered it before I posted, because if you recall, this post was originally taken from a tutorial that did use a LM324.  I still havent gotten the LM386 so Im wondering,

1) Should I really bother trying the circuit Southpark#76 using the LM324,

2) Or even my original circuit marciokoko#1 (which got translated to marciokoko#73)

BTW, I just noticed the LM324N is like this:

(http://www.engineersgarage.com/sites/default/files/LM324_1.jpg)

which doesnt have Vcc+ and Vcc-, but rather Vcc & GND.  Would I connect the -9V to GND pin on LN324 if I did try it?
Title: Re: Opamp setup doubt
Post by: pjrc on Aug 09, 2016, 05:35 pm
Id like anyone to point out any mistakes in the wiring.
(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=174783)
Well, for starters, the 2N2222 has 3 leads but you've only connected wires to 2 of them.  Likewise the 2 large capacitors are only connected one 1 of their 2 leads.

Maybe you should spends more time and effort to carefully compare your wiring to the schematic?  One useful approach is to print the schematic and use a colored pen.  For each physical wire, look at the 2 places it actually connects and draw over the wire on your schematic.  If you do this, because those parts have not connection at all on some of their leads, you'll end up with parts of the schematic that aren't colored in.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Aug 09, 2016, 07:27 pm
Yes the 2 transistors are missing their connection because I was waiting for the 1Ω resistors, but ill use the long wire instead.

The caps I haven't wired them up because I was re-wiring everything when I realized the LM324N was different in the sense that it doesnt have a Vcc- and Vcc+.  How should I wire that part up, Vcc- to GND-LM324 and Vcc+ to Vcc-LM324?

Thanks
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Aug 09, 2016, 11:29 pm
...

The caps I haven't wired them up because I was re-wiring everything when I realized the LM324N was different in the sense that it doesnt have a Vcc- and Vcc+.  How should I wire that part up, Vcc- to GND-LM324 and Vcc+ to Vcc-LM324?

Thanks
Either a negative voltage, or a ground will work. Ground is V- when it's numeric value is zero volts. Using ground will make it a "single supply" amplifier, meaning that it's range will be cut off on the bottom.  Note that some data sheets call it GND, and some call it V-. Like this:
(http://circuits.datasheetdir.com/37/STMICROELECTRONICS-LM124-pinout.jpg)
Title: Re: Opamp setup doubt
Post by: pjrc on Aug 10, 2016, 03:29 am
Yes the 2 transistors are missing their connection
From the length of this thread, it probably seems like you can request an unlimited amount of time & effort from the community to provide design assistance.  Why bother getting things right, or even mentioning the things you know are wrong, or even go to the trouble to get a set of good photos which shows the whole build and gives multiple angles to view all parts?

Quote
because I was waiting for the 1Ω resistors, but ill use the long wire instead.
Bad idea.  Maybe someone will write a lengthy explanation.


The caps I haven't wired them up because I was re-wiring everything when I realized the LM324N was different in the sense that it doesnt have a Vcc- and Vcc+.  How should I wire that part up, Vcc- to GND-LM324 and Vcc+ to Vcc-LM324?

Thanks
[/quote]
Title: Re: Opamp setup doubt
Post by: Marciokoko on Aug 11, 2016, 02:15 am
Ok I connected some jumpers and got their ohms to be 1Ω.  The issue Im dealing with is that because I had a split power supply set up and Im connecting the opamp's GND to vcc- on the split supply, I have some things connected to ground and others connected to vcc-.

Connected to Ground (midway between vcc- and vcc+):

mic
speaker
10uF cap on the way to v+ opamp
opamp negative feedback loop

Connected to Vcc- from split supply
GND opamp
100uF (Vo) thru 10k R
2n3906 collector

ChrisTenone, I read your reply #87 but i want to make sure I understand it right before firing this up.  According to what I have, GND on opamp would be connected to -9V as well as the 100uF (Vo) thru 10k R and the 2n3906.  Should I move these to real ground which will actually be 0V because it is in the middle of the 2 9V batteries?

Thanks

Title: Re: Opamp setup doubt
Post by: ChrisTenone on Aug 11, 2016, 05:42 am
Ok I connected some jumpers and got their ohms to be 1Ω.  The issue Im dealing with is that because I had a split power supply set up and Im connecting the opamp's GND to vcc- on the split supply, I have some things connected to ground and others connected to vcc-.

Connected to Ground (midway between vcc- and vcc+):

mic
speaker
10uF cap on the way to v+ opamp
opamp negative feedback loop

Connected to Vcc- from split supply
GND opamp
100uF (Vo) thru 10k R
2n3906 collector

ChrisTenone, I read your reply #87 but i want to make sure I understand it right before firing this up.  According to what I have, GND on opamp would be connected to -9V as well as the 100uF (Vo) thru 10k R and the 2n3906.  Should I move these to real ground which will actually be 0V because it is in the middle of the 2 9V batteries?

Thanks


Most opamps use a dual power supply, V+ and V-. If you make V- equal to zero volts, it is referred to as a single supply opamp. You can use the LM324 either way, you just won't get any negative voltage output with a single supply.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Aug 11, 2016, 05:46 am
Right, but at this moment I still have the 2 batteries making up a split supply +9V and -9V.  Thats what I mean by "I have connected to GND and some connected to Vcc-).

Im thinking I should move the:

GND opamp
100uF (Vo) thru 10k R
2n3906 collector

to real GND from the supply, 0V.
Title: Re: Opamp setup doubt
Post by: Southpark on Aug 11, 2016, 09:15 am
Right, but at this moment I still have the 2 batteries making up a split supply +9V and -9V.  Thats what I mean by "I have connected to GND and some connected to Vcc-).

Im thinking I should move the:

GND opamp
100uF (Vo) thru 10k R
2n3906 collector

to real GND from the supply, 0V.
The two 9V batteries will be connected like this...

+ -******+ -


The starred symbols represent the connecting wire between the - terminal of battery #1 and the + terminal of battery #2.


The wire will become the '0V' side of things (itself).

+ -*******+ -
          *
          *
          *
          *0V

The + terminal battery #1 will be +9V.
The - terminal of battery #2 will be -9V.

The connecting wire itself will be 0V.

And, if we're working with arduino...... we also usually connect that wire (0V) to the GND pin of the arduino as well.
Title: Re: Opamp setup doubt
Post by: ChrisTenone on Aug 11, 2016, 09:30 am
...

And, if we're working with arduino...... we also usually connect that wire (0V) to the GND pin of the arduino as well.
Totally correct. But it needs a caution!!!

Do not hook up the + or - voltages to an Arduino. Both +9 volts, or -anything can fry things in the Arduino world.
Title: Re: Opamp setup doubt
Post by: Southpark on Aug 11, 2016, 10:16 am
Totally correct. But it needs a caution!!!

Do not hook up the + or - voltages to an Arduino. Both +9 volts, or -anything can fry things in the Arduino world.
Excellent word of caution Chris. Yeah.....definitely don't hook up +9 or -9 volt to the arduino digital or analog pins.
Title: Re: Opamp setup doubt
Post by: Marciokoko on Aug 11, 2016, 07:12 pm
Yes I understand how the split supply works from +9v to 0V in the middle to -9V.  Its just that since my original setup had opamp-Vcc- going to -9V and the new setup calls for connecting the "100uF (Vo) thru 10k R" and the "2n3906 collector" to Vcc-...

I guess what Im wondering is, should I do this then:
(https://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=177013)

Basically break the connection from the opamp-Vcc- to -9V, and reconnect it to GND then, but leave everything else connected to -9V?
Title: Re: Opamp setup doubt
Post by: Southpark on Aug 11, 2016, 07:58 pm
Basically break the connection from the opamp-Vcc- to -9V, and reconnect it to GND then, but leave everything else connected to -9V?
Should be like this.....

(http://forum.arduino.cc/index.php?action=dlattach;topic=410623.0;attach=177019)
Title: Re: Opamp setup doubt
Post by: polymorph on Aug 11, 2016, 11:20 pm
Don't forget, you MUST connect the unused Op Amp sections, and do so properly. Do NOT just ground the inputs.

https://www.maximintegrated.com/en/app-notes/index.mvp/id/1957 (https://www.maximintegrated.com/en/app-notes/index.mvp/id/1957)

http://www.electronicproducts.com/Analog_Mixed_Signal_ICs/Amplifiers/Properly_terminating_an_unused_op_amp.aspx (http://www.electronicproducts.com/Analog_Mixed_Signal_ICs/Amplifiers/Properly_terminating_an_unused_op_amp.aspx)