Skip to the content
2 layers100 × 52 mmHauptplatine, the printed circuit board in 3D

Drive your brick-built trains from your computer or a home-made remote – via Bluetooth, without internet, without an account.

Size
100 × 52 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
43
Pads
123
Tracks, vias
322, 8
Pours
12
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
29 Oct 2026
Updated
31 Oct 2026

Overview

Hauptplatine is an open-source printed circuit board by ru320, from the ru320/StudRailMaster repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 100 × 52 mm with 40 parts on 43 nets, routed with 322 tracks and 8 vias.

It is built around the BC337. Its parts include 14 resistors, 12 connectors, 7 capacitors, 1 IC and 1 diode. It belongs with the ESP32 boards of this library.

Main components

1

README

README.md

Stud Rail Master – drive brick-built trains via Bluetooth, with real levers

Drive your brick-built trains from your computer or a home-made remote –
via Bluetooth, without internet, without an account.

🇩🇪 Deutsche Fassung · Installation · User guide · Remote


Why?

The layout runs trains with motor hubs from three makers: a cheap JMC hub, a Mould King 4.0 from the Orient Express and a LEGO City Hub from the freight train 60337. Every hub wants its own phone app. Every app has different sliders, and driving two trains at once means two phones.

I wanted one control desk for all trains – ideally with real levers you push with your thumb, and a big red button that really stops everything. No account, no ads, no cloud. That turned into two things:

Stud Rail Master – the PC programfor Windows, macOS and Linux. Find hubs, add photos of your trains, assign levers, drive. Needs no extra hardware.
Stud Rail Master Quadro – the remotean ESP32 with four slide pots, direction switches and an emergency stop. Drives up to four hubs on its own, no PC needed; set up through a web page in your phone's browser.

Both share the same drivers and take turns: when the PC starts it takes over the radio, when it quits the remote drives again.

What it looks like

Loading screen: logo, a brick train runs along the track Drive page with three levers and emergency stop

Four throttles, freely spread over the ports of three hubs

Every socket of every hub gets a throttle – spread any way you like: two motors on one throttle, one throttle across several hubs (even from different makers), single motors inverted. More in the user guide.

  • One lever per throttle – drag up to go faster, one tap to change direction, a big red emergency stop (also on the space bar).
  • Your trains, your pictures – put a photo on every hub so you always know which lever moves which train.
  • Many trains at once – up to 16 throttles; one throttle can drive several locomotives, even from different makers.
  • Gentle direction changes – the train slows down and starts off the other way, instead of jerking.
  • Stays at home – no internet, no account, no advertising, no data collection.
  • Help built in – the same guide as here, offline in the program (the ? button).

Which hubs?

HubWindowsmacOSLinuxRemote
JMC hub (shows up as “JG_JMC-…”, ports A–D)✔✔✔✔
Mould King 4.0 (ports A–D, up to 3 hubs)⚠ not yet tested✘ → Linux or ESP32 with web page✔ one-time unlock✔
LEGO Powered Up City Hub (88009, e.g. set 60337, ports A/B)✔✔✔✔

Planned:

  • IR hubs (infrared, protocol like LEGO Power Functions) – transmitter in the remote, the window in the case is already there
  • BlueBrixx hubs with 2.4 GHz radio
  • LEGO Technic Hub (4 ports), Mould King 6.0 (as soon as the hubs are available)

Get started

  1. Download the program for your system from the releases page and unpack it.
  2. Start it, switch your hub on, find it under Settings → Find hubs, assign a throttle – and off you go.

Step by step: Installation · User guide · Set up the remote · Together with the remote

Want to try it without a hub first? Demo mode simulates three trains (see the user guide).

Or run it from source

With Python 3.10 or newer: download or clone this repository, then start app/start.sh (Linux), app/start.command (macOS) or app/start.bat (Windows). The first start sets everything up and downloads the required Python packages once; after that it starts right away.

Safety

Some hubs simply keep running their last command when they hear nothing more. So everywhere:

  • Emergency stop halts every train immediately – even in the middle of a direction change.
  • Nothing moves until every lever has been at 0 – after switching on and after every emergency stop.
  • On quit, on a lost connection and before every restart a stop is sent actively.
  • When you drive through the remote's web page, it triggers an emergency stop as soon as the page has been silent for 2 seconds.

The long road

No maker has published its protocol (except LEGO). What now fits into a few lines of driver cost quite a few evenings:

JMC: the hub that would not listen

The protocol comes from a capture of the original app: 11 bytes, a checksum, done – or so I thought. The hub still ignored every drive command. The reason: a freshly switched-on hub has to receive a stop first, before it moves at all. Then came the second surprise: it has no watchdog. If the connection drops, the motor just keeps running – more than 20 seconds in the test, until it was switched off. Since then every path out of the program actively sends stop. And because ports A+B share one speed byte, two motors stuttered as soon as you tried to drive them separately.

Mould King 4.0: radio without a connection

This hub never connects. It is controlled through encrypted Bluetooth advertising packets that the app sends every 100 ms with a changing address. The encryption could be rebuilt thanks to other people's work (see THIRD_PARTY.md) – and still nothing moved. In broadcast mode Linux drops three inconspicuous bytes (the “flags” 02 01 02), and without exactly those three bytes the hub ignores everything. On Linux the commands now go straight to the Bluetooth chip. macOS doesn't allow that at all. By the way: one reference had forward and reverse swapped.

LEGO City Hub: the impatient one

The only hub with open documentation – and still fussy: if nobody connects right away, it switches itself off after a few seconds. So the program no longer searches at leisure but grabs it the moment it shows up.

Packaging: 301 MB for one window

The first Linux program accidentally bundled the whole GTK toolkit and weighed 301 MB – and still didn't run everywhere, because WebKitGTK can't be packed portably. Now it ships Qt WebEngine (171 MB). The built-in Chromium sandbox failed on locked-down namespaces, an AppImage can't be given special privileges, and the Mould King radio needs exactly such a privilege – so there is now a tiny helper you unlock once with your password. And for a while, the browser opened every time along with the program window.

New findings about hubs go into drivers/*.json as test vectors – so PC and remote check on every build that they still send exactly the same bytes.

The remote

An ESP32 DevKit, four 75 mm slide pots, four toggle switches with an LED for the direction, an emergency-stop button and 4× AA batteries in a printed case. The firmware also works on its own without any of that – then the levers are sliders on the web page StudRailMasterQuadro.local.

Preview – not yet printed or tested. The case is fully designed on the computer but nobody has built it yet. If you print it first, feedback is welcome.

Case of the remote: desk with four orange slide levers, toggle switches and a red emergency stop

  • Case (German) – 180 × 180 mm desk, every part printable in one colour (build plate from 185 × 185 mm), STL files and a parametric CAD model (SolidCraft, STEP)
  • Parts list (German) – electronics, bought parts, screws
  • Flash and set up the firmware – already works with a bare ESP32 DevKit
  • Schematic to follow; the pin assignment is in the parts list.

For developers

The project consists of the PC program (app/, Python) and the firmware of the ESP32 remote (src/, lib/, PlatformIO). Both share the same hub drivers (drivers/).

License

Free software and open hardware – if you change it and pass it on, you must share it under the same terms:

PartLicense
Software (app/, src/, lib/, test/, tools/, drivers/)GPL-3.0-or-later
Hardware (hardware/: schematic, PCB, enclosure)CERN-OHL-S-2.0
Docs, images, logo (docs/, README*)CC BY-SA 4.0

Third-party parts (Barlow fonts, prior work on Mould King) and their licenses: THIRD_PARTY.md.

LEGO® is a trademark of the LEGO Group, Mould King a trademark of its manufacturer. This project is not sponsored or endorsed by either; the names only describe which hubs it works with.


In Herbrechtingen ist es immer am schönsten!

Parts

40
QtyValueFootprintReferences
5100nCapacitor_THT:C_Disc_D3.0mm_W1.6mm_P2.50mmC2, C5, C7, C8, C10
5330Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR11, R12, R13, R14, R20
447 0,6WResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_HorizontalR22, R23, R24, R25
4M3MountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
2330Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P2.54mm_VerticalR30, R31
1100kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR3
110kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR21
110µCapacitor_THT:C_Disc_D3.0mm_W2.0mm_P2.50mmC9
11N5819Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1
12,4 GHz (nRF24L01+)Connector_PinHeader_2.54mm:PinHeader_2x04_P2.54mm_VerticalJ12
1470µ 10VCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC1
168kResistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR4
1BC337Package_TO_SOT_THT:TO-92_InlineQ1
1Batterie (über Ein/Aus)Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ3
1ESP32 links (EN … VIN)Connector_PinHeader_2.54mm:PinHeader_1x15_P2.54mm_VerticalJ1
1ESP32 rechts (GPIO23 … 3V3)Connector_PinHeader_2.54mm:PinHeader_1x15_P2.54mm_VerticalJ2
1Fader-PlatineConnector_JST:JST_XH_B6B-XH-A_1x06_P2.50mm_VerticalJ4
1IR-LEDsConnector_JST:JST_XH_B5B-XH-A_1x05_P2.50mm_VerticalJ11
1MT3608-Modul (auf 5,0 V)ZugFern:MT3608_ModulU1
1Not-Stopp (Cherry MX)Connector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ9
1Schalter + LED 1Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ5
1Schalter + LED 2Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ6
1Schalter + LED 3Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ7
1Schalter + LED 4Connector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ8
1Status-LED + Batterie-LEDConnector_JST:JST_XH_B3B-XH-A_1x03_P2.50mm_VerticalJ10

More from ru320/StudRailMaster

1
  • 2 layers91 × 91 mmFader Platine, the printed circuit board in 3D

    Fader Platine

    ru320/StudRailMaster

    Drive your brick-built trains from your computer or a home-made remote – via Bluetooth, without internet, without an account.

    17 partsGPL-3.0

Similar boards

  • 2 layers50 × 25 mmMbus master, the printed circuit board in 3D

    Mbus master

    roarfred/AmsToMqttBridge

    Minimalistic system to read AMS/HAN data from electrical meter

    50 parts223
  • 2 layers118 × 103.5 mmEV Charger2, the printed circuit board in 3D

    EV Charger2

    fotherja/EV_Charger

    Arduino Uno Code for EV Charger

    62 parts167MIT
  • 2 layers28.7 × 81.3 mmLine sensor mini wide, the printed circuit board in 3D

    Line sensor mini wide

    ukmars/ukmarsbot

    A simple beginners multi purpose robot platform

    37 parts138MIT
  • 2 layersLM80C R6, the printed circuit board in 3D

    LM80C R6

    leomil72/LM80C

    A Z80-based homebrew computer withTMS9918, AY-3-8910, Z80 CTC, Z80 PIO, and Z80 SIO

    153 parts123GPL-3.0
  • 2 layers121 × 68 mmFreeds sanchez, the printed circuit board in 3D

    Freeds sanchez

    pablozg/freeds

    Derivador de energía solar excedente creado por Pablo Zerón, Diseño PCB por Amcalo, Tester original por Aeizoon, Wiki por Zoilo Mora

    42 parts108
  • 2 layers56.6 × 57.7 mmTashTwenty Tiny, the printed circuit board in 3D

    TashTwenty Tiny

    lampmerchant/tashtwenty

    An interface for the DCD protocol used by Apple's Hard Disk 20.

    31 parts35GPL-3.0
  • 2 layers52.8 × 149.3 mmPixelSlasher, the printed circuit board in 3D

    PixelSlasher

    CTXz/Video-Glitch-Array

    A collection of glitch art circuits dedicated to VGA signal manipulation

    22 parts30
  • 2 layers37.1 × 24.1 mmZX81-Composite, the printed circuit board in 3D

    ZX81-Composite

    redhawk668/ZX81-Composite

    ZX81 Composite video with Backporch

    16 parts25GPL-3.0

Questions

How big is the Hauptplatine PCB?

It measures 100 × 52 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Hauptplatine use?

40 parts, built around the BC337. 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 Hauptplatine KiCad files?

From the ru320/StudRailMaster repository on GitHub, at the commit this page was made from: the board is hardware/platinen/hauptplatine/Hauptplatine.kicad_pcb and its schematic hardware/platinen/fader/Fader-Platine.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Hauptplatine design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).