RGB Led and Arduino

Led and remoteSo recently I bought one of those cheapo ledlight thingies with a remote control and was very disappointed that it does not allow you to just select a red, green or blue value and manage the color intensity  individually hence being able to produce any color you want.

You can only select some ugly (imho) colors and only the intensity of the white light (which has a wrong color temperature) can be dimmed… B-O-R-I-N-G!

Googling around could make you think that dimming LED’s is complex but that’s not really the case. You just have to dim it differently. You can’t just decrease power to the LED but you need to use Pulse Width Modulation (PWM). Lot’s of articles to be found about this (click here). For me it was time to put this to the test with my Arduino.

arduinoled_bbphoto2

 

 

Because I want to minify the circuit I thought about using one potentiometer to manage all three intensities and use a switch to toggle between dimming the R, G or B values. This saves input pins  and later on I can use Arduino code on a ATtiny85.

The circuit is shown above left and how it looks in real life is there on the right. I also have a little tinkering video below:

The code to manage all this is not very complex. The only thing is that you need to decrease the number of times that the Arduino is checking the switch other wise the RGB selection will be uncontrollable:

Share
adminRGB Led and Arduino

Leave a Reply

Your email address will not be published. Required fields are marked *


× 1 = three