Maker Pro
Maker Pro

741 differential amplifier question

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Well why didn't you say this before?

Ummm, quite possibly because until this point I was assuming you wanted an analogue output voltage, not that you wanted to switch a relay.

If you look at your original post there is no mention of wanting to drive a relay, indeed you suggest that you want an output that is the difference of the input voltages.

I was under the assumption that when hooked up as a differential amplifier the 741 op-amp will output the difference between the inputs. If that assumption is correct then what am I doing wrong in my simulation to cause a -2.5V on the 741 output?

Now to your second post.

I assume this is what you had in mind?

Closer, but you require a resistor in series with the base of the transistor to convert the voltage output of the op-amp to a current required for the transistor. It is also more usual to connect the emitter to the -12V rail rather than the 0V rail for reasons which you touch on here.

The only question I have is why does my transistor not blow up when there is 10 volt potential difference between the BE junction? In the simulation the only way I can make the transistor blow is to hook up a neg supply rail to the Emitter and ground to the base. Guess I am missing something again... :confused:

Firstly, if you connect the -ve supply rail to the emitter, and the base to ground, you are shorting the negative rail to earth via the BE junction. *That* is what will kill the transistor.

-10V on the base compared to the emitter may kill the transistor, a lot depends on the current the comparator can deliver and the individual characteristics of the transistor (it, for instance, may not break down at 10V even though the specs say it will at (say) 8V).

In any case it's not a desirable thing to do to the transistor.

1) Since you now want a comparator rather than an amplifier, you are best looking for a comparator which allows the inputs to go right to the negative supply rail and use a single ended power supply. (beware that the output may be open collector!)

2) The other option is to use a 24V relay and connect the emitter of the transistor to -12V

3) A third option would be to place a diode going from emitter (anode) to base (cathode), which, with the base resistor will eliminate any significant reverse bias on the transistor,

The reason #3, which may seem best, is the last option is that it is a band-aid. Practically speaking it means that if you power this from batteries, the +ve supply will be drained far faster than the -ve supply (so you will be replacing one set of batteries most of the time). If you power it from a purpose built power supply, it will be unnecessarily complex. Even if you went the route of a switch capacitor voltage inverter to provide the -12V rail, the complexity is way higher than it needs to be.

The base resistor you should choose should be one which can provide sufficient base drive (roughly twice the relay current divided by the minimum predicted gain of the transistor) -- probably across 9 or 21V depending on where the emitter is placed.

If the op-amp is replaced with an open collector comparator, this resistance needs to be the total of the base resistor and the pull-up resistor. The presence of a diode to protect the BE junction of the transistor would complicate this somewhat.
 

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
You'll have to excuse my ignorance with the differential amplifier I "supposedly" wanted. As I stated in another thread, my electronic engineering skills are zilch. I am learning by doing.

NOTE: I would like to use a battery or two to run this circuit. My only criteria!

1) Since you now want a comparator rather than an amplifier, you are best looking for a comparator which allows the inputs to go right to the negative supply rail and use a single ended power supply. (beware that the output may be open collector!)

I guess I don't understand what you mean here exactly. I have taken your advice and looked for a comparator IC. The most logical option for me is probably the LM339 I presume.
What I don't understand is why you suggest using a single ended supply and yet a requirement for the comparator is one which allows the inputs to go to the neg rail? Won't using a single ended supply keep me with just a pos rail?

2) The other option is to use a 24V relay and connect the emitter of the transistor to -12V

I like this option the best. I wouldn't need to buy a special IC and I could always scale back the input voltages to 6 volts so I wouldn't need a 24 volt relay.
My only concern is that when the output of the op-amp swings toward zero the transistor would blow because the BE junction would then be shorted. -6 volts(scaled down to use the 12v relay) on the emitter, 0 volts on the base, Until the transistor is turned on. Would I still need a diode to protect the BE junction? My thought is I will need something, given the scenario that the two inputs are equal for an extended period of time I will have a reverse BE voltage of 6 volts which is max reverse BE junction rating for a 2n3904.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
LM339 is an excellent choice. The common mode voltage range includes ground (the most negative rail in this case).

I referred to the negative rail as I didn't want to confuse you by talking about ground, which is the "middle" rail for a double ended power supply.

For a double ended power supply you have +V, Gnd, and -V.

For a single ended power supply you have +V and Gnd. Gnd can also be referred to as the negative supply rail (yeah, I guess it's confusing).

If you use an LM339 you will need a pull-up resistor on the output. Check the data, there is a diagram that shows you. The pull-up resistor should be the value calculated earlier for a base resistor and the output can be connected directly to the base of the transistor driving the relay.

edit: I'm assuming the base resistor is in the order of 10k or so. Let me know what you calculated. If it's huge there may be a better way to go (I can't imagine it being smaller than 3k)
 
Last edited:

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
Had to teach myself to learn orcad/pspice. But man am I glad I did. What a great tool. :)

I chose R5 to be an arbitrary value of 3k, same as datasheet. Graph says it all though, this will work out nicely. What do you think?

edit: R6 is also arbitrary, I chose 200 Ohms because if I remember right that was the coil resistance. Ok, so I looked up the 2n3904 and it list the min gain at Ic of 10mA is 50. Knowing that I need about 60mA going across the relay coil, then my base current should be about 1.2mA. I double this to give myself some room. 12/.002 = 6k Ohms for R5????
 

Attachments

  • lm339_comparator.PNG
    lm339_comparator.PNG
    23.5 KB · Views: 982
  • lm339_comparator_graph.PNG
    lm339_comparator_graph.PNG
    39.6 KB · Views: 378
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
It seems fair. Check out the collector voltage on your transistor. That will tell you if it goes into saturation.
 

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
~.6V at the collector. From what I know that means the transistor is fully saturated.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Yep, that sounds fine.
 

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
Orcad/pspice simulation help

I am trying to understand what I am doing wrong here. I am sure it's just a lack of experience on my part that is holding me back again.

I made this circuit and simulated it using a 200 ohm resistor for the relay to make it simpler in the beginning. But now I would like to finish my whole design. The idea here is for the transistor to conduct and the the relay to turn switch 'on' and then clamp on. For simplicity reasons I have just tied com/nc/no to ground for the simulation.

In another thread that is more off topic, steve mentioned that the voltage drop across my transistor would let me know if it was in full saturation or not. With the resistor in place of the relay this simulated perfectly 600mV at the collector. But now with the relay I am ending up with a 4 volt drop across the CE junction of the transistor(shown in the graph) why is my question? Maybe someone with some orcad/pspice could chime in and tell me what I am doing wrong.

The graph, X axis is showing the resistor R2 change from 0.1 to 20k using dc sweep, if that matters to anyone trying to understand what I am doing.

Page three of this thread is most relevant to the post above.
https://www.electronicspoint.com/741-differential-amplifier-question-t220503p3.html
 

Attachments

  • lm339_comparator_relay.PNG
    lm339_comparator_relay.PNG
    17.5 KB · Views: 1,957
  • lm339_comparator_graph_relay.PNG
    lm339_comparator_graph_relay.PNG
    16.4 KB · Views: 318
Last edited:

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Vce(sat) varies for different transistors, and it is larger at higher currents. However, a Vce of 4 volts is much higher than one would expect to see if the transistor was near saturation.

I'd try dropping the pull-up resistor to 3k and see what happens.

Of course, this simulation only makes sense if you're planning to use a similar transistor and relay. If your relay draws more or less current, or your transistor has significantly different specs, the simulation will not have helped you a great deal.
 
Last edited:

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
Of course, this simulation only makes sense if you're planning to use a similar transistor and relay. If your relay draws more or less current, or your transistor has significantly different specs, the simulation will not have helped you a great deal.

You was right, I had changed the I_DROP and I_PULL values, at the time i thought that was my current draw, now I see those values are when the relay switches. Once I increased R_COIL to 200 everything looks good again.
 
Last edited by a moderator:

jackorocko

Apr 4, 2010
1,284
Joined
Apr 4, 2010
Messages
1,284
What I have here is the original circuit that was working before plus a 555 timer in astable mode that is driving a cd4020 binary counter.

I setup the 555 timer in astable mode with a 50% duty cycle. I want a 20 min timer, so I took 20 mins * 60 seconds and got 1200 seconds. Divided that by 2^10 and got 1.17 seconds. From there I took 1.17 seconds divided it by 2 and divided that by the capacitance to get my resistor values for the 555 timer.

Three most important questions...
1) Does my math add up?
2) When 20 mins is up will the output on pin 14 of the 4020 ic be high or low?
3) Does the circuit look sane? should I be using any sort of decoupling capacitors?


edit: I wanted to use a 4541 IC, might still do it. But my simulation software doesn't have pspsice models for the 4541 or the 4060. Both have internal oscillators and would eliminate the need for the 555. Opinions?
 

Attachments

  • lm339_comparator_w_555_astable_cd4020_bc.PNG
    lm339_comparator_w_555_astable_cd4020_bc.PNG
    29.6 KB · Views: 2,620
Last edited:
Top