Page 1 of 1

### #8 The OpAmp [Post Homework Here]

Posted: Thu Dec 13, 2012 10:48 pm
A new lesson was posted today:
http://www.pyroelectro.com/edu/basics/opamp/

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 3:42 pm
What are two uses for Op-Amps?
A: Comparator circuits and amplifier circuits.

What are the two main types of amplifier configurations used with Op-Amps?

A: Inverting Vo = (-R2/R1)Vi
Non-inverting Vo = (1 + R2/R1)Vi

How can an Op-Amp be used as a comparator?
A: Connect unknown voltage to Vin (pin 3 - non-inverting side), and connect a known voltage to Vref (pin 2, inverting side), then connect battery anode to positive power rail (pin 7) and connect negative power rail (pin 4) to ground. The out pin will produce a voltage (HIGH state) when Vin > Vref.

Of course, the video's schematic has pins 3 and 2 flipped to the comparator shown in formulas.pdf and the amplifier circuits, which is very confusing. It also seems to be using the non-inverting side (+) as Vref. I guess both methods work but I used the above method (high state when Vin > Vref) and it worked in Multisim.
Please let me know if "the right way to do it" is using inverting side (-) as Vin.

What are the 5 main pins of a standard Op-Amp?
A: Vin, Vref, Powerrail +, Powerrail -, OUT

I'm having trouble building the amplifier circuits shown in formulas.pdf, I guess I probably need another voltage source somewhere but I'm not sure how. Here's what I've got so far, help would be much appreciated:

http://i.imgur.com/PkmU1.png

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 4:44 pm
coresnake wrote:What are two uses for Op-Amps?
A: Comparator circuits and amplifier circuits.
...
...
...
I'm having trouble building the amplifier circuits shown in formulas.pdf, I guess I probably need another voltage source somewhere but I'm not sure how. Here's what I've got so far, help would be much appreciated:

http://i.imgur.com/PkmU1.png

Hi Coresnake,

Good answers and thanks for all the feedback, I think my schematic tool had some errors. I'll fix those things.

Regarding which side inverting vs. non-inverting for using the comparator function. There is no right way because each way produces an opposite output from the other way.

When you have Vref at the (+) input and when Vin is at the (-) input:
If Vin is below Vref, output is V+
If Vin is above Vref, output is V-

Alternatively, swap them: When you have Vin at the (+) input and when Vref is at the (-) input:
If Vin is below Vref, output is V-
If Vin is above Vref, output is V+

I don't have the same simulation program (which one is that by the way?) as you so I just modified your image a little:
http://i.imgur.com/q4CFW.png
-Output from Pin 1,
-Pin 7 Connected to a second +5 power supply (V2)
-Pins 1 and 5 don't need to be connected

Hope that helps!

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 5:37 pm
http://i.imgur.com/J6cWO.png

This is in Multisim by the way. I'll keep fiddling with it for a bit.

Thanks for your help, the site is great by the way, I was unclear on a lot of basic concepts because a lot of tutorials tend to throw in all the math and advanced stuff together, its so much easier to get a 'feel' for it when the main concepts are standalone (plus the math is easy when learned separately anyway).

Can't wait for more lessons!

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 6:32 pm
I experimented with what you said about Vin and Vref for the comparator, and for some reason I'm getting the completely opposite result:
http://i.imgur.com/PpodZ.png

Could this be a bug, or am I doing something wrong?

Switching Vin to the (+) terminal and Vref to the (-) terminal also gives the complete opposite of what it should.

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 7:53 pm
coresnake wrote:I experimented with what you said about Vin and Vref for the comparator, and for some reason I'm getting the completely opposite result:
http://i.imgur.com/PpodZ.png

Could this be a bug, or am I doing something wrong?

Switching Vin to the (+) terminal and Vref to the (-) terminal also gives the complete opposite of what it should.

It looked good to me. Your volt-meter is measuring the wrong spots and so it looks like your Vref < Vin should actually be Vref > Vin, same with the other one.

Try moving it like this and I think that should clear things up.
http://i.imgur.com/BP6gC.png

Thanks for the good words. I've always wanted to do 'from the basics' kind of stuff, but its harder to teach than you might think ^_^. My projects/tutorials/articles always assume a certain level of knowledge which I know ostracizes a certain group of people who want to learn but need more fundamentals.

::EDIT::

coresnake wrote:I tried your adjustments and I'm still not getting 5x amplification:
http://i.imgur.com/J6cWO.png
...
...
...
Can't wait for more lessons!

So the reason I didn't really go into too much detail about how OpAmps actually do their amplification beyond looking at the two formulas and schematic structures is because it gets really complicated, really fast. When we get to the Analog course on PyroEDU, these details will be explained in the detail you probably desire . I don't have access to a simulation tool at the moment so I used this online one...here are 3 pictures that give you an idea how the amplification would work:

Schematic:
http://i.imgur.com/4e3QB.png

Simulation Details:
http://i.imgur.com/cjnsS.png

Simulation Waveform (Voltage vs. time):
http://i.imgur.com/Pebai.png

In the simulation you'll notice that the peak voltage on input is a little less than 1 Volt and on the output is just under 5 Volts and that the sine-waves are opposite each other. So you can see, 5x amplification and negative each other (phase offset by 180 degrees).

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 8:28 pm
That worked for the comparator, thanks.

Will post screenshot of amplification if I ever get it working...

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 8:31 pm
coresnake wrote:That worked for the comparator, thanks.

Will post screenshot of amplification if I ever get it working...

Check my post above, I edited it with some details about the amplification side of things.

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Dec 15, 2012 9:13 pm
Wait.. so it only works with AC source?

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sun Dec 16, 2012 1:44 am
This is what I got using AC.. seems to be -5x voltage alright:

http://i.imgur.com/wfkBf.png

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sun Dec 16, 2012 5:37 am
coresnake wrote:This is what I got using AC.. seems to be -5x voltage alright:

http://i.imgur.com/wfkBf.png
coresnake wrote:Wait.. so it only works with AC source?

Hey,

That's right, only AC signals can be amplified. If you speed up your signal from 1Hz to say, 1 KHz your Transient Analysis will look a lot better.

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sun Dec 16, 2012 2:00 pm
Thanks again for the help!
http://i.imgur.com/9unld.png same circuit with frequency at 1kHz, that was awesome!

### Re: #8 The OpAmp [Post Homework Here]

Posted: Thu Feb 07, 2013 12:31 am
HOMEWORK QUESTION 1
What are two uses for Op-Amps?
Inverting and summing
HOMEWORK QUESTION 2
What are the two main types of amplifier configurations used with Op-Amps?
Inverting and non-inverting
HOMEWORK QUESTION 3
How can an Op-Amp be used as a comparator?
A ‘comparator’ is an circuit that compares two input voltages. One voltage is called the reference voltage (Vref) and the other is called the input voltage (Vin).
When Vin rises above or falls below Vref the output changes polarity (+ becomes -).
HOMEWORK QUESTION 4
What are the 5 main pins of a standard Op-Amp?
1=offset null, 2=inverting input, 3=non-inverting input, 4=V-, 5=offset null, 6=output, 7=V+,8=NC

### Re: #8 The OpAmp [Post Homework Here]

Posted: Sat Feb 16, 2013 5:06 am
jonnyquin wrote:HOMEWORK QUESTION 1
What are two uses for Op-Amps?
Inverting and summing
HOMEWORK QUESTION 2
What are the two main types of amplifier configurations used with Op-Amps?
Inverting and non-inverting
HOMEWORK QUESTION 3
How can an Op-Amp be used as a comparator?
A ‘comparator’ is an circuit that compares two input voltages. One voltage is called the reference voltage (Vref) and the other is called the input voltage (Vin).
When Vin rises above or falls below Vref the output changes polarity (+ becomes -).
HOMEWORK QUESTION 4
What are the 5 main pins of a standard Op-Amp?
1=offset null, 2=inverting input, 3=non-inverting input, 4=V-, 5=offset null, 6=output, 7=V+,8=NC

Good answers, you brought up a few things I didn't talk about in the video like summing and the two offset null pins. Wish there was more time to teach it all, but I'll have to save that kind of stuff for a more advanced lesson. Well done!