Control Arduino via Bluetooth using HC-05 or similar module.
Circuit Diagram
Wire Connections & Pin Configuration
Wire Color Connections:
Green → Pin 0 (RX) to Bluetooth TX
Blue → Pin 1 (TX) to Bluetooth RX
Red → 5V to Bluetooth VCC
Black → GND to Bluetooth GND, LED cathode
Yellow → Pin 13 to LED anode
Pin Configuration:
Arduino Digital Pin 0 (RX) → Bluetooth TX
Arduino Digital Pin 1 (TX) → Bluetooth RX (via voltage divider)
Arduino 5V → Bluetooth VCC
Arduino GND → Bluetooth GND
Arduino Digital Pin 13 → LED anode
Arduino GND → LED cathode
char data = 0; // Variable to store received data
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(13, OUTPUT); // Set LED pin as output
}
void loop() {
// Check if data is received via Bluetooth
if (Serial.available() > 0) {
data = Serial.read(); // Read incoming data
Serial.println(data); // Print received data to Serial Monitor
// Control LED based on received command
if (data == 'F') {
digitalWrite(13, HIGH); // Turn LED ON
}
else if (data == 'B') {
digitalWrite(13, LOW); // Turn LED OFF
}
}
}
Instruction Details
Wiring: Connect Bluetooth TX to Arduino RX (Pin 0), RX to Arduino TX (Pin 1) via voltage divider (1kΩ). Connect VCC to 5V, GND to GND. Connect LED anode to Pin 13 via 220Ω, cathode to GND.
Library: Not required (built-in).
Upload Code: Tools → Board → Arduino Uno. Tools → Port → select your COM port. Click Upload button.
View Output: Pair with phone/PC via Bluetooth. Use serial app to send 'F' (LED ON) or 'B' (LED OFF).
How to Use
Connect the required components as per the Pin Configuration above
Open Arduino IDE and create a new sketch
Copy and paste the code above
Select your Arduino board and COM port from Tools menu
Click the Upload button to upload the code to your Arduino
Open Serial Monitor (if applicable) to see the output