Introduction: RGB LED Serial Control Arduino

This instructable will show you how to control a RGB led with serial monitor.

To send a colour value to the arduino :

first -open the serial monitor after uploading the code.

second -select 'NEWLINE' in the bottom right corner left to the baud rate.

third -type your own hex values and hit enter.

NOTE:

The hex value should be entered in the format R,G,B

Example: 255,0,255

Step 1: Parts List

1) Arduino uno with atleast three PWM pins.

2) RGB led common anode.

3) Half size breadboard.

4) Jumper wire kit.

5) 3* 220ohms resistor (one for red cathode,one for green cathode another for blue cathode).

6) Computer with Arduino IDE.

Step 2: Connecting the RGB Led to Arduino and Rogramming

1) Place the RGB led on three open rows on the breadboard.

2) Connect the red pin to a 220ohms resitor and connect the end of the resistor to DIGITALPIN3 on the arduino.

3) Connect the common anode pin to 5v on the arduino.

4) Connect the green pin to a 220ohms resitor and connect the end of the resistor to DIGITALPIN5 on the arduino.

5) Connect the blue pin to a 220ohms resitor and connect the end of the resistor to DIGITALPIN6 on the arduino.

6) Upload the code and open the serial monitor and set to 'NEWLINE' and set the baud rate to 9600..

7) Now enter your hex values as R,G,B and hit enter.

NOTE: The maximum value of a rgb led is 255, so if u enter 5000,0,245,, the 5000 will be taken as the maximum value 255 only...

Step 3: Breadboard Layout

Step 4: Arduino Code

Step 5: THATS IT HAVE FUN WITH YOUR OWN CUSTOM COLOURS...

Comments

author
Tronos made it!(author)2017-05-25

not work for me this code, don't do anything when send the number via serial port

author
Surya+Krishnakumar made it!(author)2017-06-07

Hellow. Add me on facebook https://www.facebook.com/profile.php?id=100009289167675 and we will discuss about your issue there :D

author
Surya+Krishnakumar made it!(author)2017-06-04

Hellow Friends :D Could you please spare some time and checkout my new instructable ? https://www.instructables.com/id/Simple-LM386-Powe...

Thanks a lot for all your support and appreciations. :D

author
SelvaK3 made it!(author)2015-05-03

I love this project

author
Surya+Krishnakumar made it!(author)2017-06-02

Good :D

author
aakhtar1 made it!(author)2016-02-06

I made the same scheme but instead of using a single RGB LED, I used a RGB LED strip. Of course the LED strip requires 12v so I'm using a 12v dc wall adapter and instead of connecting the common anode pin to 5v on the arduino, I connected it to Vin.

Cameringo_20160207_053102.jpgCameringo_20160207_053142.jpgCameringo_20160207_052955.jpg
author
Surya+Krishnakumar made it!(author)2017-06-02

Good job my friend :D

author
Surya+Krishnakumar made it!(author)2015-05-03

i will be providing one new instructable everyday. Not a promise but i will try my best.

author
Surya+Krishnakumar made it!(author)2015-05-03

thx

About This Instructable

10,616views

18favorites

License:

More by Surya Krishnakumar:Arduino HCSR04 leds distance warnerArduino DC Motor Speed Control PotentiometerArduio Dc motor speed control serial monitor ..(no l293d)
Add instructable to: