We are a collaborative community website about model trains that anyone, including you, can build and expand.  This website contains examples of model railroad automation using the Raspberry Pi and basic electronic components.


Check out the Wiki Pages and please feel free to drop us a note if there is a topic that you're interested in.  We'll try to address it as soon as possible!

This project is a conglomeration of electronic goodies that let you automate control of your model trains.  The heart of the system is, of course, a Raspberry Pi.  The primary sensors are Hall Effect sensors, which effectively allow you to know where the train is at any given time.  Other goodies include a L298N motor driver and SG-90 servos.  

Demo video:  [click here]

If you want to learn more about the Raspberry Pi, or electronics in general, and like model trains, then this project is perfect for you!  We recommend reading through the Device Pages to both learn and test for yourself how each individual device works before trying to build the entire train set which is described in the System Pages.

Device Pages

Raspberry Pi 4 model B

Raspberry Pi 4B

» If you are using a Raspberry Pi version 4B, please visit the Drivers & Utilities page and update your version of WiringPi before working with the individual device drivers or the trolley software itself.

 If you're able, please "like" our Hackaday.io project to help promote us on Hackaday.

Yes, the electronics are mounted on a keyboard drawer, so it slides up under the train board when the grandkids come over!

Click the image to expand

Keywords: Raspberry Pi model trains, pca9685, pca9635, L298N ,txs0108e, sg90, ads1115, lcd1602