Voice-Controlled Robot Car Using Bluetooth (Arduino + HC-05)


Transform your robot car into a voice-controlled vehicle using Arduino, an HC-05 Bluetooth module, and a smartphone app. This method is simple, cost-effective, and perfect for beginners!
1. Components Needed
Arduino Uno/Nano (or any Arduino board)
HC-05 Bluetooth Module
L298N Motor Driver (for DC motors)
Robot Car Chassis (with 2x DC motors & wheels)
Battery Pack (6V–12V for motors)
Smartphone (Android/iOS with a voice control app)
2. Wiring Diagram
HC-05 Bluetooth Module Connections
HC-05 Pin | Arduino Pin | Notes |
VCC | 5V | Power (use 3.3V if HC-05 is 3.3V logic) |
GND | GND | Common ground |
TXD | RX (Pin 0) | Arduino receives data |
RXD | TX (Pin 1) | Arduino sends data |
⚠️ Warning: If using a 3.3V HC-05, add a voltage divider (1kΩ + 2kΩ resistors) on RX to avoid damaging the module!
L298N Motor Connections
(Refer to the previous robot car guide for wiring.)
3. Arduino Code (Bluetooth Voice Control)
cpp
#include <SoftwareSerial.h>
SoftwareSerial BT(0, 1); // RX (Pin 0), TX (Pin 1)
// Motor control pins (L298N)
const int ENA = 9; // Left motor speed (PWM)
const int IN1 = 8; // Left motor direction
const int IN2 = 7;
const int ENB = 10; // Right motor speed (PWM)
const int IN3 = 6; // Right motor direction
const int IN4 = 5;
void setup() {
BT.begin(9600); // Start Bluetooth communication
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENB, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void loop() {
if (BT.available()) { // Check if data is received
char command = BT.read(); // Read the command
switch(command) {
case 'F': // "Forward"
moveForward(200); // Move forward at speed 200
break;
case 'B': // "Backward"
moveBackward(200);
break;
case 'L': // "Left"
turnLeft(150);
break;
case 'R': // "Right"
turnRight(150);
break;
case 'S': // "Stop"
stopMotors();
break;
}
}
}
// Motor control functions
void moveForward(int speed) {
analogWrite(ENA, speed);
analogWrite(ENB, speed);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
void moveBackward(int speed) {
analogWrite(ENA, speed);
analogWrite(ENB, speed);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
void turnLeft(int speed) {
analogWrite(ENA, speed);
analogWrite(ENB, speed);
digitalWrite(IN1, LOW);
digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH);
digitalWrite(IN4, LOW);
}
void turnRight(int speed) {
analogWrite(ENA, speed);
analogWrite(ENB, speed);
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, HIGH);
}
void stopMotors() {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW);
digitalWrite(IN4, LOW);
}
4. Smartphone App Setup
Recommended Apps:
"Voice BT Arduino" (Android) – Simple voice-to-command app.
"Arduino Bluetooth Controller" (Android/iOS) – Customizable buttons & voice control.
How to Configure the App:
Pair HC-05 with your phone (default PIN:
1234
or0000
).Open the app and connect to the HC-05 module.
Assign voice commands to send single letters:
- Example: Say “Forward” → App sends
'F'
to Arduino.
- Example: Say “Forward” → App sends
5. How It Works
You speak a command (e.g., “Turn left”).
The app converts speech to text and sends
'L'
via Bluetooth.Arduino receives
'L'
and executesturnLeft(150)
.The robot car responds instantly!
6. Troubleshooting
Problem | Solution |
HC-05 not connecting | Check pairing PIN, power supply, and baud rate (9600 ). |
Motors not moving | Verify L298N power supply and Arduino code. |
Voice commands not working | Ensure the app is sending the correct characters (F , B , etc.). |
7. Upgrades & Next Steps
Add obstacle avoidance (Ultrasonic sensor + auto-stop).
Use an ESP32 for Wi-Fi/Google Assistant/Alexa control.
Implement a joystick app for manual driving.
Final Thoughts
This Bluetooth voice control method is the easiest way to make your robot car hands-free!
Subscribe to my newsletter
Read articles from ampheo directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
