I am trying to work out how to use a single momentary switch to cycle through 3 LEDs. For example: LED1: ON LED2: Off LED3: Off Switch triggered LED1: Off LED2: ON LED3: Off Switch triggered LED1: Off LED2: Off LED3: ON Return to the start of the cycle I thought that perhaps JK Flip flops would be the way to do this, but I do not have the experience to work it out. Can anyone provide some insight? |
by Foust
August 07, 2012 |
Have a look at: https://en.wikipedia.org/wiki/Shift_register I think if you make a 3 bit SIPO, tie the Q output of the 3rd stage back to the D input of the first stage and then preset a single stage to put a 1 into the loop. Then clock it with the pushbutton. You will need to debounce the switch (search CL for tags on debounce). |
by signality
August 10, 2012 |
Thanks for the input. Does this look correct? (ignoring the values for R) |
by Foust
August 10, 2012 |
Connect the LED anodes to 5V, not ground. Or reverse the diode polarities. Put pulldown resistors from the switches to ground. Then replace the switches with voltage controlled switches. Drive them with PWS() sources generating your desired pulse sequence (see: https://www.circuitlab.com/docs/expressions/). Set up a time domain simulation probing the pulse source voltages and either the flip-flop output voltages or the LED currents. Set your time steps to no longer than 0.1 times the shortest duration in your pulse sequence (i.e. you clock period). What does your simulation do? It may be simpler to start with D-type flip flops and move on to JKs when you've got that to run OK. |
by signality
August 23, 2012 |
Try a CMOS 4017 IC, it has ten outputs but can be configured to use only 3 in a sequence you want, and its all in one IC. |
by TomG
September 17, 2012 |
Please sign in or create an account to comment.
CircuitLab is an in-browser schematic capture and circuit simulation software tool to help you rapidly design and analyze analog and digital electronics systems.