Introduction: Android Controlled RGB LED Using Arduino

Picture of Android Controlled RGB LED Using Arduino

Hai to everyone in the post iam going show how to control the RGB LED using android with arduino and HC-05 Bluetooth module.

I searched in web there is lot of techniques to control the RGB LED. But this is the method which is very simple and easy.

In this method the color of LED is controlled by using the android application which is freeware you can download it from google play store.




Step 1: COMPONENTS NEED

Picture of COMPONENTS NEED

Arduino uno or any arduino clone. (atmega 328)

1.HC-05 Bluetooth Module

2.RGB LED's

3.Android mobile

Step 2: RGB LED

Picture of RGB LED

I used here is RGB LED you can also use a normal THD(Through Hole Device)LED.before choosing the LED be careful whether it is common anode type or common cathode.here i used is common anode type. which means the R,Gand B terminals is connected to PWM pins and the final terminal is connected to vcc 5v in arduino. I soldered the RGB LED in the pref board so it is easy to connect to arduino.

Step 3: CIRCUIT DIAGRAM & SCHEMATICS

Picture of CIRCUIT DIAGRAM & SCHEMATICS

connection is made by based on the type of the LED you use. I used here is common anode type common pin is connected to +5 vcc.

RGB LED CONNECTION (Only pin 3,5,6,9,10,11 are PWM pins)

Pin 3 of arduino is connected to red pin of RGB LED.

Pin 5 is arduino connected to green pin of RGB LED.

Pin 6 of arduino is connected to blue pin of RGB LED.

HC-05 Bluetooth module connection

Pin vcc is connected to +5 or +3 based on your module.

Pin gnd is connected to arduino gnd pin.

Pin Txd is connected to arduino pin 11.

Pinn Rxd is connected to arduino pin 12.

Step 4: ANDROID APPLICATION

Picture of ANDROID APPLICATION

Download the color LED controller application from the google play store.

Click Here To Download

The application sends the information to HC-05 Bluetooth module then the module send the data to the arduino then then the color is varied by PWM pins in arduino.

Step 5: PROGRAMMING

Picture of PROGRAMMING

Download the program and upload it to arduino. If you bought common anode type upload the rgb_led_ca for common cathode use rgb_led_cc

The difference between the two program is.For common cathode the program sends positive value to PWM pins.

analogWrite(PIN_RED, (255+R.toInt()));
analogWrite(PIN_GREEN, (255+G.toInt()));

analogWrite(PIN_BLUE, (255+B.toInt()));

For common anode type


analogWrite(PIN_RED, (255-R.toInt()));
analogWrite(PIN_GREEN, (255-G.toInt()));

analogWrite(PIN_BLUE, (255-B.toInt()));


Step 6: VIDEO

PLAY VIDEO
NOTE: Don't upload while bluetooth module connected to arduino. disconnect the module before uploading and connect it back after uploading the program.

Comments

kuldeephotline (author)2017-01-26

thank you,

i made it with Arduino's Uno, nano, mega but i want to make it with Arduino micro. please tell me how can i make it becouse arduino imicro dont have 11,12 pin for RX,TX

ЯворИ (author)2017-01-22

Hello, thank you for the great code!!! But for me the colors were wrong and i needed to delete "255+" at the last three lines like this one:

analogWrite(PIN_BLUE, (255+B.toInt()));

to get :

analogWrite(PIN_BLUE, (B.toInt()));

AinA5 (author)2016-07-28

Hello Sir, I am Ain and I am doing my project which is using your apps as a references. I got the references and doing the same instructions that u given in your blogspot. but it doesn't works. Please help me sir. I want to know if my connection between bluetooth HC-05 to arduino UNO and also the connection to the breadboard is correct or not. If u got this message, please kindly reply. I am waiting for your response.Thanks you sir.

R - pin 3

CA - 5V

G - pin 5

B - pin 6

Bluetooth HC - 05

RX - pin 12

TX - pin 11

GND - gnd

hemaraj (author)AinA52017-01-17

First check LED you used is common ANODE LED or common CATHODE LED

Mjtrinihobby (author)2016-05-24

impressive. you got my vote.

insructAbdo (author)2016-05-08

its not worck code

hemaraj (author)insructAbdo2016-05-08

which part of the code ?

About This Instructable

11,313views

125favorites

License:

Bio: I am an electrical student living at chennai i love electronics very much.
More by hemaraj:BUILD VOICE CONTROLLED APPLICATIONSDIY PORTABLE POWER BANKMake Simple Adjustable WorkBench Power Supply
Add instructable to: