Configuration 1: Bluetooth Rover
Control the robot from a phone using HC-05 and Arduino Nano serial commands.
The Bluetooth rover lets students control the robot from a phone. HC-05 receives one-letter commands and Arduino Nano turns those commands into motor movement.
Mode-specific circuit schematic
Pin and power rules
Use the Li-ion pack for motor power through L293D VCC2, and regulated 5V for Arduino Nano logic and modules.
All grounds must be common, otherwise the Arduino signal has no reliable reference.
The Arduino programs on this page match this pin plan: D5/D6 PWM, D8-D11 motor direction, D2-D3 Bluetooth, D4/D7 ultrasonic, D12 servo, A0-A5 sensors/RF.
Step-by-step build
- Mount BO motors and wheels on the chassis.
- Wire L293D to Arduino Nano pins D5, D6, D8, D9, D10, and D11.
- Connect HC-05 TX to Nano D2 and HC-05 RX to Nano D3 through a voltage divider.
- Pair phone with HC-05 and send F, B, L, R, S.
- Test slowly, then increase speed.
Arduino Nano program
// Arduino Nano + HC-05 + L293D Bluetooth Rover
// Phone app sends: F, B, L, R, S
#include <SoftwareSerial.h>
SoftwareSerial BT(2, 3); // HC-05 TX -> D2, HC-05 RX <- D3 through divider
const int ENA = 5, IN1 = 8, IN2 = 9;
const int ENB = 6, IN3 = 10, IN4 = 11;
int speedValue = 160;
void setup() {
pinMode(ENA, OUTPUT); pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT);
pinMode(ENB, OUTPUT); pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT);
BT.begin(9600);
stopMotors();
}
void loop() {
if (BT.available()) {
char c = BT.read();
if (c == 'F') forward(speedValue);
if (c == 'B') backward(speedValue);
if (c == 'L') left(speedValue);
if (c == 'R') right(speedValue);
if (c == 'S') stopMotors();
}
}
void forward(int s){ drive(HIGH, LOW, HIGH, LOW, s); }
void backward(int s){ drive(LOW, HIGH, LOW, HIGH, s); }
void left(int s){ drive(LOW, HIGH, HIGH, LOW, s); }
void right(int s){ drive(HIGH, LOW, LOW, HIGH, s); }
void stopMotors(){ analogWrite(ENA, 0); analogWrite(ENB, 0); }
void drive(int a1,int a2,int b1,int b2,int s){
digitalWrite(IN1,a1); digitalWrite(IN2,a2);
digitalWrite(IN3,b1); digitalWrite(IN4,b2);
analogWrite(ENA,s); analogWrite(ENB,s);
}Do and don't
- Use Arduino Nano as the controller.
- Keep battery negative and all module GND pins connected.
- Test motors with wheels lifted first.
- Use a voltage divider for HC-05 RX if Arduino TX is 5 V.
- Power servo from a stable 5 V source.
- Do not short Li-ion cells.
- Do not connect motors directly to Arduino Nano pins.
- Do not mix loose wires without labels.
- Do not run high motor speed during first tests.
- Do not assume every RF module has the same pinout.