1
\$\begingroup\$

I am looking to push a button and one led comes on when i push the same button again the first led goes off and the second light comes on. alternating lights each time the button is pressed. one light should always be on.

I was hoping to use a microswitch as the button i want to use has a microswitch that i was going to switch. Would this be a dpdt? Does that exist in a latching pushbutton. Any other circuit ideas that would work?

I appreciate the input

\$\endgroup\$

3 Answers 3

2
\$\begingroup\$

An alternating (push-on, push-off) pushbutton switch would be the easiest. It needs to be SPDT (or better). There are plenty available.

schematic

simulate this circuit – Schematic created using CircuitLab

If you want to connect it to an MCU or other logic, then R2 can be used to assure a valid '0' logic level, otherwise you don't need R2.

\$\endgroup\$
1
\$\begingroup\$

Another possibility if you just want to use a cheap SPST tact switch:

schematic

simulate this circuit – Schematic created using CircuitLab

This will work because the 74LVC1G74 has a Schmitt trigger clock input, which allows a simple RC to be used to debounce the switch. If power is applied with a reasonably fast rise time, the circuit will power up with the Q output low (D1 on) and /Q high (D2 off). That can be reversed by tying the D input to +5 rather than 0V.

\$\endgroup\$
1
  • \$\begingroup\$ You could put a simply RC delay on the S input of the flop to make sure the flop came up in the preferred state. \$\endgroup\$ Commented Mar 24, 2016 at 19:00
0
\$\begingroup\$

If you don't have push-on, push-off switches then you can implement the following circuit using mostly digital components.

The input stage is a classic cross-coupled NAND de-bounce circuit that will get rid of any glitches coming from pressing the button. The second stage is just a basic D-type flip flog configure as a T-Type (Toggle) flip-flop.

Finally you can use the flops complimentary outputs to drive your LED circuit. Depending on the flip-flop you use, you may not need the output transistor stage.

Note: All values are approximate. I just used the default circuit wizard values.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.