Using Android to control Arduino via Bluetooth (HC-05/06 Module)


Recently, I’ve noticed many projects incorporating Android-Arduino communication. One of the easiest (and cheapest) ways of achieving this is to use a HC-05/06 Bluetooth module. You can pick one up from for ~$15.

For this project, i used a Galaxy S3 to independently control 4 LED’s. You will need to download the app ‘Arduino Bluetooth Terminal’, which is available for free on the Play Store.

To hookup the bluetooth module, connect the 5v and GND to their corresponding arduino headers of the same name. For the TX/RX pins, use digital pins 10(TX) and 11(RX)


You’re indicator led on the HC-05/06 should now start blinking.

To pair your android to the module, use the passcode “1234”. Try “0000” if that does not work. Once paired, the indicator led should now be constant ON.

To set-up the simple LED cct, please refer to the the picture below. Note the GREEN, BLUE, RED, and WHITE led’s are powered by digital pins 4, 5, 6, and 7, respectively.


Almost finished!

Upload this sketch to your board:

#include <SoftwareSerial.h>;

SoftwareSerial bluetooth(10, 11); // RX, TX
int ledGRN = 4;
int ledBLU = 5;
int ledRED = 6;
int ledWHI = 7;
int BluetoothData;

void setup()

void loop()
 if (bluetooth.available())

 bluetooth.println("GREEN ON");

 bluetooth.println("BLUE ON");

 bluetooth.println("RED ON");

 bluetooth.println("WHITE ON");

 if (BluetoothData=='0')
 bluetooth.println("LED'S OFF");


Now you should be able to turn on the 4 LED’S by entering the numbers ‘1 2 3 4’, and turn them off by pressing ‘0’.


Think of all the possibilities that are now open to you! For example, you could control any 120V cct. by simply adding a relay, instead of powering a led. Remember, creativity is limitless!

Leave your questions & comments below.

22 comments on “Using Android to control Arduino via Bluetooth (HC-05/06 Module)

  1. Pingback: DIY Home Automation with Android | King's Tech Garage

  2. Hi there, This is a nice project..
    may i have the code for the android side so that i can tweak with that…
    Thank u ….


  3. Hello Dolphy, I like your post, but I am confused I just bought a generic BT dongle based on HC-05, mine is quite similar to the one on your pics, even it uses only 4 pins, but I could not establish communication with the Arduino, the dongle just don’t stop blinking, I am sending the AT commands and nothing, I heard that some of this products might not work at all, have you faced something similar ? If so how did you fixed ?


  4. Pingback: Manual control of an Arduino based robot using Android | King's Tech Garage

  5. Pingback: DIY Home Automation with Android | King's Tech Garage

Join the discussion.

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s