Charlton's Blog

SpeedRacer: An Open-Source Pinewood Derby Track Controller

A homebrew job for my PrincTech course.

Published: Oct 12, 2016
Category: Hardware Hacking, Programming, Projects
Tags:

SpeedRacer

Check it out on GitHub.

What is SpeedRacer?

SpeedRacer is a free, Open Source track timer for Pinewood Derby tracks. It was a homebrew job for my PrincTech course, in which we built a pinewood derby track to test car aerodynamics.

SpeedRacer serves a single purpose, which is to keep time on each car. SpeedRacer accomplishes this incredibly well, too: Time data is exposed in realtime via a highly optimized web interface, accessible via Wi-Fi.

How does SpeedRacer work?

SpeedRacer monitors sensors mounted on your Pinewood Derby track in order to determine times for each car. This data is then exposed via a web interface on a privately broadcast WiFi network that you can connect to with any device, mobile or desktop.

Installing and using SpeedRacer

Step one is to prepare your Raspberry Pi Model B Version 3 by flashing the SpeedRacer system image to an SD card. You’ll need an SD card with at least 2GB of storage. To do this, extract the image file from System Images/SpeedRacer1.0.zip and refer to the Raspberry Pi OS Installation Guide

Step two is to wire the appropriate sensors to your track, and connect them to the corresponding pins on your Pi. You may want to refer to the Fritzing diagrams in the Wiring Schematics directory before doing this. Essentially, you’ll need to wire it like so:

Wire bumper switches at the end of each lane like so (up to 3, for the moment, but additional lanes can be added with modifications):

Once everything has been flashed and wired appropriately, connect the Pi to power. The system will broadcast a wireless network named “SpeedRacer”, which you can connect to with the password chimchim. Once connected, visit http://speedracer.local (or http://192.168.1.1) in your browser to view the scoreboard. You’re off to the races!

Modifying SpeedRacer

The system is wide open to modification, simply connect to the SpeedRacer WiFi network and ssh [email protected]. From there, you can use the default password (raspberry) to modify code and system settings as you see fit.

System settings are located in the following places:

Before making modifications, it is recommended that you swutch to the root user and use extreme caution.

Debugging

For instructions on how to get “under the hood”, see Modifying SpeedRacer.

To restart the main application process, you may either power cycle the pi or run pm2 restart 0 as root.

To check your wiring, run the following commands as root:

Press and release the switches you’ve wired in, and the diagnostics program will tell you which switches it thinks you’re hitting.