To highlight Norfolk Southern's culture of innovation, RP3 Agency built a scoreboard for the club level Norfolk Southern sponsors at the Washington Nationals’ stadium. The scoreboard uses G-scale model trains driven by stepper motors to indicate the stats of the game, such as strikes, balls, and outs.

While our partner, The Character Shop, fabricated the scoreboard, it was my responsibility to interface the stepper driver with the Node.js software, which we wrote at RP3 Agency. It connects to the same data feed that drives the main scoreboard at the stadium and sets our own scoreboard’s state. An open source G-code parsing library called grbl that runs on Arduinos allowed us to send g-code serial messages from our server to the Arduinos, which then send the commands to the stepper drivers. For example, to send the Balls train out to show three balls, we can send G1 F500 X63 \r to tell the stepper motor to push the train out to position 63 at a feedrate of 500 mm/min.

If the optical limit switches that help the motors locate the zero position were to fail, the motors would force the trains into the scoreboard. Should any sensor fail, grbl provides a serial message, and when that happens, we can automatically disable that train and get notified via a scoreboard Slack bot. Another challenge that presented itself during installation was that the electromagnetic interference created by all nine of the stepper drivers/motors ruined the sensor values, and the code that worked on our test setup in the office was failing. We solved this by insulating the sensor cables.

We attached screw shields to the Arduinos to allow for a secure installation that could still be easily repaired if needed. I modeled and 3D printed an RP3-branded case for the Arduinos + screw shields.

We also needed to serve the score and inning number to the TVs mounted in the scoreboard using the Raspberry Pi. Rather than having a separate installation of Raspbian on each Raspberry Pi, we decided to mount Raspbian as a read only NFS on our server to allow for easy updates and to prevent file system corruptions. The Pis autoboot to full screen Chromium, and each Pi has a unique URL stored on their SD cards that gets written to RAM so that the Pis are able to load different pages even though they have indentical file systems. I wrote a shell script to automatically install Raspbian on the server and set up the Pis to netboot from it.

Full project credits