Android Controlled RGB LED Using Arduino

by hemaraj in Circuits > LEDs

22383 Views, 132 Favorites, 0 Comments

Android Controlled RGB LED Using Arduino

57223ece2e7fb6568c0007e9.jpeg
ANDROID Controlled RGB LED
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.




COMPONENTS NEED

P_20160428_175809_DF.jpg
P_20160428_175547_DF.jpg
P_20160428_175639_DF.jpg
Arduino uno or any arduino clone. (atmega 328)

1.HC-05 Bluetooth Module

2.RGB LED's

3.Android mobile

RGB LED

P_20160428_175713_DF.jpg
P_20160424_145056_DF.jpg
P_20160428_163824_DF.jpg
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.

CIRCUIT DIAGRAM & SCHEMATICS

Untitled Sketch_bb.jpg
Untitled Sketch_schem.jpg
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.

ANDROID APPLICATION

P_20160428_164220_DF.jpg

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.

PROGRAMMING

leo_1988.jpg
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()));


VIDEO

ANDROID Controlled RGB LED

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.