Simple Transistor Inverter Circuit.

crutschow

Joined Mar 14, 2008
38,526
because of the high gain of the 2N3904 the resistors could easily be changed to 39K
But the usual design practice it is to use a forced Beta of 10 to insure the transistor is saturated.
That "high gain" is when the transistor is operating in the linear region with a Vce of several volts.
 

Thread Starter

ZoNiE

Joined Nov 21, 2016
20
FYI. Unlabeled Resistor is 1.5K. Apologies for not labeling it. Mosfet may be the best way to go. Will work on it later this evening with a few of the ideas presented here. I'm trying to limit the current through the two optosensors to keep them alive longer.
 

Thread Starter

ZoNiE

Joined Nov 21, 2016
20
This one was a no-go. Pulls in the relay, immediately, cannot switch on and off. I am using a 1.5K resistor on the two LEDs on the opto sensor. If you suggest different, please advise. These opto sensors are not that expensive, but to replace them is a tedious thing, so I am trying to avoid burning them out. They are in series, and the original OEM was putting 15V to them with an unknown current limit. I saw the Mosfet circuit showing the 120 ohm resistor with 5V. Was that calculated based on the info given for the optosensor? I have ordered Mosfets, don't have any in my bins.
1678226969118.png
 

Thread Starter

ZoNiE

Joined Nov 21, 2016
20
What value resistor were you using?
A 5 volt supply is more then enough to power both sensors in series with a 220 ohm resistor.
If you go with the 5 volt supply change R1 and R2 to 4.7K.
View attachment 289128
Thanks. I swapped in a 7805 and went to 220 ohm. This works like my original with a PNP config but not NPN with the pullup. It doesn't switch at all with the 3904 but switches backwards from what I need with the 3906. I need the relay off when the sensor is not blocked. Currently it is on when not blocked.

I also get better voltage swing from the sensor now. -0.07V when blocked to 2.9V when not blocked, so I need to turn on the driver transistor and relay when the base is at 2.9V. It is and has always turned on at 0V. I am where I started, albiet with a better setup on 5VDC.
 

ScottWang

Joined Aug 23, 2012
7,501
This one was a no-go. Pulls in the relay, immediately, cannot switch on and off. I am using a 1.5K resistor on the two LEDs on the opto sensor. If you suggest different, please advise. These opto sensors are not that expensive, but to replace them is a tedious thing, so I am trying to avoid burning them out. They are in series, and the original OEM was putting 15V to them with an unknown current limit. I saw the Mosfet circuit showing the 120 ohm resistor with 5V. Was that calculated based on the info given for the optosensor? I have ordered Mosfets, don't have any in my bins.
View attachment 289168
1678228321837.png
1678228307744.png
OPB821Z datasheet.
 

sghioto

Joined Dec 31, 2017
8,634
I saw the Mosfet circuit showing the 120 ohm resistor with 5V.
Correct. The specs for the opto were stated at 20ma through the IR diode. Typical voltage drop is appx 1.25 volts on the IR diode.
Have you tried increasing R1 and R2 values to 22K for the 5 volt circuit using the 2N3904?
 
Last edited:

crutschow

Joined Mar 14, 2008
38,526
I think to get the circuit to work in post #27, you will need to use two 2N3904 transistors in a Darlington configuration to increase the gain.
That should allow the use of a 50kΩ or higher resistor, and still have enough gain to reliably operate the relay.
 

Thread Starter

ZoNiE

Joined Nov 21, 2016
20
Correct. The specs for the opto were stated at 20ma through the IR diode. Typical voltage drop is appx 1.25 volts on the IR diode.
Have you tried increasing R1 and R2 values to 22K for the 5 volt circuit using the 2N3904?
No, but I will try next go around. I did try a Darlington pair last week similar to what Crutschow suggested, but my R values were probably off. Lots of dust on that old electronics education in my brain...
 

ElectricSpidey

Joined Dec 2, 2017
3,335
You could drive those output transistors "outside of saturation" and it wouldn't mean didley squat because those relays will still operate just fine.

With a guaranteed operate of around 4 volts and a maximum of 14 you could have 6 volts across the transistor and still have 6 for the relay. (with the 12-volt source)

Thermal issues wouldn't matter with that kind or leeway.

The only issue would be the transistor wattage rating, and I doubt that would be exceeded with that relay.

Of course, this does not apply if the supply is changed to 5 volts.
 

MrChips

Joined Oct 2, 2009
34,823
It would appear to me that the problem is not transistor current gain. The transistor is already turned on.
The problem is turning off the transistor.
 
Top