This Raspberry Pi Pico drives tiny level crossing lights for a model train
Brendan McGrath, who uses a Raspberry Pi Pico to create more realistic level-crossing lights for his model train set. We’re fully on board with this clever and creative use of technology.
McGrath shared his project in a quick video on his YouTube channel, Pater Practicus, where he gives viewers a close-up look at the entire setup, including the Raspberry Pi Pico and its wiring to the level crossing lights. The lights are controlled by beam-break sensors that detect when a train is passing, allowing them to switch more accurately, just like real-world crossing lights. The system doesn’t just detect the front of the train; it also monitors for the caboose, ensuring the lights operate in a way that closely mimics actual railway intersections.
The video provides a good look at the hardware setup. The Raspberry Pi Pico is connected to a breadboard, which suggests that the project is still in the proof-of-concept stage rather than a polished final build. The Pico manages the logic for both the sensors and the level crossing lights. Additionally, McGrath shows the model train being manually pushed along the track, with Lego bricks cleverly used to hold the sensors in place.
One of the highlights of the video is that McGrath has made the source code accessible. The script, written in MicroPython, is briefly displayed in the video, allowing viewers to pause around the 10-second mark to examine it. This makes it easier for others to recreate the project or better understand how it works. For those interested in seeing this Raspberry Pi project in action, the full video is available on McGrath’s YouTube channel.
Read more: This Raspberry Pi Pico drives tiny level crossing lights for a model train