# How much voltage do i need to feed into the reference voltage on my Op. Amp?

#### Jorge Gibbs

Joined Jun 8, 2017
7
Hi, I'm building this simple circuit. The original idea was to detect an interruption between the signal of a photo transistor and an infra-red LED and then trigger a signal through a transistor. However my teacher asked me to add an Op. Amp. (as a Comparator) to make the circuit distinguish between transparent and non-transparent objects. I don't really know how to make that work. I've been simulating this for a while but i can't get the voltages right. Vout needs to be below 5 V , and needs to send a small signal if the photo tranistor recieves a small ammount of light. Any ideas?

#### Jorge Gibbs

Joined Jun 8, 2017
7
Hold on I think I got it. sim looks good gonna test it on a bread board.

#### Jorge Gibbs

Joined Jun 8, 2017
7
Update: I tried to connect it like this on a breadboard however it's not working properly. the LED for some reason is lighting up when I put my hand near the transistor. Please help.

#### Attachments

• 14.5 KB Views: 17

#### Ylli

Joined Nov 13, 2015
965
The leakage current of Q1 is likely enough to drive the 741 'on'. Start by adding a 10k resistor from Q1's emitter to ground. Next, let's get some resistance in series with D2. 1K would be a good value.

Now it would be nice if you configured the 741 as a actual comparator. Add a 1K resistor in series with the 5 volts to the (-) input. Then add a 1K from the (+) input pin to the junction of Q1 emitter and the newly added 10k resistor. Finally, add a bit of hysterisis by adding a 1M resistor from the 741 output pin to the (+) pin.

#### DickCappels

Joined Aug 21, 2008
6,457
There are two important parameters you should pay attention to. One is the Common Mode Input Voltage (see the test parameters for Common Mode Rejection Ratio in the TI, National, or Fairchild datasheet). If you exceed the common mode range the LM741 will go open loop.

The other is the Output Voltage Swing, also in the datasheet. The output cannot swing closer to the + and - power supply than is shown in that specification.

The LM741 might work with a 9 volt battery as the power source but what would the output voltage range be? (See Output Voltage Swing in the datasheet)

#### Jorge Gibbs

Joined Jun 8, 2017
7
The leakage current of Q1 is likely enough to drive the 741 'on'. Start by adding a 10k resistor from Q1's emitter to ground. Next, let's get some resistance in series with D2. 1K would be a good value.

Now it would be nice if you configured the 741 as a actual comparator. Add a 1K resistor in series with the 5 volts to the (-) input. Then add a 1K from the (+) input pin to the junction of Q1 emitter and the newly added 10k resistor. Finally, add a bit of hysterisis by adding a 1M resistor from the 741 output pin to the (+) pin.
Thanks a lot for that, I was a bit confused about the configuration (I missed that single class and I asked for notes but they weren't very clear). I simulated the circuit and it works, it actually works exactly as I wanted it to , I'm going to put it together on my breadboard and see what happens. I just bought a multimeter to test the 741 input and output. Thanks a lot again.

#### Attachments

• 16.3 KB Views: 8

#### Jorge Gibbs

Joined Jun 8, 2017
7
There are two important parameters you should pay attention to. One is the Common Mode Input Voltage (see the test parameters for Common Mode Rejection Ratio in the TI, National, or Fairchild datasheet). If you exceed the common mode range the LM741 will go open loop.

The other is the Output Voltage Swing, also in the datasheet. The output cannot swing closer to the + and - power supply than is shown in that specification.

The LM741 might work with a 9 volt battery as the power source but what would the output voltage range be? (See Output Voltage Swing in the datasheet)
Thanks for that, I'm not exactly sure of the maker of the 741's i'm using, I think they might be Chinese, luckily I just bought a few made by TI, and the Output swing is ±20 V , I don't need much Output voltage, it could be below 5V , my Output so far is only used in an LED so voltage smaller than 5 V should be enough. Thanks a lot for your quick response and your help!

#### DickCappels

Joined Aug 21, 2008
6,457
From I infer from the datasheets is that the output will have difficulty swinging within 3 to 4 volts of either power supply pin. With a 9 volt battery that doesn't leave much range on the output.

The input voltage is restricted to about the same range.

Now that you have a voltmeter you can see what your particular opamp can do.

#### Ylli

Joined Nov 13, 2015
965
1K is too low for R8, try 100K to 1 Meg. And DickCappels has a good point, the 741 is a first generation op amp and the output swing with a single 9 volt supply will be severely restricted. There are modern op amps that are designed to work from the lower voltage, and are spec'd with rail to rail output.

#### Jorge Gibbs

Joined Jun 8, 2017
7
1K is too low for R8, try 100K to 1 Meg. And DickCappels has a good point, the 741 is a first generation op amp and the output swing with a single 9 volt supply will be severely restricted. There are modern op amps that are designed to work from the lower voltage, and are spec'd with rail to rail output.
I checked the simulation again and noticed you said 1M instead, i changed the value and it didn't make a big difference on the simulation , however I tested the circuit with each on my breadboard and there was a pretty big difference. The circuit works very well on the breadboard, I'm going to make the PCB now.

I checked the LM741 TI datasheet and it seems the voltage supply is quite restricted. I've been working with LM741's only so far but I guess I could use a low power op amp (LMH 3401, perhaps?). I normally supply around 12 V while working on the lab, however I'm working at home and I have a voltage eliminator that feeds 9V, which is enough for the use I intend to give to the circuit.

#### Attachments

• 104.2 KB Views: 0

#### DickCappels

Joined Aug 21, 2008
6,457

The LMH 3401 is not a good choice for your kind of circuit. It is a US$8.00 7 GHz amplifier(!) that comes in a tiny surface-mount package. It is good for uses such as driving a high speed A-to-D converter maybe, but not for general experimentation and lighting of LEDs. A popular and inexpensive single-supply opamp (just a few years younger than the LM741) is the dual LM318 and quad LM324 (AFIK the same amplifier as a dual and as a quad). The input and output can go from nearly the negative power supply rail to within about 1.5 volts of the positive power supply. This amplifier is very inexpensive and can work with single power supplies of 3V to 32V. A much more modern single (or dual) supply opamp that can swing nearly rail-to-rail is the dual TLC27L2. The TLC27L2 high performance for very little money and can operate with power supply voltages from 3V to 16V over the commercial temperature range. I think all of the opamps from TI with the TLC prefix have looked and been pretty good. Thread Starter #### Jorge Gibbs Joined Jun 8, 2017 7 View attachment 128773 The LMH 3401 is not a good choice for your kind of circuit. It is a US$8.00 7 GHz amplifier(!) that comes in a tiny surface-mount package. It is good for uses such as driving a high speed A-to-D converter maybe, but not for general experimentation and lighting of LEDs.

A popular and inexpensive single-supply opamp (just a few years younger than the LM741) is the dual LM318 and quad LM324 (AFIK the same amplifier as a dual and as a quad). The input and output can go from nearly the negative power supply rail to within about 1.5 volts of the positive power supply. This amplifier is very inexpensive and can work with single power supplies of 3V to 32V.

A much more modern single (or dual) supply opamp that can swing nearly rail-to-rail is the dual TLC27L2. The TLC27L2 high performance for very little money and can operate with power supply voltages from 3V to 16V over the commercial temperature range. I think all of the opamps from TI with the TLC prefix have looked and been pretty good.
Thanks, I'll look into it, I'll see if I can get the TI LM318!

#### Kjeldgaard

Joined Apr 7, 2016
398
Thanks, I'll look into it, I'll see if I can get the TI LM318!
"Half a LM324" is usually a LM358?

#### DickCappels

Joined Aug 21, 2008
6,457
"Half a LM324" is usually a LM358?
That was a mistake on my part. A long time ago when they were new I used the LM358 and LM318 frequently and managed to get their part numbers mixed up. Thank you for catching my mistake.

The LM318 is not particularly suitable for your kind of use, but the now correctly identified LM358 was designed for low voltage single supply use. Those and LM324 and LM358's's are good to keep around. The TLC27L2 may be a little more difficult to find but it is a much higher performance amplifier than the LM358 in many areas. It is also decades newer.