This firmware is my first attempt at classes in the Arduino environment. The code is meant for (3) track Nerdy Derby timing system. Nerdy Derby, aka “Pinewood Derby on Steroids,” will be back again at Maker Faire Milwaukee. In this event, we provide the supplies, kids make their own custom cars, and race ’em down the track.
We thought it would be nice to have a low to no management system for the kids to time themselves. Ideally, once setup, it’ll run autonomously throughout the (2) days of the Faire. Getting back to the topic at hand, object-oriented makes sense in this application since once the system works for one track, it’s trivial to keep adding tracks till your run out of pins.
Teensy 2.0 is running the show here. The MCU reads solar panel output through its analog pin. The panel is placed across the track from a red laser module to form a “trip wire”. There is a start and stop trip wire for each track. These sweet red I2C 1.2″ 4-Digit 7-Segment Displays from Adafruit are used to display the race time. While these displays can communicate at 3.3V, they require 5V power, which was convenient given that Teensy 2.0 IO pins operates at 5V as well. Except for a bad solder joint while assembling the kit (completely my fault), these displays were a breeze to get up and running.
When the Teensy turns on, it averages 10 samples of the analog signal from the panels, with the assumption that the lasers are operational and accurate. I was hoping that the laser’s contribution to the solar power production is measurably significant relative the ambient irradiation. A reading lower than 90% of the baseline has been a reliable indicator of the laser being “tripped” so far. This has been tested under a variety of lighting conditions. During Maker Faire, I will reset the system once in a while to re-calibrate the panels to the changing condiitions. Once a race is finished, the timer display stops and blinks the race elapsed time till the start sensor is tripped again. Hopefully, this setup will require minimal attention during the event and work as intended – ha!
Code is here and here.