Obstacle avoidance and line following robot

I built a two-wheel robot that I could drive with a gamepad or leave to steer around obstacles and follow a line.

The robot driving and turning on a tabletop.
Hardware demo The robot driving and turning on a tabletop.
My robot beside its Logitech gamepad and USB cable.
The robot and the gamepad I use to drive it.
Rendered 3D model of my Arduino robot
3D model built from my photos, with estimated dimensions.

Try it

Choose Start robot, then Auto, and watch the two distance readings as the robot chooses which way to turn.

Rendered simulation of my high school Arduino robot

Model built from my photos. No hardware is connected.

Role
High school projectMechanicalElectricalSoftware
Timeline
High school, semester 2
Tools
Arduino IDE, ESP32-S3, ESP-NOW, Logitech F310
Drive and sensors
Two gearmotors, two VL53L0X distance sensors, QRE1113 reflectance sensors and a front ultrasonic module (unused by the receiver code)
Status
I ran gamepad driving, obstacle avoidance and line following on the physical robot.

How it's built

I designed the chassis, cast the tyres and built the wireless controls.

I built a differential-drive robot that I could steer with a gamepad and then switch to obstacle avoidance. The chassis carries the line sensors underneath and distance sensors facing out toward obstacles.

Chassis and cast tyres

I printed the chassis in PLA and cast the tyres in a printed mould using 20A silicone. The left and right wheels turn independently so the robot can pivot in place.

Side view of the robot, showing a blue wheel and the black chassis.
The wheel and chassis from the side.

Power and sensors

A 2S LiPo powers the TB6612FNG motor driver. An LM2596S buck converter supplies 5 V to the ESP32-S3 Nano.

Open receiver bay, front distance sensors and two wheels on the robot.
The receiver wiring and front distance sensors.

The QRE1113 sensors read the line on the floor. The two VL53L0X distance sensors have separate I2C addresses. The chassis also carries a front ultrasonic sensor.

Hardware photo · in progress
Front view of my Arduino robot and its wiring.
The wiring at the front.

Driving and obstacle avoidance

In manual mode, the transmitter sends my gamepad inputs over ESP-NOW. The robot converts them to a speed for each wheel and stops the motors if no radio packet arrives for 300 ms. In obstacle avoidance mode, it slows down, backs up and turns toward the side with more clearance.

Hardware demo · in progress

Testing

The receiver scans the I2C bus before and after sensor setup. Its serial log prints the mode, drive and turn commands and both distance readings.

Screen recording · in progress