OM. ← Back to portfolio

ROBOTICS • PYTHON • AUTONOMOUS SYSTEMS

Autonomous Robot Car

A Raspberry Pi-powered four-wheel robot that can sense obstacles, control its own movement, and make basic navigation decisions without a human driver.

GitHub repository ↗
YEAR2026
TYPERobotics Project
ROLEBuilder & Programmer
STATUSIn Development
Autonomous Robot Car four-wheel chassis
RobotCar prototype

OVERVIEW

The challenge

Building a robot that moves is relatively easy. Building one that can decide where it should move next is much harder.

I built RobotCar as an experimental platform for learning how autonomous machines connect sensing, software, and physical movement. The car uses a Raspberry Pi to control four motors while three ultrasonic sensors measure the space in front of and beside it. The software uses those measurements to decide whether to continue forward, stop, reverse, or turn toward a clearer path.

The project also includes manual keyboard control, which lets me test the drivetrain directly and temporarily take control even while autonomous mode is running.

HIGHLIGHTS

Key details

4Drive motors
3Ultrasonic sensors
2DRV8833 motor drivers
1Raspberry Pi controller

HARDWARE

From code to motion

RobotCar combines a small Linux computer with motor-control electronics and distance sensors.

Raspberry Pi

A Raspberry Pi 4B runs the Python programs that read sensor measurements, make navigation decisions, and send commands to the motors.

Four-wheel drivetrain

Four DC gear motors drive the chassis. Two DRV8833 motor drivers provide the interface between the Raspberry Pi's control signals and the motors.

Three ultrasonic sensors

Left, center, and right HC-SR04 sensors measure nearby obstacles and give the software a simple view of available space.

Separate motor power

Two motor battery packs provide power for the drivetrain, separating motor demand from the controller's logic.

RobotCar wiring and electronics layout
RobotCar wiring layout showing the Raspberry Pi, motor drivers, sensors, motors, and separate power supplies.

The combination turns the car into a physical computing system where software decisions immediately become real movement.

AUTONOMY

How the car decides

The first autonomous version uses a straightforward sense → decide → move loop.

  1. DriveThe car moves forward while checking its left, center, and right distance sensors.
  2. DetectIf an obstacle becomes too close, the car stops instead of continuing blindly.
  3. Create spaceIt can reverse to give itself room to maneuver.
  4. CompareThe software compares the available space around the car.
  5. ChooseIt turns toward the clearer direction.
  6. ContinueOnce the new path is selected, the car resumes driving and begins sensing again.

This creates basic autonomous obstacle avoidance without requiring a remote driver. A manual override is also available while autonomous mode is active.

CONTROL

Manual and autonomous driving

Before testing autonomy, I built keyboard controls so each movement could be tested independently. Manual driving became an important debugging tool: it separates motor and wiring problems from navigation-logic problems.

WForward
SReverse
ATurn left
DTurn right
SPACEStop
QQuit

DEMONSTRATION

RobotCar in motion

Watch a short demonstration of the vehicle moving and responding to its environment.

Autonomous Robot Car demonstration.

ENGINEERING

Building in layers

Motor layerPython controls the four DC motors through the two DRV8833 drivers.

Sensor layerThree HC-SR04 sensors provide left, center, and right distance measurements.

Control layerManual driving verifies that motor direction and steering work correctly.

Autonomy layerThe navigation program combines sensor readings with movement rules to avoid obstacles and choose a direction.

The repository includes separate programs for motor testing, ultrasonic-sensor testing, manual driving, and autonomous driving, along with build, wiring, setup, and parts documentation.

DEVELOPMENT

Toward computer vision

Distance sensors can tell the robot that something is nearby, but they cannot tell it what that object is or whether an open-looking area is actually safe to drive across.

The next stage is camera-based navigation: identifying driveable floor and making better path decisions using visual information rather than relying entirely on three distance measurements. That moves the project from reactive obstacle avoidance toward a more complete autonomous-navigation system.

TECH STACK

What I used

COMPUTINGRaspberry Pi 4B · Python
MOTOR CONTROL2 × DRV8833 · 4 × DC gear motors
SENSING3 × HC-SR04 ultrasonic sensors
SOFTWAREPython · gpiozero · Linux / Raspberry Pi
NEXT STAGECamera navigation · computer vision · AI floor detection

REFLECTION

What I learned

RobotCar taught me that autonomy is not one piece of code. It is a chain of systems that all have to work together.

  • A navigation algorithm can be correct while a motor is wired backward.
  • A sensor can produce measurements while still giving unreliable information to the decision logic.
  • I had to transition from the L298N to the DRV8833 because power loss in the L298N reduced the car's maneuverability and control. The DRV8833 provided a more efficient motor-control solution for the autonomous system.
  • Building the car taught me to debug at the boundary between hardware and software, where changing a wire, a sensor position, or a few lines of Python can completely change how the physical system behaves.