Introduction: Computer Controlled RGB Led

Picture of Computer Controlled RGB Led

Here are some photos of a project I've been working on. Its a RGB Led that can be controlled from my PC. In addition to being able to change its color, I am also able to make it blink at any rate I choose. I started this project a while back but stopped when I got stumped trying to devise a way to send a color over serial connection to my Arduino. I came back to the project after a time and found this article that explained a lot about serial communication. After working out how to send the color to the Arduino I wrote a program in C# so that I wouldn't have to open Serial Monitor and type in a bunch of numbers. All it does is let you select a color and sends it to the Arduino, which updates the LED. Shortly after I made that program, I thought how cool it would be to control the light from my phone! I immediately dived into an ASP.NET web app to do it. That way I could control the LED from a web browser on any computer (or smartphone!) on my home network. This turned out to be way more of an effort than it needed to be, as my inexperience led to all sorts of troubles, but with the help of a friend I was able to get it working. I am very pleased with the result.

If you would like to try this on your own here's how.
-Wire a common anode RGB LED to your arduino by connecting the anode to 3.3V, the red lead to pin 3, the green lead to pin 6, and the red lead to pin 5. Don't forget resistors.
-Download the attached Arduino sketch and upload it to the board (extract it first).
-Open Serial Monitor and type in any of these commands:

0 - Turns the light off
1 - Turns the light on
3xxx/xxx/xxx/ - A three followed by three numbers, each with a slash "/" on the end changes the color of the LED. (Example. 30/255/0/ would turn the light green)
4 - Stops blinking
5xxxx/ - A five followed by a number with a slash "/" at the end causes the LED to blink. The interval between blinks is the number after the five (in milliseconds. 1000 = 1 sec).

Thanks for reading!


DraakUSA (author)2015-05-05

Can you supply the source for your control app as well?

juggleboy (author)DraakUSA2015-05-08

Here's a .zip with the Visual Studio project. It is not very polished (I didn't originally plan to distribute it), and it assumes your arduino is on serial port COM4, so if that's not the case, you'll need to alter the code. Good luck!

FlorianS20 made it! (author)2016-03-27

This code has helped me so much, I couldn't figure out how to send the colors from my pc to the arduino at first, but thanks to your code I am making a program with a lot of color effects. My first effect is setting a Theme. I not completely finished, but I am able to set my background to a selected image and update the color I want to go with it :)

juggleboy (author)FlorianS202016-03-27

Looks good! I'm glad it was useful to you. Sending color data over serial was the biggest challenge for me as well. Thankfully, the internet holds many guides and tutorials.

DraakUSA (author)2015-05-08

Each of the LEDs colors (Red, Green, Blue) can be adjust between the values of 0 and 255 for 256 intensity levels. Thus, you effectively have 256 * 256 * 256 = 16,777,216 different colors.

nodoubtman (author)2013-08-13

How many colors it does?

thank you!

juggleboy (author)nodoubtman2013-08-14

The led has leads that control the intensity of the red, green, and blue light it shines. Almost any color can be produced by adjusting these three values.

amandaghassaei (author)2012-08-31

cool, I'd love to see a video demo of this thing in action!

About This Instructable




More by juggleboy:Upgrade Your Space Launch with a Physical Staging Button for Kerbal Space ProgramComputer Controlled RGB LedStopIt! LED Game (powered by arduino)
Add instructable to: