Bluetooth-Controlled 2-Wheel Arduino Car

Let’s build your Bluetooth-controlled 2-wheel Arduino car using a caster wheel for front balance.
Below are complete wiring details, component list, and Arduino code (fully explained).

Components Required

ComponentQuantityDescription
Arduino UNO1Main microcontroller
L298N / HW-130 Motor Driver1To drive two DC motors
HC-05 Bluetooth Module1To receive commands from phone
DC Motors (with wheels)2For rear wheel drive
Caster wheel1For front balance
Battery (7.4V–12V)1Power source
Jumper wiresConnections

Wiring Connections

Motor Driver L298N

L298N PinConnects ToDescription
IN1Arduino pin 4Motor A control 1
IN2Arduino pin 5Motor A control 2
IN3Arduino pin 6Motor B control 1
IN4Arduino pin 7Motor B control 2
ENAArduino pin 10 (PWM)Speed control for left motor
ENBArduino pin 11 (PWM)Speed control for right motor
OUT1, OUT2Left motor terminalsMotor A output
OUT3, OUT4Right motor terminalsMotor B output
+12VBattery +Power input
GNDBattery – & Arduino GNDCommon ground
5VArduino 5V To power Arduino

Bluetooth Module (HC-05)

HC-05 PinConnects ToDescription
VCC5V on ArduinoPower
GNDGNDCommon ground
TXArduino A1 (Software RX)Bluetooth TX → Arduino RX
RXArduino A0 (Software TX)Bluetooth RX → Arduino TX (Use voltage divider if needed)

Android App

Use any Bluetooth Controller App (e.g., “Bluetooth RC Controller” or “Arduino Bluetooth Controller” from Play Store).
Assign these characters for movement:

  • ‘F’ → Forward
  • ‘B’ → Backward
  • ‘L’ → Left
  • ‘R’ → Right
  • ‘S’ → Stop

Arduino Code

Upload this to your Arduino UNO:

#include <SoftwareSerial.h>

SoftwareSerial BT(A1, A0); // RX | TX

#define ENA 10
#define ENB 11
#define IN1 4
#define IN2 5
#define IN3 6
#define IN4 7

char command;

void setup() {
  Serial.begin(9600);
  BT.begin(9600);

  pinMode(ENA, OUTPUT);
  pinMode(ENB, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);

  analogWrite(ENA, 200);  // Set initial motor speed (0–255)
  analogWrite(ENB, 200);

  Serial.println("Bluetooth Car Ready. Waiting for commands...");
}

void loop() {
  if (BT.available()) {
    command = BT.read();
    Serial.println(command);

    switch (command) {
      case 'F': forward(); break;
      case 'B': backward(); break;
      case 'L': left(); break;
      case 'R': right(); break;
      case 'S': stopCar(); break;
      default: stopCar(); break;
    }
  }
}

void forward() {
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
}

void backward() {
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
}

void left() {
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
}

void right() {
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
}

void stopCar() {
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, LOW);
}

Powering Tips

  • If using 9V battery, ensure it can supply enough current (better use Li-ion 18650 pack).
  • Connect battery + to motor driver +12V and Arduino VIN if using same battery.
  • Always share common GND between Arduino, motor driver, and Bluetooth module.

Working Summary

  1. Pair your phone with HC-05 (default password: 1234 or 0000).
  2. Open the app and connect to HC-05.
  3. Press control buttons → car moves accordingly:
    • F → both wheels forward
    • B → both wheels reverse
    • L → left motor stops, right runs → turn left
    • R → right motor stops, left runs → turn right
    • S → all motors stop