Alternate between two LED's using a momentary switch

Foust

n00b
Joined
Jun 23, 2005
Messages
5
All I can seem to find are flasher schematics so I thought someone could help me here.

I would like to alternate between lighting two different LEDs using the same momentary switch. For example I press the momentary switch once, LED1 turns off and LED2 turns on. I press the same momentary switch again, LED2 turns off and LED1 turns on.

I think the way to do this is with a JK flipflop however its has been 10 years since I took that digital electronics class.

Any help is greatly appreciated.
 
I think I can help. You'll need, as you said, a JK flip flop like this one. It has two flipflops in the same package, but you can just use one. You'll want to tie J, K, and Reset to Vcc. Connect one side of the switch to ground and the other to the CP pin. Connect a resistor (10k Ohm will be fine) between the CP pin and Vcc. Add a capacitor (1uF) between the CP pin and ground. (that capacitor will be in parallel with the switch)

Now, there's a couple ways you can hook up the LEDs. The simple way would be to connect one LED (with its current-limiting resistor) to Q and the other (with its resistor) to Q'.

And you're done.
 
Thank you that was exactly what I was looking for. Is that positive edge triggered or negative edge triggered, or does that matter?


You have saved me much cursing. :)
 
That Flip Flop is negative edge triggered, and with the circuit as I described, the LEDs will alternate when the (N.O.) button is pressed (rather than when it is released).
 
Thanks for the clarification. The link above didnt send me to a part so I wanted to be sure.
 
Thanks for the clarification. The link above didnt send me to a part so I wanted to be sure.
Ah, then try This one. It has a couple extra pins, but no big deal--you'll just have to tie the Set pin to Vcc just like the others. Still negative-edge-triggered.
 
Thanks for the new link.

Another question if I may. If I wanted to add more LEDs to the cycle, can this circuit scale to include more LEDs?
 
From the datasheet, it looks like the FF is limited to 25mA, which is one LED's worth of current. If you want more, you'll have to hook up a transistor to each output in order to drive multiple LEDs.
 
Back
Top