Skip to content

Smartphone-Controlled Robot Car

Build a 4WD robot car controlled by Android smartphone using Arduino, Bluetooth, and motor drivers.

  • Arduino
  • Intermediate
  • 120 minutes
  • 6 steps

Shop this project

Cart

Prices from vilros.com. Tax and shipping at checkout.

Before you start, you'll need

  • Arduino Uno
  • 4WD smart robot car chassis kit
  • 2× motor driver modules (L298N)
  • Bluetooth module (HC-06)
  • 4 LED lights
  • 4× 220Ω resistors
  • Buzzer
  • 2× lithium ion batteries
  • Soldering iron

Build the car chassis

About 30 minutes

Assemble the 4WD robot car kit.

  1. Follow the kit instructions to assemble the chassis.
  2. Mount the 4 DC motors to the chassis.
  3. Attach the 4 wheels to the motor shafts.
  4. Secure the battery holder to the chassis.
  5. Mount the Arduino and motor drivers on top of the chassis.

You should see

The car chassis is fully assembled with motors and wheels.

Connect motor drivers

About 25 minutes

Wire motors to L298N drivers.

  1. Connect left motors (front+rear) to motor driver #1.
  2. Connect right motors (front+rear) to motor driver #2.
  3. Wire motor driver #1: IN1→Pin 5, IN2→Pin 6, IN3→Pin 9, IN4→Pin 10, ENA→Pin 3, ENB→Pin 11.
  4. Wire motor driver #2 similarly to pins 2, 4, 7, 8.
  5. Connect both drivers' VCC to battery positive, GND to battery negative.
  6. Connect both drivers' 5V out to Arduino 5V (powers the Arduino).

You should see

All motors are wired to drivers and power.

Add LED lights and buzzer

About 15 minutes

Wire headlights, tail lights, and horn.

  1. Connect 2 front LEDs (headlights) with 220Ω resistors to Pin 12 and GND.
  2. Connect 2 rear LEDs (tail lights) with resistors to Pin 13 and GND.
  3. Connect buzzer positive to Pin A0, negative to GND.
  4. Use red LEDs for tail lights, white for headlights.

You should see

LEDs and buzzer are wired.

Wire the Bluetooth module

About 10 minutes

Add HC-06 for smartphone control.

  1. Connect HC-06 VCC to Arduino 5V.
  2. Connect HC-06 GND to Arduino GND.
  3. Connect HC-06 TX to Arduino RX (Pin 0).
  4. Connect HC-06 RX to Arduino TX (Pin 1).
  5. Note: disconnect Bluetooth before uploading code.

You should see

Bluetooth module is connected.

Program the robot car

About 20 minutes

Upload car control sketch.

  1. Disconnect Bluetooth module (pins 0 and 1).
  2. Open Arduino IDE and upload the control sketch.
  3. The car responds to serial commands: F=forward, B=backward, L=left, R=right, S=stop, H=horn, W=lights.
  4. After upload, reconnect Bluetooth module.
cpp
const int motor1A = 5;
const int motor1B = 6;
const int motor2A = 9;
const int motor2B = 10;
const int enableA = 3;
const int enableB = 11;

const int headlights = 12;
const int taillights = 13;
const int horn = A0;

int speed = 200;

void setup() {
  pinMode(motor1A, OUTPUT);
  pinMode(motor1B, OUTPUT);
  pinMode(motor2A, OUTPUT);
  pinMode(motor2B, OUTPUT);
  pinMode(enableA, OUTPUT);
  pinMode(enableB, OUTPUT);
  pinMode(headlights, OUTPUT);
  pinMode(taillights, OUTPUT);
  pinMode(horn, OUTPUT);
  
  Serial.begin(9600);
}

void loop() {
  if (Serial.available() > 0) {
    char command = Serial.read();
    
    switch(command) {
      case 'F':
        forward();
        break;
      case 'B':
        backward();
        break;
      case 'L':
        left();
        break;
      case 'R':
        right();
        break;
      case 'S':
        stop();
        break;
      case 'W':
        digitalWrite(headlights, !digitalRead(headlights));
        break;
      case 'H':
        tone(horn, 1000, 200);
        break;
    }
  }
}

void forward() {
  analogWrite(enableA, speed);
  analogWrite(enableB, speed);
  digitalWrite(motor1A, HIGH);
  digitalWrite(motor1B, LOW);
  digitalWrite(motor2A, HIGH);
  digitalWrite(motor2B, LOW);
}

void backward() {
  analogWrite(enableA, speed);
  analogWrite(enableB, speed);
  digitalWrite(motor1A, LOW);
  digitalWrite(motor1B, HIGH);
  digitalWrite(motor2A, LOW);
  digitalWrite(motor2B, HIGH);
}

void left() {
  analogWrite(enableA, speed);
  analogWrite(enableB, speed);
  digitalWrite(motor1A, LOW);
  digitalWrite(motor1B, HIGH);
  digitalWrite(motor2A, HIGH);
  digitalWrite(motor2B, LOW);
}

void right() {
  analogWrite(enableA, speed);
  analogWrite(enableB, speed);
  digitalWrite(motor1A, HIGH);
  digitalWrite(motor1B, LOW);
  digitalWrite(motor2A, LOW);
  digitalWrite(motor2B, HIGH);
}

void stop() {
  analogWrite(enableA, 0);
  analogWrite(enableB, 0);
}

Adjust speed variable (0-255) to control car velocity.

You should see

Code uploads successfully. Reconnect Bluetooth.

Connect with Android app

About 10 minutes

Set up smartphone control.

  1. Download 'Arduino Bluetooth RC Car' app from Google Play.
  2. Turn on Bluetooth on your phone.
  3. Pair with HC-06 (PIN: 0000 or 1234).
  4. Open the app and connect to HC-06.
  5. Test controls: forward, backward, left, right, lights, horn.

You should see

The car responds to commands from your smartphone.

It didn't work
  • Car doesn't move.

    Check battery charge. Verify motor driver connections. Ensure Bluetooth is paired and connected in the app.

  • Car moves in wrong direction.

    Swap motor wire connections (motor1A ↔ motor1B) to reverse direction.

What to do next

Stuck? Contact Vilros Support with your board model and what you see on screen.