← all repositories
felipessalvatore/self_driving_pi_car

Lego + Raspberry Pi + TensorFlow = a self-driving toy car

Two Brazilian researchers built a neural-network car from Mindstorms parts and a Pi, because why buy a $50k lidar rig when you have childhood toys?

755 stars Python Domain AppsComputer Vision
self_driving_pi_car
Not currently ranked — collecting fresh signals.
star history

What it does

A Lego Mindstorms NXT robot, wired to a Raspberry Pi 3, drives around a track using a CNN trained in TensorFlow. You collect camera images from the Pi, train on a real computer (the README explicitly warns: “don’t train the model in the Raspberry Pi!”), then deploy the checkpoint back to the Pi for live inference. Two modes run on the robot: regular driving, or debug mode, which saves every frame with prediction probabilities stamped on it.

The interesting bit

The project treats hyperparameter search as a first-class citizen. There are separate scripts to grid-search architectures, learning rates, and optimizers, each dumping results to a text file. It’s a surprisingly methodical pipeline for what is essentially a toy car — closer to a mini MLOps workflow than a weekend hack.

Key highlights

  • Full stack: NXT-Python for motor control, TensorFlow 1.2.1+ for training, scp/tar for “data transfer”
  • Data pipeline: raw images → pickle → numpy arrays → TFRecords, with augmentation and binarization options
  • Simulation mode runs inference on saved track images before you risk the physical robot
  • Python 2/3 split: master branch is Python 2; python3 branch exists but requires switching
  • Travis CI badge and unit tests for both Pi connection and model correctness

Caveats

  • README is frozen in TensorFlow 1.x era; no mention of TF 2.x or modern Keras
  • The “don’t train on the Pi” warning suggests the hardware is exactly as limited as you’d expect
  • No candidate images provided, so the track photo and GIF in the README are unavailable for preview

Verdict

Grab this if you want a complete, low-budget reference architecture for end-to-end tinyML robotics — or if you need to convince someone that a $35 computer and decade-old Lego can still teach CNN deployment. Skip it if you’re looking for ROS2, SLAM, or anything that handles real roads.

Frequently asked

What is felipessalvatore/self_driving_pi_car?
Two Brazilian researchers built a neural-network car from Mindstorms parts and a Pi, because why buy a $50k lidar rig when you have childhood toys?
Is self_driving_pi_car open source?
Yes — felipessalvatore/self_driving_pi_car is open source, released under the MIT license.
What language is self_driving_pi_car written in?
felipessalvatore/self_driving_pi_car is primarily written in Python.
How popular is self_driving_pi_car?
felipessalvatore/self_driving_pi_car has 755 stars on GitHub.
Where can I find self_driving_pi_car?
felipessalvatore/self_driving_pi_car is on GitHub at https://github.com/felipessalvatore/self_driving_pi_car.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.