Skip to the content
PCBKitNew board
2 layers27.3 × 13.1 mmSwitchy controller psu, the printed circuit board in 3D

Switchy controller psu

moosh/switchy2

Smart Wireless Integrated Train Control Hub sYstem

Size
27.3 × 13.1 mm
Copper layers
2
Thickness
1.6 mm
Parts
14
Nets
9
Pads
28
Tracks, vias
56, 14
Pours
2
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
27 Feb 2025
Updated
11 Oct 2025

Overview

Switchy controller psu is an open-source printed circuit board by moosh, from the moosh/switchy repository on GitHub. It is a 2-layer board of 27.3 × 13.1 mm with 14 parts on 9 nets, routed with 56 tracks and 14 vias.

It is built around the TPS54302 and DF02M. Its parts include 4 capacitors, 2 resistors, 1 IC, 1 diode and 1 inductor. It belongs with the power boards of this library.

Main components

2

README

README.md

SWITCHY

Smart Wireless Integrated Train Control Hub sYstem

Intro

The goal of this project is to create a freely available digital on-ramp for older Märklin train setups. If you have a wildly-wired analog train system, you may gain some flexibility by using the hardware and software described below. The hardware is designed to be as "set it and forget it" as possible. The software required is minimal and accessible to non-programmers.

TL;DR

I must say up front, my friend Bert is the train enthusiast, and I just like building things. Please forgive me if I use the wrong train terminology! Together we discussed how to move toward some software control over his setup. Early on Bert found the excellent YouTube channel The3rdRail. The hardware that follows was inspired by the train setup glimpsed there.

Hardware

Currently, the SWITCHY system has two different wi-fi enabled boards. Each board connects to a particular kind of track.

NOTE: No other hardware, other than a computer or tablet, is necessary. When powered up these boards find each other and self-assemble into a small local wi-fi network. From there it's up to you, using software tools described below, to control your actual train layout.

The White Board

The first is the white-colored board that allows you to control up to four Märklin turnouts. Alternatively, up to eight other accessories that take 16VAC. Here is one of the four turnout's connected and a close-up of the board:

alt text alt text

The Blue Board

The second is the blue-colored board that waits for a train to brush across a contact, left or right, in a track section. It then broadcasts this "event" and allows you to take any desired action.

alt text alt text



Full KiCad schematics and PCB layout documents for each board are available in this archive.

alt text alt text

More Details

Each board is currently powered by an ESP8266 microcontroller, specifically a WeMOS-like MCU. I've found much joy in this little device, and it's built-in wi-fi support.

All communication is via an ad-hoc MQTT network set up over wi-fi. Each board (also referred to as a node) is given a unique nodeID via its onboard 8-gang DIP switch. (See the software section below for a discussion on 8-bit binary notation). The board with nodeID = 0 (and there must be one board with nodeID zero) performs multiple duties. Along with controlling turnout switches it creates a wi-fi access point (hotspot), named "SWITCHY Network", requiring no password, at IP address 192.168.4.1. It also operates an MQTT server. This server is how all nodes communicate with each other and the control software (discussed below).

The network that forms allows up to 256 boards of each type. This means that the SWITCHY network supports controlling up to 1024 Märklin turnouts, or up to 1024 contact switch track sections.

Software

Any software system that supports communicating with an MQTT server can be used to control the SWITCHY network. Perhaps the easiest to use for non-programmers is Node-Red or n8n. Installation and basics of these platforms is outside the scope of this README so please refer to the links above for those details.

NOTE: The terms "board" and "node" are used interchangeably in the following discussion. Node primarily is used when talking about the board's software representation on the SWITCHY network.

White Board

The white-board (turnout switcher) listens for MQTT messages on the switchy/track_switching channel. From Node-RED, etc. you send MQTT messages on this channel to make the desired switch move. Messages are formed using JSON. Here's an example message you an send to a white board:

{ "nodeID": 3, "switchIndex": 1, "direction": "straight" }

  • nodeID: MQTT supports a publish/subscribe architecture used by the SWITCHY network. This means that every subscriber hears the same published message. The JSON message, above, includes a nodeID to indicate for which node the message is meant. All other nodes ignore the message.

  • switchIndex: The one-based index of the switch to be modified. Current versions of the white board support up to four Märklin turnouts. The switchIndex ranges in 1 to 4.

  • direction: Determines which way the track is to be switched. Should be one of "straight" or "round".

Blue Board

The blue-board (contact listener) will send a MQTT message on the switchy/contact_switching channel. Your Node-Red, etc. code will listen on this channel and react when messages arrive. For example, you might toggle one or more turnout switches based on your track layout. Like the white board's message format, the blue board also uses JSON. Here's an example message sent from a blue board:

{ "nodeID": 3, "switchIndex": 11, "direction": "left" }

  • nodeID: The ID of the node meant as the message's target. All other nodes ignore the message.

  • switchIndex: The one-based index of the switch toggled by a moving train, etc. Current versions of the blue board support up to four Märklin contact switch tracks. The switchIndex ranges in 1 to 4.

  • direction: One of "left" or "right". These directions are relative to the contact switch track section when the Märklin plug-ins are facing you.

With these two items, it's possible to control and react to a large number of track sections.

More Details

Each board on the SWITCHY network must have a unique nodeID. The DIP switches on each board allows you to set this ID. The eight DIP switches allow you to create an 8-bit binary number as an ID.

As mentioned above nodeID = 0 is a special node. There must be one and only one board with nodeID of zero. All other boards must have a non-zero, unique, nodeID. What this means in practice is one board has all DIP switches set to 0:

alt text

All other nodes have a unique nodeID, for example here's one set to 9:

alt text

Please check out this page for a discussion on counting in binary.

Parts

14
QtyValueFootprintReferences
4, , ,
222uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC5, C6
10.1uFCapacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolderC4
1100ufCapacitor_THT:CP_Radial_D5.0mm_P2.50mmC2
110uHMLZ2012N100LT000:INDC2012X145NL1
113KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR12
191KResistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolderR11
1DF02MDiode_THT:Diode_Bridge_DIP-4_W7.62mm_P5.08mmD2
1LOGOcustom footprints:the_bag_gray_6x6G***
1TPS54302Package_TO_SOT_SMD:SOT-23-6U15

Questions

How big is the Switchy controller psu PCB?

It measures 27.3 × 13.1 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Switchy controller psu use?

14 parts, built around the TPS54302 and DF02M. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Switchy controller psu KiCad files?

From the moosh/switchy repository on GitHub, at the commit this page was made from: the board is kicad_controller_psu/switchy_controller_psu.kicad_pcb and its schematic kicad_controller/switchy.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Switchy controller psu design in my own project?

Its repository states no licence, so its author keeps all rights: ask moosh before reusing the design.

More from moosh/switchy

2
  • 2 layers80.2 × 55.5 mmSwitchy listener, the printed circuit board in 3D

    Switchy listener

    moosh/switchy

    Smart Wireless Integrated Train Control Hub sYstem

    47 parts2
  • 2 layers80.2 × 55.5 mmSwitchy, the printed circuit board in 3D

    Switchy

    moosh/switchy

    Smart Wireless Integrated Train Control Hub sYstem

    33 parts2

Similar boards

  • 2 layers135 × 101.5 mmLawn sprinkler ctl, the printed circuit board in 3D

    Lawn sprinkler ctl

    adriencarbonaro/lawn-sprinkler

    Lawn Sprinkler Controller

    91 parts
  • 2 layers213 × 84.8 mmZX Max 128 Issue 3 PCB, the printed circuit board in 3D

    ZX Max 128 Issue 3 PCB

    liveboxandy/ZX-Max-128-Issue-3

    KiCAD created files for the ZX Max 128 Issue 3 designed by DonSuperfo

    170 parts
  • 2 layers45.8 × 31.8 mmESP32C6 buttons, the printed circuit board in 3D

    ESP32C6 buttons

    computergeek1507/KiCad_Designs

    KiCad PCB Designs

    12 parts10
  • 2 layers40 × 80 mmSplitflappcb, the printed circuit board in 3D

    Splitflappcb

    codingcatgirl/split-flap-fae-pcb

    Alternative drop-in replacement PCB for David Kingsman's split-flap display

    46 parts31Apache-2.0
  • 4 layers66.4 × 163.6 mmDucker Charger, the printed circuit board in 3D

    Ducker Charger

    Angelussss/Ducker-Charger

    an open source custom power bank

    278 parts20
  • 4 layers241.7 × 56.7 mmDaisy studio, the printed circuit board in 3D

    Daisy studio

    squeedee/daisy-studio

    Daisy Seed Carrier for Balanced Pro Audio

    141 parts14MIT
  • 6 layers180 × 120 mmDCJ11CoreBoard v1.3, the printed circuit board in 3D

    DCJ11CoreBoard v1.3

    CYP4502D6/DCJ11CoreBoard

    PDP-11 replica project based on the DEC DCJ-11 chipset, utilizing FPGA as bus controller and peripheral emulator, using external SRAM to provide system memory

    234 parts13GPL-3.0
  • 4 layers65.9 × 52.9 mmEX CSB1, the printed circuit board in 3D

    EX CSB1

    DCC-EX/EX-CSB1

    Open source EX-CSB1 CommandStation / Booster

    103 parts13