Autonomous Car with Raspberry Pi

Obstacle-aware rover with manual & autonomous modes, controlled through a Flask web dashboard.

PythonFlaskHTML/CSSJavaScriptRaspberry PiPCA9685
Raspberry Pi Car Prototype

Prototype: forward drive, ultrasonic stop at ~25 cm, servo sweep (left/center/right), choose the most open path.

Overview

I designed and built a Raspberry Pi–powered rover that detects obstacles and makes simple navigation decisions. The Pi hosts a Flask server exposing controls and telemetry to a clean HTML/CSS interface with a bit of JavaScript. Drivers (motors, ultrasonic sensor, and steering via PCA9685) are abstracted behind Python modules so the web layer stays minimal and testable.

Goals

  • Reliable browser controls for forward/back/left/right/stop.
  • Autonomous mode that stops for obstacles and selects a safer direction.
  • Modular hardware layer so components (motors/sensors) can be swapped without UI changes.

My Role

  • Backend: Flask routes & REST endpoints for drive commands and status polling.
  • Hardware: PWM motor control, ultrasonic distance reads, servo sweep logic.
  • Frontend: HTML/CSS layout + JS fetch calls for controls and live updates.

Architecture

Highlights

Separation of Concerns

Hardware drivers are isolated from views; swapping sensors or motors won’t break the dashboard.

Deterministic Control

Calibrated PWM ranges and steering offsets yield smooth, repeatable movement.

Extendable to Vision/ML

Pipeline is ready for camera input and simple policies (e.g., Q-learning or rule weighting).

Challenges & Solutions

What I Learned

Next Steps