Program 2: CONTROL A LED USING HC-06 BLUETOOTH MODULE
WITH Arduino Android Bluetooth
Components required
1. Arduino Uno
2. Breadboard
3. Jumper Wires
4. USB Cable
5. HC-05 Bluetooth
6. LED
7. Arduino Bluetooth connector APP
Circuit Connections
HC-05 ARDUINO
VCC 5V/Vin
GND GND
TXD RX
RXD TX
LED ARDUINO
Anode (+) PIN 13
Cathod (-) GND
Circuit Diagram:
Steps:
1. Connect the HC-05 Bluetooth with Arduino and LED with Arduino similar
to the above diagram.
2. Upload the code to the board.(Note: Disconnect the Rx and Tx before
uploading the code to the board)
3. After uploading the code then connect RX and Tx to the Arduino board.
4. Install the app “Arduino Bluetooth Controller” from Play store in
Android mobile.
5. Pair the HC-05 and set the values of LED to 0 and 1 using settings.
6. LED will be OFF/ON using Android mobile.
Source Code:
char Incoming_value = 0;
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop()
{
if(Serial.available() > 0)
{
Incoming_value = Serial.read();
Serial.print(Incoming_value);
Serial.print("\n");
if(Incoming_value == '1')
digitalWrite(13, HIGH);
else if(Incoming_value == '0')
digitalWrite(13, LOW);
}
}