The Arduino robot car kit is one of the most popular beginner projects that teaches motor control, sensor integration, and basic programming all at once. Whether you are building for a college project, robotics competition, or just for fun, this guide covers assembly, wiring, and code for multiple operating modes including Bluetooth control, obstacle avoidance, and line following.
Table of Contents
- Kit Components
- Chassis Assembly
- Motor Driver Wiring
- Basic Movement Code
- Bluetooth Remote Control
- Obstacle Avoidance Mode
- Line Following Mode
- Frequently Asked Questions
- Conclusion
Kit Components
A standard Arduino robot car kit includes:
- Arduino Uno or Nano: The brain of the robot
- L298N or L293D motor driver: Controls motor speed and direction
- 2 or 4 DC gear motors: 3-6V with plastic wheels
- Robot chassis: Acrylic or aluminium platform with mounting holes
- HC-SR04 ultrasonic sensor: For obstacle detection
- IR sensor modules: For line following
- HC-05 Bluetooth module: For smartphone control
- Battery holder: 4xAA or 2x 18650 lithium cells
- Jumper wires and breadboard: For connections
Chassis Assembly
Assemble the chassis in this order:
- Mount the DC motors to the lower chassis plate using the included brackets and screws
- Attach the wheels to the motor shafts — push firmly until they click into place
- Install the caster wheel (front) for 2-wheel drive, or mount all four motors for 4WD
- Mount the battery holder on the bottom plate
- Secure the Arduino and motor driver on the top plate using standoffs
- Mount the ultrasonic sensor on the front, ideally on a servo for scanning
Motor Driver Wiring
The L298N motor driver is the most common choice. Here is the wiring:
- Motor A (left): Connect to OUT1 and OUT2 on the L298N
- Motor B (right): Connect to OUT3 and OUT4
- Power: Battery positive to VIN (up to 12V), negative to GND
- Arduino connections:
- IN1 → Arduino D5
- IN2 → Arduino D6
- IN3 → Arduino D9
- IN4 → Arduino D10
- ENA → Arduino D3 (PWM for left motor speed)
- ENB → Arduino D11 (PWM for right motor speed)
- 5V output: The L298N’s onboard regulator can power the Arduino via the 5V pin
Basic Movement Code
Start with simple movement functions before adding sensors:
// Motor pins
#define IN1 5
#define IN2 6
#define IN3 9
#define IN4 10
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT);
pinMode(IN4, OUTPUT);
}
void moveForward() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}
void turnLeft() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}
void stopMotors() {
digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, LOW);
}
void loop() {
moveForward();
delay(2000);
turnLeft();
delay(500);
stopMotors();
delay(1000);
}
Upload this code to test that both motors spin correctly. If a motor runs backwards, swap the two wires on the motor driver output.
Bluetooth Remote Control
Add the HC-05 Bluetooth module for smartphone control:
- Connect HC-05 TX to Arduino RX (pin 0) and RX to Arduino TX (pin 1) through a voltage divider
- Power the HC-05 from the Arduino 5V pin
- Install a Bluetooth controller app (Arduino Bluetooth Controller or Dabble) on your Android phone
- Pair your phone with the HC-05 (default PIN: 1234)
- Read characters from Serial and map them to movement commands
Obstacle Avoidance Mode
The HC-SR04 ultrasonic sensor detects obstacles and steers around them:
- Mount the sensor on the front of the robot
- Connect TRIG to pin 7 and ECHO to pin 8
- Continuously measure distance. If an object is closer than 20cm, stop and turn
- For smarter avoidance, mount the sensor on a servo to scan left and right, then turn towards the clearest path
Line Following Mode
IR sensor modules detect the difference between black lines and white surfaces:
- Mount 2-3 IR sensors on the front underside of the chassis, 1-2cm above the ground
- When the left sensor detects the line (LOW signal), turn left
- When the right sensor detects the line, turn right
- When both sensors see white, go straight
- When both sensors see black, stop (intersection or end of line)
Frequently Asked Questions
What is the best motor driver for Arduino robot car?
The L298N handles up to 2A per channel and is the most popular choice. For higher current motors, the BTS7960 handles 43A. The L293D shield is convenient but limited to 600mA per channel.
How fast does an Arduino robot car go?
With standard 3-6V gear motors, expect speeds of 0.5-1.5 km/h. This is intentionally slow for indoor use and learning. Higher voltage motors and larger wheels increase speed.
Can I add a camera to the robot car?
Yes, mount an ESP32-CAM for a live video feed controlled via WiFi. This turns the robot car into an FPV exploration vehicle.
What battery should I use?
4x AA alkaline batteries (6V) work for basic testing. For longer runtime, use 2x 18650 lithium cells (7.4V) with a battery holder and protection circuit.
Conclusion
The Arduino robot car is a gateway project that teaches fundamental electronics and programming concepts through hands-on building. Start with basic movement, add Bluetooth control, then progress to autonomous modes with obstacle avoidance and line following. Each mode builds on the previous one, giving you a structured learning path.
Get started with our Arduino boards and accessories today.
Add comment