How to switch a transistor between gnd and floating?

Thread Starter

tpny

Joined May 6, 2012
220
I have a transistor sr flip flop circuit that sets and resets an led. (Please see attached schematic.) At positions 's' and 'r' in circuit, if I each put a pushbutton switch tying the flip flop transistor's base to ground, I can press 's' to switch on the led and 'r' to switch off led.

I want to replace the pushbuttons by transistors. I need the transistors to perform that same sr operation so I think I need to make the transistors switch between ground and floating. How can I do that? Thanks for your help!
 

crutschow

Joined Mar 14, 2008
34,420
You just connect the collector of (two) NPN transistors to the Set and Reset input with the emitters to ground. A positive current of 50μA or more into the respective transistor base lead will turn on the transistor and connect the collector to ground, performing the Set or Reset function. Removing the base current will open circuit the transistor.
 

Thread Starter

tpny

Joined May 6, 2012
220
thank you! that works!

However, when there's a little glitch. The S transistor is turned on by a current sense resistor, the R transistor is turned on by a pushbutton. So when the current rises to a level, led turns on, when i push the pb, it turns off. But this is what is happening: when the current rises to a point, the led turns on, but then it drops and the led turns off (it should only turn off when i push the pb).. Any idea why this is?? Thanks!
 

Ron H

Joined Apr 14, 2005
7,063
thank you! that works!

However, when there's a little glitch. The S transistor is turned on by a current sense resistor, the R transistor is turned on by a pushbutton. So when the current rises to a level, led turns on, when i push the pb, it turns off. But this is what is happening: when the current rises to a point, the led turns on, but then it drops and the led turns off (it should only turn off when i push the pb).. Any idea why this is?? Thanks!
Post the complete schematic.
 

Thread Starter

tpny

Joined May 6, 2012
220
here it is. mind you if i isolate the flip flop circuit and drive their npn transistors by s and r transistors like crutchow said, it works.. But when driven by my current sense the led turns on then off when the s transistor is "triggered" by a 30mA rise follow by a drop back to 15mA (idle) without the r transistor (preceded by pushbutton) ever being pushed to turn on.
 

Attachments

Last edited:

Ron H

Joined Apr 14, 2005
7,063
here it is. mind you if i isolate the flip flop circuit and drive their npn transistors by s and r transistors like crutchow said, it works.. But when driven by my current sense the led turns on then off when the s transistor is "triggered" by a 30mA rise follow by a drop back to 15mA (idle) without the r transistor (preceded by pushbutton) ever being pushed to turn on.
I don't understand what your circuit is supposed to do, or how it works.
I appears to me that pushing the button removes power from the flip flop. S and R don't mean much to a FF that has no power.
How are you controlling the 15mA/30mA signal? Is it generated on the right hand side of the circuit?
What is the voltage on the emitter of the PNP on the left?
The 2N3904 on the right side looks like its collector and emitter are swapped.
Reference designators would help immensely.
 

Thread Starter

tpny

Joined May 6, 2012
220
this is the receiver end of a current loop, the sender end sends out 15mA on idle and 30mA when a pb is pushed (on sender end). On the receiver end, during idle, some of the 15mA will be used to charge the 12V acid lead batt. When the pb (on sender end) is pushed, 30mA is now circulating on the loop (this lasts 5 seconds or so) which 'triggers' the relay to turn on and opens a solenoid valve, it also turns led on.

Now on the receiver end, I have a push button that 'feedbacks' a 0mA signal back to the sender. This is done by pushing the receiver pb (u see in circuit), this turns off the pnp at the entrance of the circuit and leads to flip flop to turn off the led. Notice when loop is cutoff (0mA) some transistor is powered by battery.. Well, i think this circuit over complicates the question at hand but here it is.. My main problem now is, when trigger pb is pressed on sender side, 30mA is on the wire and led turns ON, but then current returns back to 15mA (idle) and led turns OFF. I want the led to stay ON until I press pb on receiver side..

(Yes, the 3904 on the right is drawn upside down, need to flip that around. thanks!)
 

Thread Starter

tpny

Joined May 6, 2012
220
the voltage level following pnp on topleft is about 13V (due to battery on far right is about 12V). I changed the ff to be powered by battery, now when sender pb is pressed the led turns ON and stays ON (even when current level pulses back to 15mA (15mA to 30mA back to 15mA). But now when I press the receiver pb, the led turns OFF but when I release it, it turns back ON again.. But making progress sinse it makes sense to keep ff powered despite loop current getting cutoff by pnp when pb is pushed. Thanks!
 

Thread Starter

tpny

Joined May 6, 2012
220
coil turns on when the npn below it turns on, it draws less than 30mA since that's how much the loop has on it when it is 'triggered'.
 

Ron H

Joined Apr 14, 2005
7,063
coil turns on when the npn below it turns on, it draws less than 30mA since that's how much the loop has on it when it is 'triggered'.
How do you figure that? The coil current comes from the battery. It could be higher than 30mA. What we need is the coil resistance, or a datasheet.
 

Thread Starter

tpny

Joined May 6, 2012
220
oops u r right, the coil is powerd by battery.. (I was still thinking about a prior version of my circuit..). So I've hooked up an ammeter to the battery and when coil is ON and relay ON as a consequence (hearing a click) the ammeter reads -50mA (minus meaning current is leaving battery in this hookup). Here's datasheet for relay attached, I have the model that uses 12VDC at coil. Thanks!!!
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
I simulated your circuit, and made some changes. I simplified the circuitry on the right side of your circuit, just for simulation purposes. I reduced the size of the cap across the switch so the sims could be shorter.
I have taken issue with some of your resistor values. Your LED switch transistor did not have enough base current. You may recall from previous threads that reliable saturation requires that Ic/Ib≈10 or less.
Your current sense circuit was not producing enough current to reliably switch the relay transistor and the flip-flop switch transistor. I added some positive feedback (R15, R17 and D4) to the current sense circuit to correct this problem.
I think this does what you want. It turns on the LED when 30mA flows. The LED stays on until the switch is depressed, at which time it stays off untill the next 30ma input. 15ma will not cause the LED to switch on or off.
 

Attachments

Thread Starter

tpny

Joined May 6, 2012
220
Thank you so much for cleaning up my circuit!! I really appreciate it! Could you explain the bit about adding the positive feedback to collector of Q10? I'm not understanding that! I will try this out on my breadboard presently!
 

Thread Starter

tpny

Joined May 6, 2012
220
And I notice your pnp Q8's collector has a ground reference where my version the collector drives two npn bases downstream and no ground reference. Why is that an improvement? Thanks!
 

Ron H

Joined Apr 14, 2005
7,063
And I notice your pnp Q8's collector has a ground reference where my version the collector drives two npn bases downstream and no ground reference. Why is that an improvement? Thanks!
That comes from my engineering background. I seldom leave a base (Q9 & Q10, in this case) floating. The transistor turns off very slowly (typically many microseconds), because the stored charge in the base must be cleaned out before the transistor can turn off. The resistor provides that discharge path. This slow response probably isn't a problem here. The other potential problem with floating bases is that collector-base leakage at high temperatures can cause the transistor to turn itself partially on. The base-to-emitter resistor provides a path to ground for that current, so that it doesn't flow into the base.

Note the changes in flip flop resistor values. These are NOT arbitrarily chosen. They are designed to provide adequate base drive to each transistor.
 
Last edited:
Top