Third party cookies may be stored when visiting this site. Please see the cookie information.

PenguinTutor YouTube Channel

Model railway maker projects with Raspberry Pi, Arduino and 3D printing

The projects in this page are all based around maker projects involving model railways. This includes indoor model railways such as OO and HO, and larger outdoor model railways using G-Scale 45mm track.

Building a G-Scale garden model railway

This project is a bit different to the others in that it isn't just about computing and electronics. This is an ongoing project to build a G-Scale Model Railway in our garden. It's a project involving myself and my son, with some electronics, 3D printing as well as traditional woodworking and other crafts. I have previously created indoor model railways at OO scale, but this is my first go at larger outdoor model railways.

Introduction

This is an introductory video showing you around my outdoor layout.

Please Subscribe and click the bell icon to be notified of my future videos.

Model Railway Automation

I've automated my model railway layout using a Raspberry Pi with a motor controller. It's possible to run trains in either track using full automation (station start and stop), IoT (web based control) or traditional analog controller.

I have created a YouTube video series explaining the different aspects of controlling the model train. The first video is shown below. For the full series (as released) see the Model Railway Automation page. Alternatively go to YouTube Model Railway playlist.

 

Installing track around the garden

The first aspect is getting track installed into the garden. We started with a basic model G-Scale set from LGB. It came with an oval of track with simple analogue controller. I wanted to take this further than a basic oval and have created bridges to take part of the track around the garden.

The garden is used for multiple purposes and people to have to step over the track. Our garden is on a steep hill. The area where the main part of the garden railway is installed is reasonably level (compared with the rest of the garden), but is reached by going up some steps. Rather than having people step over the track I took the railway into a section of garden that is lower down and created new wooden stairs which are mounted over the top of the existing concrete steps. The track goes through the steps forming a tunnel. There is a similar arrangement at the top of the garden for moving into the next part of the garden where the garden sheds are located.

G-Scale LGB train on outdoor model railway

 

Model Railway Point Controller

For my indoor railway I needed a way to control points on the layout. Although the trains were DCC the controller I had did not support points, and even if it did I liked the idea of having a manual switch-board which allows me to flick a switch to change the points.

The point controller is based around a Raspberry Pi Pico W, which includes a web server allowing for control via phone, or computer and a physical I2C expansion board allowing for the points to be controlled using mechanical electronic switches.

I also incorporated a Capacitor Discharge Unit (CDU) in the project to reduce the load on the power supply and to improve the switching reliability. This was based on my own circuit design using a MOSFET rather than the usual biopolar junction transistor.

Laser cut box with sloping front for Model railway point controller Raspberry Pi Pico project

 

LED lineside signal lights

In this project I've created 3D printed lineside signal lights for my G-scale model railway.

The lights can be controlled by a custom ATMEGA328p based circuit (like the Arduino UNO) which can be controlled by a Raspberry Pi. It can also be controlled by a Raspberry Pi Pico using the RP2040 micrcontroller.

G-Scale LGB train with automatic LED signals

 

Model railway departure board

I've also created a model railway station departure board. This uses an OLED display mounted into a 3D printed stand.

The departure time can be updated based on a time sequence, or it could be integrated into the automation.

G-Scale OLED display model railway departure board with Raspberry Pi

 

Model railway audio MP3 Player

I've used a Raspberry Pi Pico and DFRobot DFPlayer Mini to provide a way to play sounds to represent scenes on a model railway.

This includes the ability to create station announcements and other sounds related to model railway scenes.

Raspberry Pi Pico with DFRobot DFPlayer Mini MP3 Player

 

MERG Model Electronics Railway Group - CBUS and DCC Kits

I've also joined as a member of MERG, the Model Electronics Railway Group. I've bought some of their kits from the Kitlocker, including some around DCC and a USB interface to CBUS (implementation of CANBus for model railways).

I'm currently working on implementing some of these and I'll be adding a write-up and video about some of these projects in future.

MERG DCC command control module and handheld CAB2 controller

 

3D Printing and Laser cutting

I have been creating some items for the railway using a 3D printer. So far most of the 3D printing designs have been based around simple models (see Creating 3D printer models in blender), but we are now looking at the tools used to create our own designs to scale.

3D printed G-Scale weigh building for outdoor model railway

The first is a small building which includes a smoke generator to give the effect of smoke coming out of the chimney.

3D printed G-Scale boy scout campsite with campfire

This is a Scout campsite model created in TinkerCAD. It includes a campfire with LEDs controlled using an Arduino.

I've also created other accessories including G-Scale traffic lights for my outdoor railway.

I've also added some adapters and other features designed for 3D printing.

Some electronics projects also include elements of 3D printing and/or laser cutting.

Future projects

For the latest updates please:
Subscribe to the PenguinTutor YouTube Channel
and
Follow @penguintutor on Twitter

Previous Google Bard
Google Bard
Next Model Railway Automation
Model Railway Automation