862Views8Replies

Author Options:

How can I change the color of a RGB LED with the push of a button (i.e., push once for red, again for green, etc.). Answered

I have to laugh when I see the prices of flashlights that have multiple LED colors. $50 for a headlamp with 6 RGB LEDs?  Really?  I have seen "Buy It Now"s on eBay that have 50 pcs of RGB LEDs for ~$17.  Besides, the fun is in building one myself.

Tags:RGBLED

8 Replies

user
lemonie (author)2009-12-21

You want to cycle through 3 colours with a single push button - some kind of microcontroller would be in order. Unless you can get a rotary switch that works on a push (like a ballpoint pen)?

L

Select as Best AnswerUndo Best Answer

user
CasCom98 (author)lemonie2009-12-21

I like that idea.  I have a flashlight that has that (off-LED-Laser).  What are they called.  I tried to find them online, but can't seem to find exactly that.  I would need one with an off and 4 "on".  I will be using RGB LEDs (3 in 1 package, shared anode), UV LEDs and a krypton bulb.

Select as Best AnswerUndo Best Answer

user
lemonie (author)CasCom982009-12-21

The push-rotary is simplest if you can find one, or maybe just a rotary. Otherwise it gets more complicated. I think of motorbike gears - one way up, the other down - click, click, click...

L

Select as Best AnswerUndo Best Answer

user
seandogue (author)2009-12-21

switching could be done with clever use of a 4 bit counter chip and a multiplexer

Hint: use the pushbutton as the clock source thru a Schmidtt trigger (to debounce clk> )

Select as Best AnswerUndo Best Answer

user
seandogue (author)seandogue2009-12-21

0 - off
1 - R
2 - G
3 - B
4 - reset

Select as Best AnswerUndo Best Answer

user
steveastrouk (author)2009-12-21

Are you comparing LEDs of the same specification. I can pick up 0605 (surface mount) RGB LEDS for your kind of prices, but they are slightly bigger than a grain of sugar.....

What you want to do is do-able with simple logic, but depends on the wiring of the LED. Are you going to use separate RGB elements, or are they arranged with common wires, or back-to-back ? 

Steve

Select as Best AnswerUndo Best Answer

user
Marsh (author)2009-12-20

 This is how a DPDT switch would be used to accomplish the task.

Select as Best AnswerUndo Best Answer

user
NachoMahma (author)2009-12-20

.  A DPDT switch or relay will swap polarity.

Select as Best AnswerUndo Best Answer