← How-Tos
electronics Jul 3, 2026 ◑ 1 views ◯ 2 min read

Arduino + Bluetooth (HC-05/HC-06) Wireless Control

arduinobluetoothhc 05hc 06wireless

HC-05 vs HC-06

HC-06 is slave-only — it can be connected to (like from your phone) but can't initiate a connection itself. HC-05 supports both master and slave mode, configurable via AT commands, and can connect Arduino-to-Arduino as well as phone-to-Arduino. For most "control my project from my phone" projects, either works fine; HC-05's flexibility only matters if you need two Arduinos talking to each other wirelessly.

Wiring

Basic Code (SoftwareSerial)

#include <SoftwareSerial.h> SoftwareSerial BT(2, 3); // RX, TX void setup() { Serial.begin(9600); BT.begin(9600); // HC-05/06 default baud, unless you've reconfigured it } void loop() { if (BT.available()) { char c = BT.read(); if (c == '1') digitalWrite(13, HIGH); if (c == '0') digitalWrite(13, LOW); } }

Pairing

Default PIN on most HC-05/06 modules is 1234 or 0000 — pair from your phone's Bluetooth settings like any other device, then use a generic "Bluetooth Terminal" app (several free ones on Android; iOS is more restrictive about raw Bluetooth serial due to Apple's MFi requirements, so Android is the easier path for hobby projects) to send characters and watch the LED respond.

Reconfiguring via AT Commands (HC-05)

Hold the module's onboard button while powering on to enter AT command mode, connect at 38400 baud (the AT mode baud rate, different from the normal operating baud rate), and send commands like AT+NAME=MyRobot or AT+PSWD=1234 to rename the device or change its pairing PIN.

Building a Real Control Interface

Beyond raw single-character commands, define a simple text protocol (e.g. "F" forward, "L50" turn left at 50% speed) and parse incoming strings rather than single characters once your project needs more than a couple of states — this scales much better as control complexity grows.