Robotics

Students learn basics of robotics and autonomous driving with Python scripts to control hacked Radio Control cars.

Robotics Project Overview: The program begins with basic electronics exercises described in the Breadboard section. Once students have experienced motor and sensor exercises with Python control , we begin the robotic car project.

The RC Car projects consists of taking used toy grade Radio Control cars and removing all the radio control electronics leaving only the car drive and turn motors. Then we install a PiZero (or Pi 3), and a L298 H Bridge device to control the motors, and we have a robotic car/truck platform that we can program to be an autonomous vehicle!

Students remotely access the Pi Zero Desktop inside the cars over WiFi using their Pi 3 lab systems or laptops to write code and test their cars. The first autonomous driving exercise is a Python script to drive the car in a square pattern and return close to the starting point. The code must be tuned for each car to drive the course and students learn to modify scripts for different driving pattern sizes and shapes.

Later an ultrasonic sensor is added to detect obstacles for collision avoidance, and students develop code to drive their cars on basic courses and mazes.

Here is the 2020 Pi Shop student fleet of autonomous cars with Ultrasonic sensors installed for object avoidance. Students learn to write and test Python scripts to autonomously drive the cars in driving exercises. We setup cardboard mazes and courses to test the car driving algorithms.

The RC car hack typically uses a Pi Zero and a L298 H Bridge motor driver to control turning and drive motors via Python scripts. The photo below shows a typical car installation "under the hood". The Pi Zero in the car runs the Python code to drive the car.

Students use desktop Pi's or Chromebooks over WiFi to remotely access the Pi Zero desktop to enter, run and debug their code. Here's a Pi Shop Desktop screen shot of the Mu editor and a Python script to drive the car in roughly a 10' square pattern. It's pretty fun and easy to understand.


Field testing cars on the playground opens up the driving experience!

A First Person Video project using Pi 3 and wide-angle Camera on RC car

Here are two robotic platforms in development at the Pi Shop that use the Pixy2 robotic vision system. The Pixy2 can learn and identify objects and help steer the robots via a Python application script in development. Current code chases a ball of a specific color and really fun to debug!