Arduino UNO Bluetooth Controlled 4WD Robot Car
Build a wireless smartphone-controlled robot car using Arduino UNO, HC-05 Bluetooth, and L298N dual H-bridge motor driver — complete with circuit diagram, full code, and simulation link.
Project Overview
The Arduino UNO Bluetooth Controlled 4WD Robot Car is a beginner-friendly project where a smartphone sends single-character commands via Bluetooth to the Arduino, which drives four DC motors through the L298N H-bridge motor driver — enabling forward, backward, left, right and stop.
- UART / Serial communication
- H-bridge motor direction control
- Bluetooth wireless pairing
- Multi-motor synchronisation
- Arduino IDE installed
- Basic wiring knowledge
- Android phone (Bluetooth)
- USB-A to USB-B cable
Components Needed
Pin Connections
| Arduino Pin | Connects To | Description |
|---|---|---|
| D13 | L298N IN1 | Left channel — Forward |
| D12 | L298N IN2 | Left channel — Reverse |
| D11 | L298N IN3 | Right channel — Forward |
| D10 | L298N IN4 | Right channel — Reverse |
| D9 | LED Anode (via 220Ω) | Status indicator |
| D0 RX | HC-05 TX | Bluetooth receive |
| D1 TX | HC-05 RX (via divider) | Bluetooth transmit |
| 5V | HC-05 VCC | Module power |
| GND | HC-05 GND, L298N GND, Battery − | Common ground |
Circuit Diagram
Step-by-Step Build Guide
IN1→ ArduinoD13IN2→ ArduinoD12IN3→ ArduinoD11IN4→ ArduinoD10OUT-A→ Left motors (FL + BL)OUT-B→ Right motors (FR + BR)VCC→ Battery pack positive (+)GND→ Battery (−) and Arduino GND
VCC→ Arduino5VGND→ ArduinoGNDTX→ ArduinoRX (D0)RX→ ArduinoTX (D1)via 1kΩ/2kΩ voltage divider
D9. Connect cathode (−) to GND. Toggle it via commands 'O' (on) and 'f' (off).- Open Arduino IDE, paste the code from Section 06
- Tools → Board → Arduino UNO
- Tools → Port → select your COM port
- Disconnect HC-05 TX/RX wires temporarily
- Click Upload (→) — wait for "Done uploading"
- Reconnect HC-05 wires after upload
- Power on the robot (battery + USB/Vin)
- Android: Settings → Bluetooth → Scan
- Pair with HC-05 — default PIN:
1234or0000 - Install Serial Bluetooth Terminal app
- Connect to HC-05 and send:
F,B,L,R,S
Arduino Sketch
/* * Arduino UNO Bluetooth Controlled 4WD Robot Car * HC-05 Bluetooth + L298N Motor Driver * MakeMindz.com * * Commands: F = Forward B = Backward * L = Left R = Right * S = Stop O = LED ON f = LED OFF */ // Pin Definitions const int motorPin1 = 13; // IN1 — Left Forward const int motorPin2 = 12; // IN2 — Left Reverse const int motorPin3 = 11; // IN3 — Right Forward const int motorPin4 = 10; // IN4 — Right Reverse const int ledPin = 9; // Status LED void setup() { Serial.begin(9600); pinMode(motorPin1, OUTPUT); pinMode(motorPin2, OUTPUT); pinMode(motorPin3, OUTPUT); pinMode(motorPin4, OUTPUT); pinMode(ledPin, OUTPUT); stopMotors(); digitalWrite(ledPin, LOW); } void loop() { if (Serial.available() > 0) { char cmd = Serial.read(); switch (cmd) { case 'F': moveForward(); break; case 'B': moveBackward(); break; case 'L': turnLeft(); break; case 'R': turnRight(); break; case 'S': stopMotors(); break; case 'O': digitalWrite(ledPin, HIGH); break; case 'f': digitalWrite(ledPin, LOW); break; default: break; } } } void moveForward() { digitalWrite(motorPin1, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin4, LOW); } void moveBackward() { digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); } void turnLeft() { digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, HIGH); // Left backward digitalWrite(motorPin3, HIGH); // Right forward digitalWrite(motorPin4, LOW); } void turnRight() { digitalWrite(motorPin1, HIGH); // Left forward digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, HIGH); // Right backward } void stopMotors() { digitalWrite(motorPin1, LOW); digitalWrite(motorPin2, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin4, LOW); }
Bluetooth Commands
Send these single characters from any Bluetooth terminal app. Set the newline mode to None so only the character is transmitted.
| Command | Action | Left Motors | Right Motors |
|---|---|---|---|
| F | Forward | ↑ Forward | ↑ Forward |
| B | Backward | ↓ Reverse | ↓ Reverse |
| L | Turn Left | ↓ Reverse | ↑ Forward |
| R | Turn Right | ↑ Forward | ↓ Reverse |
| S | Stop | ■ Off | ■ Off |
| O | LED ON | Status LED turns ON | |
| f | LED OFF | Status LED turns OFF | |
Concepts Demonstrated
HC-05 sends characters to Arduino's hardware serial at 9600 baud.
L298N drives motors bidirectionally using IN1–IN4 logic inputs.
Reversing HIGH/LOW on IN pins reverses motor rotation direction.
HC-05 presents as a virtual COM port via Serial Port Profile.
Tank-style steering via two independent L298N motor channels.
Motor actions separated into helper functions for clean, extensible code.
Run the Simulation
🔬 Test before you build!
Simulate this exact circuit in CirkitDesigner — wire components virtually, run the code, and verify motor logic before soldering anything.
Future Upgrades
Once you've built the base robot, these additions can turn it into an advanced autonomous platform:
Comments
Post a Comment