Arduino Robot Projects: 15 Robots from Easy to Hard with Parts
Arduino robot projects: line follower, obstacle avoider, Bluetooth car, sumo, self-balancing, Otto and robot arm. Parts-cost table, code, ESP32 Wi-Fi.
Arduino robot projects are the most fun way to learn electronics, mechanics and programming at the same time: you see the result of your code in a body moving across the table. In this guide you'll find 15 robot projects ordered from beginner to advanced: classics like the line follower, obstacle avoider, Bluetooth car, sumo, self-balancing robot, Otto and robot arm, plus ESP32 models controlled over Wi-Fi.
For every robot we've gathered the chassis, motor, motor driver and sensor you should pick, along with an approximate cost level, in a single table. Then we cover motor and driver selection, working code for an obstacle-avoiding robot, options for controlling it from your phone with an ESP32, and the rules to watch if you want to enter a robot competition.

Where should you start with an Arduino robot project?
The best choice for your first robot is a two-wheel (2WD) chassis, two geared DC motors, an L298N or L9110S motor driver and a single sensor. Once you've built this base, you get completely different robots just by swapping the sensor: add infrared sensors underneath and it follows a line, mount an ultrasonic sensor on the front and it avoids obstacles, connect a Bluetooth module and you drive it from your phone. That's why the first five projects on the list share the same chassis and let you reuse your budget again and again. Robots with servos or balancing need more tuning and patience; it's best to move on to them once the basic car runs without problems.
The core parts of a robot
- Brain: an Arduino Uno or Nano is enough for most robots. If you need Wi-Fi, a camera or lots of PWM, an ESP32 is a better fit.
- Chassis: acrylic 2WD kits are the cheapest start; 4WD chassis grip better on rough floors, while 3D-printed bodies are for special designs like Otto and robot arms.
- Motor: wheeled robots use geared DC motors, jointed robots use servo motors, and jobs that need precise position use stepper motors.
- Motor driver: an Arduino pin can't drive a motor directly; a driver such as the L298N, L9110S or TB6612FNG controls the motor's direction and speed.
- Power: two 18650 Li-ion cells (about 7.4 V) are the most balanced solution for wheeled robots; 4 AA batteries drain quickly and leave the motors weak.
- Sensor: it determines how the robot perceives its surroundings; ultrasonic distance, infrared floor, LDR light and MPU-6050 tilt sensors are the most common choices.
Parts and cost table by robot type
Prices change constantly with the seller and exchange rates, so instead of figures we give a relative cost level. Low-cost robots can be built with most parts from a starter kit; for high-cost ones, most of the budget goes to servo motors and batteries.
| Robot | Chassis | Motor | Driver | Sensor | Cost |
|---|---|---|---|---|---|
| 1. Line follower | 2WD acrylic | 2 geared DC | L298N or L9110S | 2–5 TCRT5000 | Low |
| 2. Obstacle avoider | 2WD acrylic | 2 geared DC | L298N | HC-SR04 (optional SG90 turret) | Low |
| 3. Bluetooth car | 2WD or 4WD | 2–4 geared DC | L298N | HC-05 / HC-06 | Low – medium |
| 4. Light follower | 2WD acrylic | 2 geared DC | L9110S | 2 LDRs | Low |
| 5. Edge-detecting table robot | 2WD acrylic | 2 geared DC | L9110S | 2 downward-facing TCRT5000 | Low |
| 6. Sumo robot | Low, heavy metal or 3D-printed | 2 high-torque DC (N20 for mini sumo) | TB6612FNG or L298N | Distance sensor in front, 2 floor sensors below | Medium |
| 7. Self-balancing | Upright two-wheel body | 2 DC (with encoders) or 2 steppers | L298N or 2× A4988 | MPU-6050 | Medium |
| 8. Otto walking robot | 3D-printed | 4 SG90 servos | No driver, separate servo power | HC-SR04 | Low – medium |
| 9. Robot arm | Acrylic or 3D-printed | 4–6 servos (SG90 or MG996R) | PCA9685 (optional) | Joystick or potentiometer | Medium |
| 10. Gesture-controlled car | 2WD | 2 geared DC | L298N | MPU-6050 in hand, nRF24L01 on both sides | Medium |
| 11. ESP32 Wi-Fi car | 2WD or 4WD | 2–4 geared DC | L298N or TB6612FNG | Phone browser | Medium |
| 12. ESP32-CAM camera car | 2WD | 2 geared DC | L9110S or L298N | ESP32-CAM camera | Medium |
| 13. Gamepad-controlled car | 4WD | 4 geared DC | L298N | Bluetooth gamepad | Medium – high |
| 14. Radar scanning robot | 2WD + servo turret | 2 DC + SG90 | L298N | HC-SR04 on a servo | Low – medium |
| 15. Hexapod spider | 3D-printed or acrylic | 12–18 servos | 1–2 PCA9685 | Optional MPU-6050 | High |
Beginner robot projects (1–5)
- 1. Line follower robot: it follows a black line on a white floor with infrared sensors. Two sensors give you simple left-right logic; five sensors and PID take you to competition speed. The TCRT5000 black and white surface detection project in BlueGrays prepares the sensor side; for the full robot see the line follower robot guide.
- 2. Obstacle avoiding robot: it measures what's in front with an HC-SR04 and, when something comes closer than 20 cm, it stops, backs up and turns. The Obstacle Avoiding Robot project in the BlueGrays app includes this robot's full circuit and code, and you'll find working example code below. Details are in the obstacle avoiding robot article.
- 3. Bluetooth controlled car: an HC-05 or HC-06 module reads letters sent from a phone app and drives the motors. That's exactly the Bluetooth controlled car with L298N project in BlueGrays; we explain the build step by step in the Arduino robot car guide.
- 4. Light following robot (idea): it compares two LDRs pointing to either side and turns toward the brighter one. You can steer the robot with a flashlight. The LDR article is a good start for reading the sensors.
- 5. Table robot that doesn't fall off (idea): two downward-facing infrared sensors detect the table edge; when the floor disappears it backs up and turns. Combine it with the obstacle avoider and you have a fully autonomous table explorer.

Intermediate robot projects (6–10)
- 6. Sumo robot (idea): a low, heavy and powerful robot that tries to push its opponent out of a circular ring. A distance sensor in front finds the opponent, and floor sensors underneath see the ring's white edge. Rules and design tips are in the Arduino sumo robot article.
- 7. Self-balancing robot (idea): it stays upright on two wheels using the inverted pendulum principle. An MPU-6050 measures the tilt and a PID loop corrects the motors hundreds of times per second. It's the project on this list that needs the most tuning; read the self-balancing robot guide together with the PID control article.
- 8. Otto walking robot (idea): a small humanoid robot with a 3D-printed body and two SG90 servos in each leg. It walks, dances and avoids obstacles with its HC-SR04 eyes. You'll find servo basics in the servo motor article.
- 9. Robot arm (idea): with 4–6 servos the base rotates, the shoulder and elbow joints lift and the gripper at the end holds objects. The Servo control with joystick project in BlueGrays is the basis of the control side; assembly and calibration are in the Arduino robot arm article.
- 10. Gesture-controlled car (idea): an MPU-6050 on a glove measures your hand's tilt and an nRF24L01 sends it wirelessly to the car; tilt your hand forward and the car moves. The MPU-6050 and nRF24L01 articles cover what you need.
Advanced robot projects (11–15)
- 11. ESP32 Wi-Fi controlled car: the ESP32 opens its own Wi-Fi network and you drive the car with buttons on a page in your phone's browser; no app to install. There's working example code below, and a more advanced version in the ESP32 Wi-Fi robot car article.
- 12. ESP32-CAM camera car (idea): it streams what the car sees live to your phone and is driven from the same page. The camera module and power distribution need care; the ESP32-CAM robot car guide solves these issues.
- 13. Gamepad-controlled car (idea): thanks to the classic ESP32's Bluetooth, a game console controller gives precise driving with analog sticks. Setup is in the ESP32 and PS4 controller article.
- 14. Radar scanning robot (idea): an HC-SR04 on an SG90 servo scans 0–180 degrees, finds the most open direction and the robot turns that way. The scan data can also be drawn as a radar screen on your computer; the Arduino radar project covers that part.
- 15. Hexapod spider robot (idea): it walks on six legs with 12–18 servos and is the most impressive but most expensive robot. With that many servos you need a PCA9685 servo driver and a separate 5–6 V supply that can deliver at least 5 A. The Servo circle choreography project in BlueGrays teaches you to manage many servos at once.
Choosing motors and drivers
The motor and driver largely decide how fast, strong and precise your robot will be. For wheeled robots, yellow 3–6 V geared DC motors are the most common choice; they turn at around 100–200 RPM and give enough torque. On the driver side, the L298N is rugged and available everywhere, but it drops about 2 V, so only about 5–6 V of a 7.4 V battery reaches the motor. The TB6612FNG and L9110S lose less and extend battery life in small robots. We compared drivers in detail in the motor driver comparison.
| Motor type | Where is it used? | Suitable driver | Note |
|---|---|---|---|
| Geared DC (yellow TT motor) | 2WD/4WD cars, line followers | L298N, L9110S, TB6612FNG | Cheap and tough; two motors never turn at exactly the same speed |
| N20 micro geared DC | Mini sumo, small line followers | TB6612FNG, L9110S | Small and strong; encoder versions measure speed |
| SG90 / MG90S servo | Otto, turrets, small robot arms | None (signal from the pin) | Power must come from a separate 5 V supply |
| MG996R servo | Shoulder and elbow joints of a robot arm | PCA9685 recommended | Can exceed 1 A while moving |
| 28BYJ-48 stepper | Slow, precise positioning | ULN2003 | Too slow for a wheeled robot |
| NEMA 17 stepper | Balancing robots, drawing robots | A4988, TMC2209 | Needs a separate 12 V supply |
First code: obstacle avoiding robot
The code below runs the second robot on the list and is also the skeleton of the other wheeled robots: one function that drives the motors, one that reads the sensor and a loop that makes decisions. The connections are:
| Part pin | Arduino Uno | Role |
|---|---|---|
| L298N ENA | D5 (PWM) | Left motor speed |
| L298N IN1 / IN2 | D7 / D8 | Left motor direction |
| L298N ENB | D6 (PWM) | Right motor speed |
| L298N IN3 / IN4 | D9 / D10 | Right motor direction |
| HC-SR04 TRIG / ECHO | D12 / D11 | Distance measurement |
| L298N 12V input / GND | Battery + / battery − and Arduino GND | Motor power, common ground |
1// L298N pinleri / L298N pins
2const int ENA = 5, IN1 = 7, IN2 = 8; // sol motor / left motor
3const int ENB = 6, IN3 = 9, IN4 = 10; // sağ motor / right motor
4// HC-SR04 pinleri / HC-SR04 pins
5const int TRIG = 12, ECHO = 11;
6
7const int HIZ = 170; // 0-255 arası motor hızı / motor speed 0-255
8const int ENGEL_CM = 20; // bu mesafede dön / turn at this distance
9
10void motorlar(int sol, int sag) { // -255..255, eksi = geri / minus = reverse
11 digitalWrite(IN1, sol > 0); digitalWrite(IN2, sol < 0);
12 digitalWrite(IN3, sag > 0); digitalWrite(IN4, sag < 0);
13 analogWrite(ENA, abs(sol)); analogWrite(ENB, abs(sag));
14}
15
16long mesafeOlc() {
17 digitalWrite(TRIG, LOW); delayMicroseconds(2);
18 digitalWrite(TRIG, HIGH); delayMicroseconds(10);
19 digitalWrite(TRIG, LOW);
20 long sure = pulseIn(ECHO, HIGH, 30000); // 30 ms zaman aşımı / 30 ms timeout
21 if (sure == 0) return 400; // yankı yok = yol açık / no echo = path clear
22 return sure / 58; // mikrosaniye -> cm / microseconds -> cm
23}
24
25void setup() {
26 int pinler[] = {ENA, IN1, IN2, ENB, IN3, IN4, TRIG};
27 for (int p : pinler) pinMode(p, OUTPUT);
28 pinMode(ECHO, INPUT);
29 randomSeed(analogRead(A0));
30 delay(2000); // yere koyman için süre / time to put it down
31}
32
33void loop() {
34 if (mesafeOlc() > ENGEL_CM) {
35 motorlar(HIZ, HIZ); // ileri / forward
36 } else {
37 motorlar(0, 0); delay(150); // dur / stop
38 motorlar(-HIZ, -HIZ); delay(350); // biraz geri / back up a little
39 if (random(2)) motorlar(-HIZ, HIZ); // sola dön / turn left
40 else motorlar(HIZ, -HIZ); // sağa dön / turn right
41 delay(400);
42 }
43 delay(30);
44}The motorlar() function takes two values between −255 and 255; a minus sign runs the motor backwards. That way forward, reverse and spinning in place are one line each: if the left motor runs backwards and the right forwards, the robot turns left on the spot. mesafeOlc() sends a 10-microsecond trigger to the sensor and converts the echo time to centimetres by dividing by 58; if no echo arrives within 30 ms, it treats the path as clear. In the main loop, when the robot sees an obstacle closer than 20 cm it stops, reverses for 350 ms and turns in a random direction. If the robot skids too much when turning, lower HIZ; if it hits obstacles, raise ENGEL_CM. You'll find how the sensor works in the HC-SR04 article.
Wi-Fi and Bluetooth control options with the ESP32
If you build your robot with an ESP32 instead of an Arduino, you get wireless control without any extra module. Which method you choose depends on range, latency and what you want to use as a controller. The ranges below are rough open-air values; walls and antenna orientation reduce them considerably.
| Method | Approximate range | Advantage | Watch out |
|---|---|---|---|
| Web server (ESP32 opens its own network) | 20–50 m | No app needed, a browser is enough | Each button press is a separate HTTP request |
| WebSocket | 20–50 m | Low latency, ideal for a joystick | Needs a bit more code |
| Bluetooth Classic (serial) | around 10 m | Works with phone apps written for the HC-05 | Only on the classic ESP32; not on the S3 or C3 |
| BLE | 10–30 m | Low power, compatible with modern phones | The phone side is more complex |
| ESP-NOW | 100 m and more | No router needed, very fast ESP32-to-ESP32 | Needs a second ESP32 as the controller |
| Bluetooth gamepad | around 10 m | Real analog stick feel | Needs a classic ESP32 and a suitable library |
1#include <WiFi.h>
2#include <WebServer.h>
3
4// L298N pinleri / L298N pins
5const int ENA = 13, IN1 = 27, IN2 = 26; // sol motor / left motor
6const int ENB = 32, IN3 = 25, IN4 = 33; // sağ motor / right motor
7const int HIZ = 200;
8
9WebServer server(80);
10
11const char SAYFA[] PROGMEM = R"HTML(<!DOCTYPE html><html><head><meta name="viewport" content="width=device-width">
12<style>button{width:30vw;height:20vw;font-size:6vw;margin:1vw}</style></head><body style="text-align:center">
13<p><button onclick="f('i')">^</button></p>
14<p><button onclick="f('l')"><</button><button onclick="f('s')">O</button><button onclick="f('r')">></button></p>
15<p><button onclick="f('g')">v</button></p>
16<script>function f(k){fetch('/k?y='+k)}</script></body></html>)HTML";
17
18void motorlar(int sol, int sag) { // -255..255, eksi = geri / minus = reverse
19 digitalWrite(IN1, sol > 0); digitalWrite(IN2, sol < 0);
20 digitalWrite(IN3, sag > 0); digitalWrite(IN4, sag < 0);
21 analogWrite(ENA, abs(sol)); analogWrite(ENB, abs(sag));
22}
23
24void komut() {
25 String y = server.arg("y");
26 if (y == "i") motorlar(HIZ, HIZ); // ileri / forward
27 else if (y == "g") motorlar(-HIZ, -HIZ); // geri / reverse
28 else if (y == "l") motorlar(-HIZ, HIZ); // sola / left
29 else if (y == "r") motorlar(HIZ, -HIZ); // sağa / right
30 else motorlar(0, 0); // dur / stop
31 server.send(200, "text/plain", "ok");
32}
33
34void setup() {
35 int pinler[] = {ENA, IN1, IN2, ENB, IN3, IN4};
36 for (int p : pinler) pinMode(p, OUTPUT);
37 motorlar(0, 0);
38 WiFi.softAP("BlueGrays-Robot", "12345678"); // telefonu bu ağa bağla / join this network
39 server.on("/", []() { server.send_P(200, "text/html", SAYFA); });
40 server.on("/k", komut);
41 server.begin();
42 // Tarayıcıda 192.168.4.1 adresini aç / open 192.168.4.1 in the browser
43}
44
45void loop() {
46 server.handleClient();
47}In this code the ESP32 opens its own Wi-Fi network called BlueGrays-Robot. Connect your phone to that network and open 192.168.4.1 in the browser to get a five-button controller page; each button sends a letter to /k and the motorlar() function drives the motors accordingly. The motor pins were chosen from ESP32 pins that don't cause trouble at boot; stay away from GPIO 6–11 and the strapping pins. Before uploading, see the ESP32 guide to add the ESP32 to the Arduino IDE, and the ESP-NOW article for a comparison of wireless methods.
Building a robot with the Raspberry Pi Pico
The Raspberry Pi Pico is also a good robot brain: it has 16 PWM channels, two cores and MicroPython support. The motor driver wiring is the same as on the Arduino; just make sure the driver's logic inputs accept 3.3 V as HIGH, since the Pico's pins run at 3.3 V. The L298N, L9110S and TB6612FNG usually work fine. The HC-SR04's ECHO output, however, is 5 V and must not go straight into a Pico pin; use a voltage divider or a 3.3 V version of the sensor. If you want wireless control, the Pico W adds Wi-Fi. For a start, have a look at the Raspberry Pi Pico guide.
Notes for robot competitions
The most common categories in school and university robot competitions are line following, sumo and maze solving. The values below are limits widely used in these categories, but every organiser has its own rulebook, and sizes, weights or start rules can differ. Always read the current rules of the competition you'll enter before you start designing.
| Category | Common limits | Design tip |
|---|---|---|
| Mini sumo | 10 × 10 cm footprint, at most 500 g, ring about 77 cm in diameter | Get close to the weight limit and keep the centre of gravity low |
| Standard sumo | 20 × 20 cm footprint, at most 3 kg, ring about 154 cm in diameter | Choose strong geared motors and high-grip tyres |
| Sumo start | Usually a 5-second wait after the start signal | Time the wait precisely in code with millis() |
| Line follower | Black line on a white floor, race against the clock | Add more sensors and tune corner speed with PID |
| Maze (micromouse) | Classic rules: 16 × 16 cells, 18 cm per cell | Use wall sensors and motors with encoders |
Common mistakes and fixes
- The car doesn't drive straight: two DC motors never turn at the same speed. Lower the PWM value of the faster side a little, or measure speed with encoders and correct it.
- The motors hum but don't turn: the PWM value is too low or the battery is weak. Account for the L298N's voltage drop and start PWM above 120.
- The robot keeps resetting: the motors and the Arduino share the same weak supply. Use separate power, capacitors on the motor terminals and charged 18650 cells.
- Upload fails with Bluetooth connected: if the HC-05 is on the D0/D1 serial pins, unplug the module's TX wire while uploading or move it to other pins with SoftwareSerial.
- The HC-SR04 reads random 0 or huge values: the sensor can't get an echo from angled surfaces or soft fabric. Check the timeout and average several readings.
- The servos jitter: servo power is taken from the Arduino's 5V pin. Use a separate 5–6 V supply and join the grounds; details are in the servo jitter article.
Once you start building robots it's hard to stop; every new sensor gives your robot a new skill. In the BlueGrays app you'll find the Bluetooth controlled car with L298N, the obstacle avoiding robot, TCRT5000 floor detection and servo control with a joystick, step by step with circuit diagrams and code.
Frequently asked questions
What is the easiest robot to build with Arduino?
The easiest start is an obstacle avoiding robot or a Bluetooth controlled car. Both use a 2WD chassis, two DC motors, an L298N driver and a single sensor or module, and their code is short.
What materials do I need to build an Arduino robot?
You need an Arduino Uno or Nano, a chassis and wheels, two geared DC motors, a motor driver such as the L298N, two 18650 cells with a holder and at least one sensor. Depending on the robot, you add an HC-SR04, TCRT5000, HC-05 or servo motors.
Is the L298N or the L9110S better for a robot?
The L298N is rugged and handles up to 2 A, but loses about 2 V. The L9110S is smaller and more efficient, ideal for small robots; for high-current motors the L298N or TB6612FNG is the better pick.
Which battery should I use for an Arduino robot?
For wheeled robots, two 18650 Li-ion cells in series (about 7.4 V) are the most balanced solution. A 9 V battery can't deliver enough current for motors, and 4 AA batteries drain quickly.
How do I control an Arduino robot from my phone?
Connect an HC-05 or HC-06 Bluetooth module to the Arduino and send letters from a Bluetooth terminal or controller app on your phone. With an ESP32 you don't need an extra module; you can control it directly over a Wi-Fi web page, Bluetooth or BLE.
What robot should I build for a robot competition?
The most common categories in school competitions are line followers and mini sumo robots. Mini sumo usually has a 10 × 10 cm and 500 g limit, but every competition's rules differ, so always read them before you start designing.
Projects to build after reading this
See all projects
Bluetooth Controlled Car with L298N
Turn your phone into a remote and drive your own robot car. The Arduino receives commands from a remote-control app on your phone through a Bluetooth module and spins the wheels with a motor driver…

Obstacle Avoidance Robot
How about building a smart vehicle that finds its own way? The Obstacle Avoidance Robot constantly scans its surroundings thanks to the ultrasonic sensor in front of it.

TCRT5000 Black and White Surface Detection
With the little sensor that acts as the eye of line-following robots, you can tell whether the floor is black or white.

Reading Reflection (Proximity) with TCRT5000
With a small sensor that sends out invisible light and measures how much bounces back, you can detect the surface in front of it.

Control an LED from Your Phone via Bluetooth
A small rehearsal for switching the lights in your room on and off from your phone.

Servo Control with Joystick
Steer two motors with a joystick, just like turning a security camera. Push the stick left or right and the bottom servo motor slowly turns, push it up or down and the top servo tilts up and down…

Using a Servo Motor
The arm of a small servo motor turns to three positions in turn: all the way to the start, right to the middle and all the way to the end, waiting two seconds at each stop.

Servo Circle Choreography - Animated Patterns with 32 Servos
A visual animation project driven by 32 servo motors arranged in a circle on an Arduino Mega. The servos are managed in a single array, connected to the Mega's pins 22–53, and perform four motion sequences: a chaotic jitter at random angles, a synchronized sweep, a wave travelling around the circle and a compass needle swinging left and right.
More articles
BlueGrays app
Build this circuit step by step on your phone
Wiring diagram, code and parts list on one screen. 500+ Arduino, ESP32, ESP8266, Pico, mBot and micro:bit projects ready to build.
Scan with your phone
Point your camera at the code and your phone's app store opens.
or open the store

