Project Overview & 2026 Component Costs
Integrating wireless communication into embedded systems is a rite of passage for any electronics hobbyist or engineer. The combination of an Arduino Nano and a Bluetooth HC-05 module remains one of the most cost-effective, reliable ways to achieve classic Bluetooth (BR/EDR) serial communication. In this guide, we will bypass the superficial overviews and dive deep into the hardware realities, logic-level protections, and firmware configurations required to build a wireless relay controller.
Below is the realistic Bill of Materials (BOM) based on average 2026 market pricing for hobbyist components:
| Component | Specific Model / Spec | Est. Price (2026) |
|---|---|---|
| Microcontroller | Arduino Nano (ATmega328P, CH340 USB-UART) | $4.50 - $6.00 |
| Bluetooth Module | HC-05 (CSR8510 Chipset, 6-pin breakout) | $5.50 - $8.00 |
| Logic Level Shift | 1kΩ and 2kΩ Resistors (1/4W) | $0.10 |
| Output Actuator | 5V Relay Module (Optocoupler Isolated) | $2.00 - $3.00 |
| Power Source | 18650 Li-ion Battery + MT3608 Boost Converter | $4.00 |
The Critical Logic-Level Mismatch (Do Not Skip)
The most common failure mode when pairing an Arduino Nano with an HC-05 module is permanently damaging the Bluetooth module's RX pin. According to the official Arduino Nano hardware documentation, the ATmega328P operates at 5V logic levels. However, the HC-05 module's serial pins (TX and RX) are strictly 3.3V tolerant.
Sending a 5V HIGH signal from the Nano's TX pin directly into the HC-05's RX pin will degrade or instantly destroy the module's internal voltage regulator or UART transceiver. To prevent this, we must implement a simple voltage divider on the Nano's TX line.
Voltage Divider Math & Wiring
Using a 1kΩ resistor (R1) and a 2kΩ resistor (R2), we can drop the 5V signal down to a safe 3.33V:
Formula: V_out = V_in × (R2 / (R1 + R2))
Calculation: 5V × (2000 / (1000 + 2000)) = 3.33V
Note: The HC-05's TX pin outputs 3.3V, which the Arduino Nano reliably reads as a 5V logic HIGH (anything above 3V is generally recognized as HIGH by the ATmega328P). Therefore, no level shifting is required from HC-05 TX to Nano RX.
Step-by-Step Wiring Guide
Follow this exact pinout to ensure stable serial communication and adequate current delivery. The HC-05 can draw up to 150mA during transmission spikes, which the Nano's onboard 5V regulator can handle, but direct 5V rail power is preferred.
- HC-05 VCC → Arduino Nano 5V
- HC-05 GND → Arduino Nano GND
- HC-05 TX → Arduino Nano D10 (SoftwareSerial RX)
- HC-05 RX → 2kΩ Resistor → Arduino Nano D11 (SoftwareSerial TX)
- Voltage Divider Junction (between 1kΩ and 2kΩ) → HC-05 RX
- 1kΩ Resistor (other end) → GND
- Relay IN → Arduino Nano D8
Firmware: Writing the Bluetooth Bridge Code
We will use the SoftwareSerial library to free up the hardware UART (D0/D1) for debugging via the USB Serial Monitor. As noted in the SoftwareSerial library documentation, not all pins support RX interrupts, but D10 is fully supported on the Nano.
#include <SoftwareSerial.h>
// Define SoftwareSerial pins: RX = 10, TX = 11
SoftwareSerial BTSerial(10, 11);
const int RELAY_PIN = 8;
char incomingByte;
void setup() {
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, LOW); // Ensure relay is off on boot
// Initialize hardware serial for USB debugging
Serial.begin(9600);
// Initialize Bluetooth serial (Default HC-05 data baud is 9600)
BTSerial.begin(9600);
Serial.println('System Ready. Waiting for Bluetooth commands...');
}
void loop() {
// Read from Bluetooth Module
if (BTSerial.available()) {
incomingByte = BTSerial.read();
Serial.print('Received: ');
Serial.println(incomingByte);
if (incomingByte == '1') {
digitalWrite(RELAY_PIN, HIGH);
BTSerial.println('Relay ON');
}
else if (incomingByte == '0') {
digitalWrite(RELAY_PIN, LOW);
BTSerial.println('Relay OFF');
}
}
// Read from USB Serial Monitor (for manual testing)
if (Serial.available()) {
BTSerial.write(Serial.read());
}
}
Configuring the HC-05 via AT Commands
Out of the box, the HC-05 is named 'HC-05' with a default PIN of '1234' or '0000'. For a professional deployment, you should rename it and verify the baud rate. To enter AT Command Mode, you must manipulate the KEY pin.
Entering AT Mode (The Power-On Sequence)
- Disconnect the HC-05 VCC (power).
- Connect the HC-05 KEY pin to 3.3V (or use the onboard tactile button by holding it down).
- Reconnect VCC to 5V while holding the KEY pin/button HIGH.
- The onboard LED will now blink slowly (approx. 1 blink every 2 seconds), indicating AT mode.
- Open Arduino IDE Serial Monitor, set baud rate to 9600 (some older firmware uses 38400, but modern 2026 clones default to 9600 for AT), and set line endings to Both NL & CR.
| AT Command | Expected Response | Purpose |
|---|---|---|
AT | OK | Verify AT mode communication. |
AT+NAME=FluxCtrl_01 | OK | Change Bluetooth broadcast name. |
AT+UART? | +UART:9600,0,0 | Check current data-mode baud rate. |
AT+PSWD? | +PSWD:1234 | Check current pairing PIN code. |
As outlined in the Bluetooth Core Specification, classic BR/EDR modules like the HC-05 rely on the Serial Port Profile (SPP), which maps directly to standard UART serial data streams, making this AT configuration universally compatible with legacy and modern mobile OS environments.
Testing with a Smartphone
To test the wireless relay without writing a custom mobile app, download Serial Bluetooth Terminal (by Kai Morich) on Android, or LightBlue on iOS (note: iOS restricts classic Bluetooth SPP; if using iOS, you must upgrade to an HM-10 BLE module instead of the HC-05).
- Pair your phone to 'FluxCtrl_01' via the phone's native Bluetooth settings (PIN: 1234).
- Open Serial Bluetooth Terminal and connect to the device.
- Send the character
1. The relay should click ON, and the terminal will display 'Relay ON'. - Send the character
0. The relay will disengage.
Real-World Troubleshooting Matrix
When working with RF modules, environmental and electrical noise frequently cause edge-case failures. Use this matrix to diagnose anomalous behavior.
| Symptom | Root Cause | Engineering Fix |
|---|---|---|
| HC-05 LED blinks rapidly (2Hz+) | Module is powered but unpaired. | Normal behavior. Initiate pairing from the smartphone. |
| Serial Monitor prints garbage characters (e.g., '???') | Baud rate mismatch between Nano and HC-05 data mode. | Enter AT mode and enforce AT+UART=9600,0,0. |
| Smartphone pairs, but instantly disconnects | Insufficient current on the 5V rail causing brownout resets during RF transmission. | Add a 470µF decoupling capacitor across HC-05 VCC and GND. |
| Relay chatters or triggers randomly | EMI from the Bluetooth module coupling into the high-impedance D8 pin. | Add a 10kΩ pull-down resistor between D8 and GND. |
By respecting the 3.3V logic limits and properly configuring the UART parameters, your Arduino Nano Bluetooth setup will yield a robust, low-latency wireless controller suitable for home automation, robotics, and industrial telemetry prototyping.






