[Dino] tells us about transistor-based on/off switches

hackaweek_transistor_onoffswitch

You know them, you love them, you take them for granted – they are single push button on/off switches. As [Dino] explains in the most recent episode of his Hack a Week series, they are typically implemented in the form of IC logic switches nowadays, but it wasn’t always that way. When they first came on to the scene in the 70’s, the single button soft switches were built using a set of transistors and a capacitor to get the job done, so [Dino] decided to research push on/push off transistor switches a bit and build his own.

After reading through a short tutorial, he was ready to go. As he explains in the video, the operation of the switch is fairly simple, though he did run into some odd issues when he prototyped the switch on a piece of breadboard. He’s looking for someone to explain why the unstable circuit suddenly performs better with the addition of a small capacitor between the battery’s positive lead and the circuit’s output, so if you have some insight, be sure to speak up in the comments.

In the meantime, check out [Dino’s] exploration of push on/push off switches below.

Comments

  1. flaggfox says:

    The capacitor acts as a ripple filter and probably also as a crude debounce mechanism.
    See:

    http://www.labbookpages.co.uk/electronics/debounce.html

  2. Rochey says:

    Shamus rocks… I have a cat that does exactly the same thing while I’m at my bench.

  3. Those transistors you drew in on the whiteboard are fairly high gain for BJTs. Most really common transistors like the 2N4401/4403 and 2N3904/3906 are low gain (Hfe). Could seriously mess up the circuit if you subbed with low Hfe… also that website shows powering the circuit from 12V instead of 9V. Could also matter. The spot where you put the 0.1uF cap is kind of a weird place to put it and I don’t think it’s helping really as you can see at 2:15 What values for everything did you use?

    The cap would delay the turn off time (reset time of Q1), discharging completely in about 50ms, but Q1 would turn off after I’m guessing about a 30ms period.

    Now that flaggfox mentions it, this circuit does seem susceptible to switch bounce. Adding the cap to the base-emitter junction of Q3 might make more sense.

  4. kwantam says:

    Q1 and Q3 work together to make a bistable latch. If one turns on, it turns the other on, which keeps the first going. If both are off, they stay off. Hence, bistable: two operating points.

    The thing is, these aren’t the only possible operating points. Add in some parasitic capacitance here and there (e.g., a few pF between adjacent rows on your breadboard, a few hundred fF between flying wires in the air, et cetera) and suddenly you’ve got an oscillator. If you swamp those parasitics with an intentional pole (that extra cap you’re adding), you can eliminate the possibility (or at least reduce the likelihood) of a stable constant amplitude oscillation and force it to act only like a latch.

    I suspect that if you put that hundred nano cap between the base of Q1 and ground, you’ll get more or less the behavior you want, but if you make said cap too big you’ll have to compensate by making C1 bigger so that it can soak / deliver enough charge to flip the state of the latch.

    As to why connecting it to the positive supply works: it’s not much different from connecting it to ground, except that you see the impedance through the battery. So you’re adding a pole and a higher frequency zero to the circuit: the impedance through the effective series-RC of the cap + battery impedance begins to drop compared to the impedance looking into the output node at some frequency (pole); at some higher frequency, it stops dropping (zero). My guess is that the zero is at such a high frequency that it’s not doing anything for you, and that it’s effectively identical to just connecting the cap to ground.

    You can build more or less this same circuit with two CMOS inverters (74hc04, for example). Connect the output of the first inverter to the input of the second. Connect the output of the second inverter through 100 kohms to a 1 microfarad cap, and also connect that same output through a 1 kohm resistor to the input of the first inverter. Now connect a switch from the cap to the input of the first inverter. The resistor values probably need a bit of a tweak, but it’s exactly the same idea as what you’ve got here.

    • If you put a cap on the base of Q1 to ground I think the circuit will have a tendency to turn on as soon as you apply power. At the base of Q3 to ground would be better in my opinion.

      I’m also guessing the circuit is not oscillating at high frequency on and off, but rather the bouncing of the switch that might be making things switch on and off… making it appear that the circuit stays on, when in reality it turns off and back on say 10 times and stops on the ‘on’ condition again. The value of C1 and low impedance of R6 would tromp on any oscillations and keep Q3 saturated no matter what Q1 is doing. R5 is fairly high impedance so even if Q3 oscillates on and off it’s not going to discharge C1 very quickly.

      Lot’s can be wrong if Dino has subbed in all kinds of different values to get it to work… he needs to chime in.

  5. WeblionX says:

    I actually drew up the designs for something similar. It used a D-flip-flop as a toggle with a couple of resistors and a capacitor as a switch debouncer. It’s a little overcomplicated, but I’ve not bothered trying to simplify it yet. I’m rather tempted to revisit it now.

  6. sendar says:

    cap acts as pulldown

  7. Dino says:

    Thanks for the info! I pretty much figured it was a debounce issue.
    As far as substitutions, I was using some low gain BJTs and I KNEW I was asking for trouble. I have since ordered the proper transistors and, when they arrive, I’m going to build this circuit again to see how much different it behaves.

    As always, I really enjoy the feedback from the crowd here. I always learn something!

    Keep on hackin!

  8. mrjack says:

    oldest mistake in the book! no RF bypassing.

  9. hboy007 says:

    Let’s cut down the parts count by using a 2N5060 thyristor. The holding current (5mA) will be higher but when driving an LED, I don’t see why that should be an issue :-)

  10. Jon says:

    I am glad the internet never dies. Could we switch the switch with a PNP and a sensor of some sort? Turn this circuit into something that would turn on a light and keep it on if the sensor is triggered?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 93,964 other followers