Maerklin 4316 Central

You are right, Maerklin 4316 is not a central but a normal waggon. But with a RaspberryPI running srcpd and Rocrail this waggon can be easily turned into a DCC central.

We need a circuit creating a differential protocol from the serial stream of the RaspberryPI Zero W, so for that I had used DigiSpark Mini including a simple timeout check to disable the tracks if no data was arrived. The Pololul MC33926 can be used as a driver stage. At last step we need power. A LiFePo4 battery is much more stable as LiIon. Adding step-up converters and a charger finishes the power stage.

So the idea is to do something like that:

A first check shows everything seems to fit:

Stay tuned for the building instructions… it is already running, see the video:


C-Code of Arduino compatible Digispark Mini:

//needs installation of library
#include "PinChangeInterrupt.h"

volatile int Count = 1001;
bool bLastState = false;

//setup of GPIOs
//P1 Enable Input of driver stage
//P2 Input 1 of driver stage
//P4 Input 2 of driver stage
const int DccInPin = 0;
const int DccInPCINT = 0;
const int DccEnablePin = 1;
const int DccOut1Pin = 2;
const int DccOut2Pin = 4;

void setup() {
  //setup of GPIOs
  pinMode(DccInPin, INPUT);
  pinMode(DccEnablePin, OUTPUT);

  //setup ISR
  attachPCINT(DccInPCINT, DccInChanged, CHANGE);

//ISR called at DCC IN Pin change
void DccInChanged(void)
  //toggle DCC pins
  bLastState = !bLastState;
  //reset timeout counter
  Count = 0;

void loop() {
      //check timeout happened
      if (Count > 1000) 
        digitalWrite(DccEnablePin,LOW); //timeout - disable driver stage
      } else
        digitalWrite(DccEnablePin,HIGH); //no timeout - enable driver stage


    • schreinerman

      well, thanks! I tried to post my ideas and thoughts and result was they deleted my entries because of possible conflicts of author rights regarding reverse engineering.

      So at least for me it is a nice toy, but I don’t know if other nerds and geeks would be as happy as me…

      (edit): In the meanwhile the MFX protocoll was opened by Märklin.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.