This is a Arduino library for decoding the signals from the Märklin-Motorola-protocol.
You can control your Arduino (and additional actors) with signals from your central control.
See on Wikipedia: Märklin Digital
DCC may not filtered correct at the moment.
Signal polarity from rail isn't relevant. Library is working with timings only.
Pin on Arduino must be Pinchange-interrupt-capable.
Example-Circuit to get required signal to Arduino:
Additional informations about the protocol
Protocol: