2094Views13Replies

Author Options:

How do I create an ON-ON-OFF switch using a momentary push button switch??? Answered

I have a project where there are one set of LEDs and another set of LEDs. I am interested in using a momentary push button switch to act as a ON-ON-OFF switch so if you press it once the first set of LEDs turn on -- press again those turn off and the second set are on or if you press it again if turns both off -- etc.

How do I do this???

13 Replies

user
icengBest Answer (author)2012-02-29
user
pletchman (author)iceng2012-03-05

As you warned, the momentary switch was just too "bouncy" resulting in skipped cycles and sporadic results. Can you tell me how I need to incorporate a 555 timer into the circuit to achieve more reliable results. Also, I am open to trying a larger capacitor if you think that will be as reliable. If so please let me know what size you recommend.

Thanks again for the help and guidance.

Select as Best AnswerUndo Best Answer

user
iceng (author)iceng2012-02-29

The 0.01uF capacitor is the debounce device, guys :-)
Or use a magnet on a Hg ( mercury ) whetted reed switch.

If I misread the author take out the middle diode like follard says
and the circuit will turn on one group of leds
and then switch to the second group of leds
and then switch off
and then repeat.

That makes it too easy, no circuit fun .
In fact no diodes ( just Q2 to a base and Q3 to other base ) works also.

A

Select as Best AnswerUndo Best Answer

user
pletchman (author)iceng2012-02-29

Hello Iceng (and every helpful soul here),

You are correct in your response post with the desired set up...

"and the circuit will turn on one group of leds
and then switch to the second group of leds
and then switch off
and then repeat."

Can you please give me a simple schematic/explanation. For my initial use I am going to the trusty Radio Shack and want to make sure I get what I need.

Thanks again for your expertise and assistance.

Select as Best AnswerUndo Best Answer

user
iceng (author)pletchman2012-03-01
user
pletchman (author)iceng2012-02-29

So are you saying the 0.01uF capacitor negates the need for the 555 timer suggested by framistan???

Select as Best AnswerUndo Best Answer

user
iceng (author)pletchman2012-02-29

Not as foolproof as framistans second whole NE555 IC...

If you use my corrected circuit ( Sorry about those previous errors )
A lot depends on how bouncy your push-button is, 
you may need more capacitance.

Also included the CD4017 PDF which is basically a 10 step counter IC.
Every high-to-low clock pulse the counter advances the Q output ( High )
to the next Q in line and at Q10 goes back to Q1.

However when Q4 goes High it is wired to Reset and back to Q1= High
then Q2 goes High lighting group 1 LEDs  and then Q3 goes High
lighting group 2 LEDs and then etc, etc.......   A

Select as Best AnswerUndo Best Answer

user
frollard (author)iceng2012-02-29

Does that not turn both sets of leds on for q3?

question has 'first set on, then those go off and 2nd set goes on'

so they crossover diode between q3 and q2 needs to be dropped.

Select as Best AnswerUndo Best Answer

user
iceng (author)2012-03-05

Here's how I would do it try C1=1uF and R=2.7K...  .  A

Select as Best AnswerUndo Best Answer

user
pletchman (author)iceng2012-07-26

I tried incorporating this but I think I must have something wired incorrectly because it seems even more "bouncy" than the other option. Attached are photos to better show my problem.

Select as Best AnswerUndo Best Answer

user
framistan (author)2012-02-29

The schematic given by "iceng" would work. You may have a problem with the push-button giving more than ONE pulse per push. This can be fixed by placing a 555 timer IC in the circuit. When the pushbutton is pressed, the 555 puts out a SINGLE pulse of a second or 2 length. Feed the output of the 555 IC to the pin 14 of the 4017 IC . This is called "de-bouncing" because whenever a switch is pressed, it gives several pulses rather than just one.

Select as Best AnswerUndo Best Answer

user
frollard (author)framistan2012-02-29

even a tenth of a second debounce should be enough, but totally agreed, debounce.

Select as Best AnswerUndo Best Answer

user
rickharris (author)2012-02-28

With a single switch the only way your going to do this without a lot of discreet components is with a microprocessor.

Select as Best AnswerUndo Best Answer