← Portfolio
Hardware

Self-Driving Car

A little car I built that drives itself around things without hitting them.

Crosses the floor, reaches the case, turns at the shelf.
Turned it on and let it go past the hamper.
Why it exists

I wanted something that looks before it moves instead of driving until it hits a wall. Three readings is the smallest number that lets you actually choose a direction rather than just react to whatever is straight ahead.

How it works
MCU
Arduino UNO
Rangefinder
HC-SR04 ultrasonic, in a cardboard housing I cut
Pan
SG90 micro servo
Driver
L298N. IN1–IN4 for direction, ENA/ENB for speed
Drive
2× TT gearmotor, differential, LEGO Technic chassis
Loop
Pan left, centre, right. Read distance at each. Take the most clearance
Reverse
Backs up, stops, re-scans. No forward push after it, so it can't reverse into something twice
Straight on. The HC-SR04 in its cardboard housing.
Servo under the sensor, battery under the chassis.
Serial output while it's running.
L298N, jumper wires, and the LEGO frame.
What broke

The first version turned by stopping one wheel, and it kept catching obstacles with its back corner halfway through the turn. Driving both wheels at different speeds makes it arc instead, so the tail swings clear.

Artefacts
Telemetry
Serial monitor capture, live run
Built
April 2026
Links