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

PenguinTutor YouTube Channel

Model Railway Points Controller with Raspberry Pi Pico W

This project provides a way to control model railway points (model railroad switches / turnouts) using a web interface on a Raspberry Pi Pico, using a GUI on a Raspberry Pi or a physical points switch frame connected by I2C.

This is part of my projects on building an indoor (OO Scale) and outdoor (G-Scale) model railway. This is intended for controlling up to 4 points on an indoor OO/HO model railway layout, although could be used for other model railways.

Electronics Point Controller Board

The main part of the project is a point controller board. This contains the capacitor discharge unit, a Raspberry Pi Pico Pico W with MOSFET switching circuits and a built-in regulated power supply for the Raspberry Pi PicoW.

Model railway point controller electronics circuit on PCB with Pico W

Part of the schematic circuit diagram is shown below. Click on the image to download the full PDF showing the circuit diagram.

electronics schematic diagram for model railway point controller - PicoW page

I2C GPIO expander with the MCP23008

There is an external board which is used to read the values of the switches and to control multiple LED outputs. This is explained in the video below.

For more details of how this works see the description on the Electronics guide to I2C GPIO expander MCP23008.

A 3D image of the PCB is shown below.

PCB electronics circuit with I2C GPIO expander MCP23008 for Raspberry Pi Pico W

The schematic circuit diagram is shown below. Click on the image to download the full PDF showing the circuit diagram.

electronics schematic diagram for model railway point controller I2C Switch and LED matrix - MCP23008

Capacitor Discharge Unit - CDU

One of the features of the point controller is a capacitor discharge unit. This uses capacitors to store a charge which can be used to apply a quick surge of current to the solenoids used in model railway point motors.

The video below explains the details of how this works.

For more details see: MOSFET Capacitor Discharge Unit project in my electronics pages.

Source code

The source code is available from Github.

Laser cut enclosure design

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

I have designed a wooden enclosure for laser cutting. This was designed using FreeCAD, Inkscape and LightBurn. It is based around a wooden box with interlocking sides, but rather than using existing workbenches in FreeCAD I had to design this manually. This is because of the sloping roof. On the page below I have a video which explains the design process including creating the main shape in FreeCAD before adding switch, LED and component holes in FreeCAD and Inkscape and etching including images and writing in Inkscape and LightBurn.

Inside laser cut box enclosure with PCB, Raspberry Pi Pico and electronics

Future Plans

After completing some prototype testing, the PCBs have been designed and the Gerber files sent off for manufacture. I'll be posted updates of the project on my PenguinTutor YouTube Channel
.

Related projects

Also see:

Future projects

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

Previous Model Railway Automation
Model Railway Automation
Next Light up Christmas house
Light up Christmas house