Jan 022010
 

(as a few had noticed, I had an error in the schematic shown. It’s been updated, thanks!)

A recent question from a friend who made a really cool BlinkM hoodie was: How can you turn a momentary button press into an on/off toggle?

There are tons of ways to do this if you like getting into electronics. Most all work off of some flip-flop like principle. And while I could have suggested a true flip-flop chip, I thought it would be cooler if you could use a 555 timer chip (which contains a single flip-flop and a couple of comparators). After scouring my childhood collection of Forrest Mims electronics books and a few 555 timer devoted websites (two of the best I found were: http://www.bowdenshobbycircuits.info/ & http://www.kpsec.freeuk.com/555timer.htm), I cobbled together the following circuit based off a few almost-what-I-wanted examples.

This is what it looks like in use:

The schematic is pretty straightforward, but does use a bit of feedback trickery to get the toggle functionality:
On/off toggle switch from a momentary switch using 555
(old incorrect version here)

The parts cost is pretty low. The 555 timer chip can be had for about $0.43, the 2N3904 transistor for ~$0.40, and various resistors & capacitors are essentially free if you have them.

The circuit has 3 external two-pin connections: 5V&Gnd, button input, and the two pins of the thing to switch. In this case, the switched thing is a power supply to a BlinkM.

By changing the transistor to a beefier one, you can switch much larger loads. The little 2N3904 transistor in there now can switch around 200mA, but a bigger NPN or FET transistor and you could switch a few amps.

It can be made pretty small on a tiny breadboard (courtesy of FunGizmos.com) like this:
Simple on/off toggle from a momentary switch

It’s not the greatest for battery-powered applications. When “off” it draws about 4-6mA, depending on the brand of 555 timer chip you use. When on it draws that plus whatever power the switched device draws. Best to put a proper power switch on the battery pack to eliminate this quiescent drain.
On/off toggle switch from a momentary switch using 555

 Posted by at 11:29 pm

  52 Responses to “Momentary Button as On/Off Toggle using 555”

  1. Yay! You rule! I’m going to start cranking these out after next month. Right now I am up to my eyeballs in VDMX (http://vidvox.com). By the way, if any of the geniuses on this blog can work out a way to have a MaxM change to a random color every time it senses a whack with an accelerometer (all on an arduino), I will pay you for your design! I want to have a kickdrum light up a different color every time it is hit.

  2. Jeez you guys, it’s like you want correct schematics and reasonable pictures of the circuits. ;-)

    I updated the schematic and included an overhead view.

  3. I would love to cheat and get a clearer top-down photo of your proto-board by the way.

    I guess for my finished jackets i’m going to try to build this on as small a piece of breadboard as I can, and then maybe seal it up in a blob of shapelock or something. I think there’s a lilypad protoboard that is big enough to accommodate the circuit, but I’m not sure.

  4. Oh good. I thought I was just not building it correctly. (I am a novice at trying to put stuff together from a standard schematic and I’m spoiled by getting to use so many premade pcb’s with component maps.)

  5. The circuit doesn’t work. I just tried building it from the schematic provided. I will now try the one left by underwood.

  6. Underwood & Tim, I think you’re both correct: the schematic I drew above has an error. I could have sworn I wired it up exactly as the schematic I drew. Once I get back to my lab I’ll take a look at how I really have it wired up. :) For now, yes assume the bowden circuit is more correct one.

  7. Looking at the photo, it appears that capacitor C1 is actually connected to R3 and not to the blue wire going to IC1 pin 2. So the proto-board is correct, but it didn’t get properly transcribed to the schematic.

  8. I think the schematic may have an error. The referenced site shows capacitor C1 on the other side of the switch, connected to R3. I haven’t built the circuit, but intuitively the Bowden circuit seems correct – when the button is pushed, the capacitor will override the R1/R2 divider and momentarily pull the trigger pin high or low. As shown here, the 100K isn’t going to move the trigger voltage enough to get the trigger out of the hysteresis zone.

  9. The circuit has an error and doesn’t work. The 1uF capacitor has to be tied to the 100k resistor. Look here: http://www.bowdenshobbycircuits.info/page9.htm#555-T.gif

  10. Aha. Thanks for clearing that up.

  11. Ivo, a BC547 transistor should work fine instead of the 2N3904 I use.

    Andrew, yes you are correct that 555 chips have high drive capability. This makes them great for driving multiple LEDs usually.

    In this case though, that can’t be done because the OUT pin is being fed back into input section of the circuit. The load from an LED connected directly to OUT screws up the input section, most notably not allowing the capacitor to charge up correctly. The transistor then is acting more like a buffer for the signal than an amplifier.

  12. I have a 555 manufactured by Fairchild, and according to the datasheet, it can source, on its own, 200mA. I understand 555s are generally known for this relatively high capacity. Doesn’t that make this transistor redundant? One would have to be careful, of course, to make sure that their specific 555 has this capability, but most 555s, I belive, should be able to manage 60mA on their own. Please let me know if I’m mistaken, or if I’ve misunderstood.

  13. Very nice, been looking for something like this!

    I would like to drive a relay with it, can this circuit also operate at 12v? Also, can I use another small-signal diode like BC547 or similar?

  14. […] a momentary tactile switch to turn something on and off. Instead of going with a microcontroller he built the circuit around a 555 timer. What he really needed in this case is a flip-flop but lacking a chip for that he went with the 555 […]

  15. Yup. Each BlinkM draws 60mA at most and that transistor that acts as the power switch is good up to 200mA. If you needed to switch more power, just swap out that transistor for a power transistor like the TIP120.

  16. I should have all the parts in the next few days… this should work ok with two blinkm’s, right?

  17. Mouser is awesome (as is Digikey). But they both have overwhelming amount of variety. I like Jameco because they stock the most common things pretty cheaply.

  18. Oh, I was looking at mouser, I’ll try Jameco.

  19. Get the cheapest caps you can find. In this case, that will be the 50V ones. Generally when picking capacitors, you choose a voltage rating that is at least 2x the working voltage of your circuit. So if you’re at 5V, the look for 10V or greater. I don’t know where you’re getting your parts, but as one example, Jameco has 1uF 50V electrolytic capacitors for $0.06 each.

  20. When I look for 1uf caps I see 50 volt and 100 volt ones, which should I get?

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)