My Märklin – digital rail layout

HO UK model rail

The S88 – 60881 – electronics

PLEASE NOTE: This page is now redundant as August 2020 as I have purchased 2 s88’s and the CS3+

As my Märklin digital rail layout runs at 17 – 20 volts, interfacing the contact sensors to the Arduino running at 3.3 – 5 volts could lead to a potential meltdown. Despite the fact that I’d love to see this happen, I suppose I need to be less profligate and save the Arduino to live another day.

As it so happens this challenges me to learn a little more about electronics, than my basic understanding at present.

After delving around on the internet, I discovered this article an just what I need (I think):




This illustration of the Märklin contact track uses the outer rail to detect rail traffic. I intend to try using the centre track which will detect only the locomotive


A 12 volt car circuit is optically connected to a 5 volt circuit connected to a Arduino. As there is a optical connection there is no likelihood of direct electrical connections causing damage to the lower rated Arduino components.

The above simple circuit is what I intend to construct for each of the 32 or so contact rails. I’ve already ordered some components for its construction, so in a couple of weeks I should be able to tell if my Arduino can make sense of the impulses sent to it

The components for each contact track comprise of :

Component Type Quantity
4N25 Opto Coupler 1
4.7k Ohm Resistor 2
1N4148 Diode 1

I intend to solder these onto Veroboard.


%d bloggers like this: