TheSolderBenchnotes from my electronics bench

Log #48 · Oct 3, 2026

Build a Bluetooth-Controlled Robot Car (HC-05)

A complete build of a two-wheel robot car you drive from an Android phone, with parts list, safe HC-05 wiring, motor driver connections and full Arduino code.

Projects · 4 min read · Intermediate

Driving a robot from your phone is one of the most satisfying first projects: within an afternoon you have a little car that zips around the floor on command. This build uses a common two-wheel chassis, an L298N or TB6612 motor driver and an HC-05 Bluetooth module. It shares most of its hardware with the obstacle-avoiding robot, so you can later combine the two.

How it works

The HC-05 is a Bluetooth "serial port". Your phone pairs with it, and anything an app sends arrives at the Arduino as characters on a serial line, exactly as if you had typed them into the Serial Monitor. The sketch reads single letters (F for forward, L for left, and so on) and sets the motors accordingly.

The HC-05 uses classic Bluetooth, which Android phones support with any "Bluetooth serial" or "Bluetooth RC controller" app. iPhones do not support this type of serial connection; for iOS you need a BLE module such as the HM-10 and a BLE terminal app instead.

Parts list

Part Notes
Arduino Uno or Nano Any 5 V Arduino works
HC-05 Bluetooth module HC-06 also works (slave only)
L298N or TB6612FNG motor driver TB6612 is more efficient
2WD chassis with two TT gear motors and a caster See the chassis guide
2 × 18650 cells in a holder (7.4 V) Or 6 × AA NiMH
1 kΩ and 2 kΩ resistors Voltage divider for the HC-05 RX pin
Switch, jumper wires, small breadboard

Wiring

Wiring diagram: HC-05 TX to Arduino pin 2, Arduino pin 3 through a 1k and 2k voltage divider to HC-05 RX, motor driver enable and direction pins to Arduino pins 5 to 10, battery pack to the motor driver and Arduino VIN through a switch
The only tricky part is the voltage divider on the HC-05's RX line.

HC-05 to Arduino

HC-05 pin Connect to
VCC 5 V (the module has its own 3.3 V regulator)
GND GND
TXD Arduino pin 2 (SoftwareSerial RX)
RXD Arduino pin 3 through a voltage divider: pin 3 → 1 kΩ → HC-05 RXD → 2 kΩ → GND

The HC-05's data pins work at 3.3 V. Its TX output is high enough for the Arduino to read directly, but the Arduino's 5 V TX signal can stress the HC-05's RX pin over time. The two resistors drop 5 V to about 3.3 V. If you do not have a 2 kΩ, two 1 kΩ in series work.

We use pins 2 and 3 with SoftwareSerial instead of the hardware pins 0 and 1, so you can still upload sketches and print debug messages over USB without unplugging the module.

Motor driver to Arduino

Driver pin Arduino pin
ENA (left PWM) 5
IN1 / IN2 7 / 8
ENB (right PWM) 6
IN3 / IN4 9 / 10

Remove the jumpers on ENA and ENB on an L298N so the Arduino can control speed. For a TB6612, connect PWMA/PWMB to 5/6, the AIN/BIN pins to 7–10 and STBY to 5 V. The full comparison is in motor drivers: L298N vs TB6612.

Power

  • Battery + → switch → motor driver VS (12 V terminal on an L298N) and Arduino VIN
  • Battery − → driver GND and Arduino GND (all grounds connected together)

Keeping the motor supply on the battery side and powering the Arduino through VIN avoids most brown-out resets. More on that in how to power an Arduino project.

The code

#include <SoftwareSerial.h>

SoftwareSerial bt(2, 3);           // RX, TX  (HC-05 TXD -> 2, RXD <- 3)

const int ENA = 5, IN1 = 7, IN2 = 8;   // left motor
const int ENB = 6, IN3 = 9, IN4 = 10;  // right motor

int speed = 180;                       // 0-255
const unsigned long TIMEOUT_MS = 0;    // set to 500 if your app repeats commands
unsigned long lastCmd = 0;

void motors(int left, int right) {
  digitalWrite(IN1, left > 0);  digitalWrite(IN2, left < 0);
  digitalWrite(IN3, right > 0); digitalWrite(IN4, right < 0);
  analogWrite(ENA, abs(left));
  analogWrite(ENB, abs(right));
}

void setup() {
  int pins[] = {ENA, IN1, IN2, ENB, IN3, IN4};
  for (int p : pins) pinMode(p, OUTPUT);
  motors(0, 0);
  Serial.begin(9600);
  bt.begin(9600);                      // HC-05 default data baud rate
  Serial.println("Ready. Pair your phone with HC-05 (PIN 1234 or 0000).");
}

void loop() {
  if (bt.available()) {
    char c = bt.read();
    lastCmd = millis();
    Serial.println(c);                 // see commands in the Serial Monitor

    switch (c) {
      case 'F': motors(speed, speed);          break;
      case 'B': motors(-speed, -speed);        break;
      case 'L': motors(-speed / 2, speed / 2); break;   // spin left
      case 'R': motors(speed / 2, -speed / 2); break;   // spin right
      case 'G': motors(speed / 3, speed);      break;   // forward-left arc
      case 'I': motors(speed, speed / 3);      break;   // forward-right arc
      case 'S': motors(0, 0);                  break;
      default:
        if (c >= '0' && c <= '9') speed = map(c - '0', 0, 9, 90, 255);
    }
  }

  if (TIMEOUT_MS && millis() - lastCmd > TIMEOUT_MS) {
    motors(0, 0);                      // failsafe: stop if commands stop
  }
}

The arc commands use the idea explained in how two-wheel robots turn: one wheel faster than the other.

Connecting your phone

  1. Power the car. The HC-05 LED blinks fast, meaning it is waiting for a connection.
  2. On the phone, open Bluetooth settings, pair with HC-05 and enter 1234 (or 0000).
  3. Open a Bluetooth serial or RC controller app, select HC-05 and connect. The LED changes to slow double blinks.
  4. Configure the buttons to send F, B, L, R and S (many RC controller apps already use these letters).

If your app keeps sending the same letter while you hold a button, set TIMEOUT_MS to 500. The car will then stop by itself if the connection drops, which is a good safety habit.

Testing step by step

  • Lift the car so the wheels spin freely the first time.
  • Send F. If a wheel runs backward, swap that motor's two wires at the driver.
  • If L turns right, swap the left and right motor connections (or swap the letters in code).
  • Keep the USB cable connected and open the Serial Monitor: each letter the car receives is printed, which confirms the Bluetooth link works.

Troubleshooting

  • Pairs but no response: TXD and RXD crossed wrong. HC-05 TXD goes to Arduino pin 2.
  • Garbage characters: baud rate mismatch. Most modules ship at 9600 in data mode; some are set to 38400.
  • Car resets when it starts moving: the battery is too weak or the grounds are not shared. Use fresh cells and keep wiring short.
  • One motor weaker: normal; motors differ. Lower the faster side's PWM a little, or add wheel encoders to correct it automatically.

Next steps

Add an HC-SR04 at the front and refuse forward commands when something is closer than 15 cm, borrowing the code from the obstacle-avoiding robot. Or add a buzzer and LEDs controlled by extra letters for horn and headlights.

— TheSolderBench · found a mistake? tell me

More pages from this notebook

Build an Obstacle-Avoiding Robot

A complete build with parts list, wiring table and full Arduino code for a two-wheel robot that scans with an ultrasonic sensor and steers around obstacles.

→ misses chair legs, raise STOP_CM

Automatic Plant Watering System

Build a soil-moisture-controlled watering system with a capacitive sensor, a relay or MOSFET, a small pump and Arduino code with safety limits.

→ limit waterings per day!

Digital Thermometer with an OLED Display

Build a waterproof digital thermometer with a DS18B20 probe and a 0.96 inch SSD1306 OLED, showing live temperature plus the minimum and maximum.

→ blank screen? try address 0x3D

Build a Reaction-Time Game

A two-button Arduino game that waits a random time, lights an LED and measures who reacts first in milliseconds, with anti-cheat and a buzzer.

→ use millis(), and catch early presses