3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

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.).

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.

8 answers
sort by: active | newest | oldest
Dec 21, 2009. 3:07 AMlemonie says:
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
Dec 21, 2009. 2:12 PMlemonie says:
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
Dec 21, 2009. 8:40 AMseandogue says:
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> )
Dec 21, 2009. 8:42 AMseandogue says:
0 - off
1 - R
2 - G
3 - B
4 - reset
Dec 21, 2009. 3:53 AMsteveastrouk says:
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
Dec 20, 2009. 8:58 PMMarsh says:
 This is how a DPDT switch would be used to accomplish the task.
Dec 20, 2009. 8:33 PMNachoMahma says:
.  A DPDT switch or relay will swap polarity.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!