Traincontroller Gold File including Graphics (October 2015)

RMR_TCGoldThis is the download link for the TC Gold file, with the icons and backgrounds graphics. Please copy the yrrg file to the folder where you store your TC files. TC does not store background images inside the yrrg file. They can be placed in any folder and then double click the image icon (diagonal striped square) and tell TC where the image is stored.

The LCD is available in 4 colors, blue, orange, grey and green. The counters on the LCD screen have a comment that mentions the counter color used with each of the LCD colors.

Click the image to enlarge.

Arduino + ATtiny DCC Decoder / DCC Sniffer / S88 software download (October 2015)

Over time several types of the Arduino DCC decoder software have been made, such as accessory-, servo-, function-decoder, S88 interface, DCC sniffer, Sound software. All are available from now on in one overall zip download:

Arduino DCC, S88, and more Download link

schematicTo convert the DCC track voltage to the Arduino voltage level, an optocoupler circuit is used according to the image on the right. Click the image to enlarge.

To find the various blog posts and video’s on the subject please do a search (upper right, in header) on the words arduino decoder.

Please visit the Arduino website for download and installation of the Arduino development environment, needed to use Arduino sketches (‘sketch’ is the name for an Arduino software app).

Unzip the file and you’ll find the following folders:

The folders inside need to be moved to the Arduino Sketches/libraries folder on your PC. All other folders go into your Arduino Sketches folder.


Arduino sketch to control max 6 PWM channels that can control a 12V LED strip via nMOSFET’s. User manual desrcibing the needed hardware and how to configure the software is included.

Arduino sketch for a one address function decoder with max 13 outputs, controlled via the F0 – F12 buttons on your Command Station or handheld controller. More info on this post. Configuration is very straightforward:

int decoderAddress = 1830; // This is the decoder address, change into the number you want.
#define F0_pin 13 // Define the output pin for every Function number in use. 13 has on board LED.
#define F1_pin 0 // Available pin numbers: 3-19
#define F2_pin 0

#define F12_pin 0

ATtiny sketch for a one address function decoder with max 5 outputs, controlled via the F0 – F12 buttons on your Command Station or handheld controller. More info, see above.

Arduino sketch for DCC control of accessories. More info is available here. Configuration per output:

accessory[0].address = 1; // DCC address
accessory[0].mode = 1; // Continuous: HIGH until DCC switches the address off again
accessory[0].outputPin = 10; // Arduino pin to which this function is connected

accessory[1].address = 2;
accessory[1].mode = 2; // Oneshot: HIGH for ontime ms, then LOW and stays LOW.
accessory[1].outputPin = 11;
accessory[1].ontime = 1000;

accessory[3].address = 3;
accessory[3].mode = 3; // Flasher: HIGH for ontime ms, LOW for offtime ms, repeats till DCC off
accessory[3].outputPin = 12;
accessory[3].outputPin2 = 13; // Flasher can use 2 outputs, they will flash  on/off alternatively
accessory[3].ontime = 500;
accessory[3].offtime = 1000;

ATtiny sketch for DCC control of accessories. Configuration is identical to the Arduino version above.
See this post for more info on installation of drives and ATtiny support for the Arduino IDE.

Arduino sketch for DCC control of servos. Click here for a list of posts on the servo decoder.
Configuration per servo:
servos[0].address = 1; // DCC address for this accessory
servos[0].outputPin = 13; // Arduino pin number for additional accessory output
servos[0].servo.attach(3); //Arduino pin number where servo is connected to
servos[0].offangle = 68; //Angle for DCC=off
servos[0].onangle = 126; //Angle for DCC=on

Very basic sketch that I use to tune the servo’s min and max angles to switch a turnout. The workings are explained inside the software. Here are a few video’s. Min / Max values are displayed on screen and then need to be manually configured in the DCC_Servo sketch.

Version of the accessory decoder sketch that can be used to switch turnouts that use two coils for switching. Some additional hardware is needed to power the coils, the Arduino outputs do not deliver enough current for that. Configuration:
accessory[0].address = 1; // DCC address for this accessory
accessory[0].durationMilli = 250; //Duration of pulse in ms
accessory[0].outputPin = 12; //solenoid 1 connection
accessory[0].outputPin2 = 13; // solenoid 2 connection

Arduino sketch on DCC control of playing sounds. For use with the Sound Software that also is included in the download. This version only plays sounds, has no accessory or servo functions, just to make it simple to use. More info here.

Arduino sketch that combines ‘all in one’ control of accessories and servo’s and can play sounds using the additional PC sound software. There’s also a delay function, that makes it possible to delay an output. Useful for instance with a railway crossing: first the 2 lights start blinking (2 output flasher function) and the ding-ding sound starts to play, then some time later the servo moves the beams down.
More info here.

Sound_Software (For MS Windows PC’s only)
Software to install on the PC that works together with the Arduino DCC_Decoder_Sound sketch to play sounds, triggered by DCC.

Some sample sounds for use with the DCC_Decoder_Sound and the Sound Software.

Detailed description how to install and to use the Sound Software and the DCC_Decoder_Sound.

Arduino sketch for connection of track sensors to an S88 bus and transmit their data to a command station or PC.
See this post for more info

Arduino used as a 16-sensor S88 detector board (September 2014)

ArduinoUnoSmd I’d like to see if an Arduino can be used as an S88 16x detector board. Why? Well … for one it is just a fun challenge to see if we can get that to work. And next, more interesting, an S88 board sets you back some €40,- … an Arduino just some €6,- !

s88-timingThe S88 interface is a shift register with the timing diagram as shown in the image (info from this website). The ECoS sends out the “PS” and ‘Clock’ signals and reads the data line. I did some measurements on the ECoS. It sends out 512 clock pulses between the PS signals, which means it always reads the maximum of 32×16 detector inputs. With that knowledge I started work on the Arduino hardware and software.

The Arduino code can be downloaded here: Arduino s88 interface sketch.

The main loop scans all 16 inputs and stores the state in a 16 bit integer called ‘sensors’. Upon receipt of the PS pulse interrupt-1 is triggered, in which ‘servos’ is copied into an integer called ‘data’, after which ‘servos’ is reset to zero. Every ‘Clock’ pulse triggers Interrupt-0, which sequentially sends out the 16 bits from ‘data’ to the ‘dataOut’ pin, using a modulo 16 counter. After sending each bit it reads the data-in, to which the data-out of the next Arduino in the chain is connected. This way all sensors up to max 512 are sent to the Command Station.

s88-connectorThe wiring between ECoS and Arduino, looking at the S88 connector, from left to right:
S88 pin – Arduino pin
1 data – 13 (dataOut and LED indicator)
3 Clock – 2 ( =interrupt 0)
4 PS – 3 (=interrupt 1)
5 Reset – not used
6 Vcc – 5V
not conn – 12 (dataIn)

Arduino pin 12 is used for ‘data-in’. If more than one Arduino is used, they can be ‘chained’ by connecting the data-out pin 13 of the next Arduino to the data-in pin 12 of the previous Arduino. The first one in the chain has data out pin 13 connected to S88.

For the sensors anything can be used that pulls an Arduino input to GND, like a reed switch or an optical detector. I wanted to try the TRCT5000. See the hardware page for details. However … I changed to using reed switches and little magnets under the rolling stock. See this blog post for a video on that. The reason is that the IR sensors are too sensitive to surrounding light.

See this blog post for a video that shows the Arduino S88 board in action, initially with just one Arduino and max 16 inputs.

And see this blog post for a video that shows the final version of the software, with miltiple Arduino’s in ‘chain’.

ECoS screen on PC / tablet / smartphone via a VNC client

(Sep 2014) ECoS firmware 4 has a VNC server built in, which makes it possible to not only show the ECoS screen on your PC or tablet, but also to operate it! A very nice feature.

One could use the Internet browser and connect to the ECoS IP address. To get VNC to work Java Runtime Edition (JRE) needs to be installed and some Java security settings need to be modified. It’s all in the video mentione below.

In stead of using the web browser, the way I prefer is to use a VNC client on the PC, simply because it looks better. RealVNC has a viewer that has a small footprint. It does not even need an insall, just create a shortcut to the file and run it. Works very nice, with scalable window and some other options..

VNC clients are also available (for free) for tablets and smart phones. On the iPad I tried several. The one I liked best is the Mocha VNC Lite viewer.

See this post for a video on the connection and the use of the VNC server / client.

Connect ECoS to JMRI

(Aug 2014) See this blog post.

Connect ECoS to PaHaSoft Koploper

(Aug 2014) See this blog post.

Connect ECoS to Rocrail

(Aug 2014) See this blog post.

Software I use:

(Aug 2014) For model rail layout CAD: SCARM. It’s free and it’s easy to use.

For model railway simulation: Railroad-X , or actually I use the German version Eisenbahn-X. It’s the best model railway simulator I know, although opinions always differ of course.

For railraod control I intend to try out:
Traincontroller This is the software I currently use for layout control (Gold version). Many video’s are available on this blog on its use.
Koploper (a Dutch program, no English translation)
JMRI (Java Model Railroad Interface)

All are free software (iTrain is free with limitations, 3 types of licences are available fom €79,- onwards)


149 thoughts on “Software

  1. Hi! Since you’re reading this message then you just proved that ads submitted via web contact forms like yours works! We can send your promotional message to people via their feedback form on their website. The best part of this kind of promotion is that messages sent through contact forms are automatically whitelisted. This dramatically improves the likelihood that your ad will be read. Never any Pay per click costs! Pay a one time fee and reach millions of people. For more information please reply to:


    Posted by Felica Racine | October 19, 2019, 22:13
  2. Hello Rudy,

    can you help me how I can use the functions F13 – F 28 or F32 for the RB_DCC_Decoder_Function.
    Thank you for your help.


    Posted by Sonic | February 23, 2019, 09:21
    • The code for that is already partly in … it is made comment, you can uncomment lines 30-43, 84-95. Then at line 11 add lines like this: if (Func[3]&B00000001) digitalWrite(F13_pin,LOW); else digitalWrite(F13_pin,HIGH);


      Posted by RudyB | February 25, 2019, 10:06
  3. Dear

    I read your post, and i want to make dcc controller for turnout with two coils.
    I have a doubt.

    Could You help me plaese?

    I need hardware:

    -optocoupler circuit, i saw in this page.
    -Arduiono uno or mega

    Software: i can use your software

    Is that rigth?


    Posted by Marcelo Mendez | February 12, 2019, 16:58
  4. Hallo Rudy,

    Ik gebruik TrainController nu enige tijd met veel plezier (mede dankzij jouw video’s).

    Ik wil nu graag gebruik maken van de “line-up” functie. Ik heb alles hiervoor ingesteld wat moet, maar ik heb nog één probleem. Ik heb dit reeds op het (Duitse) forum van TC aangekaart, maar krijg helaas tot nu toe geen reacties…

    Ik heb mijn hoop daarom nu op jou gevestigd. Wat is nog het probleem?

    1) Er staan twee loc’s opgesteld in één blok (line-up).
    2) Ik start een “schedule” en de eerste lok vertrekt en de tweede lok rijdt automatisch verder in het blok, deze schuift dus op. Weliswaar met een kruipsnelheid, maar ik weet al dat dit niet aangepast kan worden, hopelijk wel met een eerstvolgende update van TC want dit is wel erg langzaam.
    3) TC stopt de tweede lok op het juiste moment, maar….
    4) de lok blijft ondanks dat gewoon doorrijden (kruipen). Alleen met de handregelaar op de Ecos kan ik ‘m laten stoppen, maar het is natuurlijk de bedoeling dat dit automatisch gaat.

    Geen idee wat nu het probleem is. Als ik de simulatie gebruik ziet alles er goed uit. Wel valt mij op dat bij de kruipende loc geen “computertje” afgebeeld staat bij “mode”. Maar aan de andere kant: de loc gaat wel rijden, hij komt alleen niet tot stilstand.

    In je video’s zie ik dat jij ook een Ecos hebt met TC. Hopelijk heb je voor mij de oplossing, ik wil wel erg graag gebruik kunnen maken van deze mogelijkheid, hij komt mij zeer van pas.

    Het enige wat ik verder op internet hierover kon vinden was een filmpje van Schacha’s MoBa Traum (ken je vast wel). Helaas geeft mij dat niet de oplossing. Wel kun je in dat filmpje zien dat de volgende loc doorschuift na vertrek van de eerste, en dat deze wel automatisch stopt, het zou dus wel moeten kunnen.

    Hopelijk heb je een oplossing voor mijn probleem. Al vast bedankt voor je reactie. Als je meer info nodig bent, hoor ik het graag.
    Douwe Jan Dijkstra


    Posted by Douwe Jan Dijkstra | February 5, 2019, 20:24
    • Douwe Jan, ik heb de “line up’ functie nog niet geprobeerd dus ik kan je er niet meer over vertellen dan datgene wat in de handleiding plus de help file staat. het is vreemd dat je loc niet stopt. Zou dat kunnen liggen aan het feit dat ie geen sensor met een stop marker triggert?


      Posted by RudyB | February 7, 2019, 21:04
      • Hallo Rudy, bedankt voor je reactie. Ik denk niet dat het aan de stop marker ligt. Ik zie namelijk dat TC wel op het juiste moment de loc laat stoppen, alleen de ECOS reageert daar niet op.
        Ik heb het nu eerst opgelost door het baanvak in twee blokken te verdelen en ingeregeld dat loc 2 automatisch doorschuift als loc 1 uit het eerste blok vertrokken is. Uiteindelijk heb ik dan hetzelfde effect.
        Mocht je nog een keer met de line up functie aan de slag gaan dan ben ik erg benieuwd naar je ervaringen.
        Douwe Jan


        Posted by Douwe Jan Dijkstra | February 12, 2019, 21:48
  5. Hello Rudy,

    Your sketches are really well done and quite easy to understand and to adapt.
    I have used the sketch: “RB_DCC_Decoder_Function” and rewritten so that with the keys F1 … F12 one mp3 file is played by the DFPlayer. F0 stops playback.
    That works pretty well as well. Now I would like to use but also the keys F13 … F28 and get that unfortunately not out.
    Either the Arduino hangs up and has to be restarted by pressing the Reset button or it only plays the same mp3 file.

    In the Sketch I unlocked the line 84-95. Line 98-110 I have extended to:
    if (Func [3] & B00000001) …… for F13
    if (Func [3] & B00000010) …… for F14
    if (Func [3] & B00000100) …… for F15
    if (Func [3] & B00001000) …… for F16
    if (Func [3] & B00010000) …… for F17
    if (Func [3] & B00100000) …… for F18
    if (Func [3] & B01000000) …… for F19
    if (Func [3] & B10000000) …… for F20

    if (Func [4] & B00000001) …… for F21
    if (Func [4] & B00000010) …… for F22
    if (Func [4] & B00000100) …… for F23
    if (Func [4] & B00001000) …… for F24
    if (Func [4] & B00010000) …… for F25
    if (Func [4] & B00100000) …… for F26
    if (Func [4] & B01000000) …… for F27
    if (Func [4] & B10000000) …… for F28

    But that does not work. What do I have to enter and change, which can also be switched to the functions F13-F28 and I thus 16 mp3 files can play more?

    Thanks for your help!

    Best regards,



    Posted by Sonic | January 19, 2019, 09:53
    • Hello,

      Can not anyone help me how I can use the other function keys?
      About Rocrail I can even drive to F32. How can I program the decoder, which he can also read out?

      Kind regards and thank you


      Posted by Sonic | January 28, 2019, 12:39
  6. Hello Rudy,
    Great video for people like me this topic is well missed at the beginner level. One thing I would request if you can post the Breadboard wire diagram for a newbie to work with



    Posted by Farhan Haider | November 22, 2018, 19:30
    • Which / what wire diagram are you referring to? If it s the opto coupler circuit, there is no breadboard or pcb, just a couple of components soldered onto a pcb with a holes pattern. You fould have a look at the website and purchase a complete parts set at cost price plus shipping.


      Posted by RudyB | November 22, 2018, 19:52
  7. Hy Rudy!
    I’m from Canada and i’m looking for a good DCC .
    I’m studying yours and I found a broken link to your TC gold Files.
    Can you help me.
    TKS in advance.


    Posted by Georges LAPOINTE | August 30, 2018, 21:21
  8. Hello Rudy,

    After watching your videos, I bought Train Controller. I use just like you an ESU Ecos. After a few days of trying, I recieved several times the following message:

    “Hardware problem occured. Digital system doen not respond”.

    When I shut down TrainController and I restart it, everything is working just fine.

    Any Idea what the problem is?

    Thanks in advance.

    Kind regards.
    Douwe Jan Dijkstra


    Posted by D.J. Dijkstra | August 19, 2018, 18:36
    • Obviously TC and the ECoS do find each other, but sometimes they lose their connection. Hard to say why … could be anything from a glitch in a software driver to a bad hardware connection. I would try the following:
      – Check if the network drivers are up to date. Maybe uninstall and install them again.
      – Switch off the PC (complete power off) and then start it again.
      – Same with the router.
      – Take out all network cables and plug them in again.
      – Try using different ports on the router.
      – Try another network cable.
      – Place the TC USB dongle in another USB port.


      Posted by RudyB | August 20, 2018, 07:52
    • Thanks! I will try your options.

      Douwe Jan


      Posted by D.J. Dijkstra | August 28, 2018, 14:27
  9. Dag Rudy, ik zou graag met de mynabay dcc lib CV’s kunnen aanpassen op m’n Attiny85 servodecoder. Zodat ik snelheid, enz. kan aanpassen via m’n DCC-centrale. Heb jij hier een voorbeeld van?


    Posted by Maxim De Donder | May 4, 2018, 12:40
    • Hoi Maxim. Heb je een DCC servo decoder werkend op de ATTiny85? In die code ben ik wel geinteresseerd. De enige keer dat ik iets gedaan heb met CV’s is in de DCC Sniffer, daar zit wat code in om een CV write DCC commando te detecteren. Misschien kan je daar iets mee.


      Posted by RudyB | May 4, 2018, 13:10
  10. Hi Rudy,
    First, great thank´s for all of your videos about TC! Very helpfull for me.. Question: can I use the graphic file to TC Bronze? Or there is an other file for Boronze I can use! Once again thank you! br anders


    Posted by Anders | January 4, 2018, 07:22
  11. Thanks for the link Rudy. The problem is the one on the software page points to a dropbox file which no longer exists.

    Best regards,


    Posted by Adrian Hall | November 13, 2017, 16:00
  12. Hi Ruud,

    I am working through your brilliant videos on Youtube as I use TrainController to operate my American Exhibition layout.
    Having reached video 26 I was so impressed with your graphics and with V9 coming out I decided to upgade from Silver to Gold.
    The only downside is that there are no graphics and when I tried to download your TC Gold file at the top of your page it says the link is not valid.
    Any chance that you could re-instate the link.

    Many Thanks,


    Posted by Adrian Hall | October 7, 2017, 22:07
  13. Hi Rudi,
    I follow your blog a while now and you did amazing things.
    Still want to try your S88N decoder based on arduino, but didn’t had time for it yet.
    Is there a schematic available how you setup this package?
    I’m designing pcb’s using eagle (arduino DCC decoder, DCC turnout decoder based on 2313 etc) and my prints are made by Seeedstudio.
    This week I got a mail from them with a S88 controller pcb design for 2rail and your website was in it for the software.
    Is this PCB design yours, or did someone else use your idea?
    If you want you can send me a mail so I can foreward you the mail from seeedstudio.

    I’m living near Bergen op Zoom, so it is not so far traveling. We just started a new railroad club in Bergen op Zoom (, maybe it is nice to visit eachothers clubs to Exchange Some idea’s

    Leo Ooms


    Posted by Leo Ooms | August 12, 2017, 09:40
  14. Hi Rudy.

    First, let me congratulate you and your friends for the amazing job on the arduino dcc servo decoder. Fantastic!!

    I am trying to replicate your servo & sound decoder. For now I am just playing around with software and no hardware.
    I tried opening your sound program but I get an error.
    “Runtime error 339 – Component MSCOMM32.OCX or one of its dependencies not correctly registered: a file is missing or invalid”.
    I tried downloading again the files but the error persists.

    I have a Windows 10 version 32bits.
    The problem is my computer? Or do I need to configure something else.

    Thanks in advance
    Filipe Almeida


    Posted by Filipe Almeida | June 9, 2017, 18:35
    • Seems this file is missing from your system. Best advice is to google MSCOMM32.OCX, there are plenty of links that advise on how to get and to register this file.


      Posted by RudyB | June 12, 2017, 12:12
      • Hi again

        Yep, that was it. I copied the file from another computer, registered again, and now the sound program works fine.

        By the way, do you know this sparkfun product, Tsunami Super Wav trigger?

        This board has 16 (3.3V) inputs that can trigger up to 18 stereo simultaneous audio files (stored in a sd card on the board). It also has 8 audio output channels, for up to 8 mono or 4 stereo pairs of small speakers.
        The arduino could be used to output 3.3V “high” after a DCC command is received and trigger this board.
        Additionally, the board can be programmed so that the sound can come out in any of the 8 audio outputs. Eight speakers nicely spread would give a nice ambient sound for the layout.

        As soon I manage to build your DCC decoder, I think I will give it a test.

        Thanks again
        Filipe Almeida


        Posted by Filipe Almeida | June 17, 2017, 13:05
  15. Hi, Is there a particular reason why you used a shottky diode parallel to the optocoupler instead of a normal, say 1N4001?




    Posted by Walid Khier | April 28, 2017, 12:08
    • Actually I use a LED there, it makes it easy to see the DCC is switched on or off. 🙂


      Posted by RudyB | April 28, 2017, 13:11
    • There is a Reversed Diode across the Diode inside the 6N137, to avoid the entire DCC Voltage being applied to the 6N137 in a way that the 6N137’s diode can’t conduct.

      Whatever diode you use, will determine what that Voltage is.

      Most Rectifier Diodes will conduct in less than 1V. A Shottky Diode will conduct in much less (Which is why these are sometimes used as Rectifiers, when there isn’t much spare Voltage to play with).

      A LED requires Higher Voltages to be able to conduct. Some are as high as 3.3V.

      The Datasheet for the 6N137 says that the Absolute Maximum Rating for the “Reverse input voltage” is 5V.

      As you can see, any Diode will conduct, before the 6N137 lets any ‘Blue Smoke’ out.!!!

      However, the importance of R1 can’t be ignored. It actually needs to be adjusted to the Voltage your Command Station puts on your Tracks. The 6N137 needs a minimum of 15mA of current to effect reliable transfer to the Output. The Absolute Maximum Rating is 50mA.

      So, you go for a value that lets at least 15mA through R1. But, if you have 18 Volts across your Rails (Less say 2 Volts for your Diode), you have 16 Volts and 15mA, which is 0.24 Watts (1/4 of a Watt). If you have a 1/8th Watt Resistor, you are going to ‘smoke’ it!!!

      All these considerations are in a document on building this Optocoupler.
      Go to:

      You can download a complete set of documents, include Notes that walk you though how to Calculate the Value for R1.

      If you decide to add C1. the notes make it clear that the correct value for C1 depends on the value of R1, because the 2 of them form a Low Pass Filter, to keep noise out of the 6N137. If you don’t have a Noise problem, then C1 can be omitted.

      Just be aware that any Electronic Component operating close to any of the Absolute Maximum Ratings is likely to be running very Hot (You know > 60 Degrees C), and could burn you if you touch it. That doesn’t mean something’s wrong, but the Notes suggest using Multiple Resistors in Parallel, and show you how to Calculate the correct Value for R1.


      Posted by Warren | April 28, 2017, 16:25
  16. If anyone is need help with building the Optocoupler circuit on some Veroboard, there is a ZIP download containing the Circuit, the Top & Bottom Veroboard Layouts, and a complete set of Notes on construction considerations.

    If you know how to identify Component Values, and can solder 8-Pin Integrated Circuits, it’s worth having a look here (The project is relatively easy):

    Liked by 1 person

    Posted by Warren | April 26, 2017, 16:48
  17. Hi Ruud,

    The sketch “RB_DCC_Throttle_28” does not appear to be part of the software download.
    From what I have read Digitrax does have a DCC sniffer so hopefuly it will work with my system.
    I would write my own sketch but as I an only starting out in using an Arduino It would take some time to write.
    I thought I would start with your sketch and modify it as I get to understand it better. When I was young I programmed in Fortran, Basic and Cobal. But that was a long time ago so I am really starting out from scratch in programming in C.


    Posted by Mark Sheldon | April 3, 2017, 00:35
  18. Hi Ruud,
    I am about to build you “DCC throttle for €6” but I cannot download the Arduino Sketch for it.
    I have a modular layout which I take to shows and I wanted a cheap throttle to run a couple of local industries on individual modules so the public could run a few switching moves. I think your cheap throttle would be perfect.
    The layout will be run by digitrax DCC.
    Thanks for any help you could give.


    Posted by Mark Sheldon | April 1, 2017, 23:50
    • Hi Mark. Dropbox had changed something. The link for the complete package on the software page should work again now. Be ware that the ‘throttle. works by grace of the availablity of a DCC sniffer on My ECoS, don’t know if the Digitrax has that feature?


      Posted by RudyB | April 2, 2017, 10:04
  19. Hoi Ruud,
    Reuze bedankt voor je super snelle reactie.
    Was ff wat experimenteren !

    Ik had de S88-bus-voeding op de juiste Arduino-5V-pin. Ook alle andere pinnen waren goed aangesloten.
    Ik heb geen stroomverbuik (0,00mA) gemeten.

    MAARRRR: Met gebruikmaking van de USB-voeding (en de S88-bus-5V losgekoppeld, en alle GND’s verbonden) werkt de UNU nu wel als een trein, inclusief 2 opvolgende (Viessmann-)S88-modules in de keten !

    Zowel met de Ecos2-S88-bus onbelast als met alleen de arduino in de keten, meet ik over de Ecos2-S88-bus-5V een spanningsverschil van 0,00 Volt !
    Met de Viessmann-modules in de keten erbij, meet ik 4,0 Volt.

    Ik heb geen idee waarom het zo werkt !

    Hoe dan ook, hij doet het wel ! ! !



    Posted by Wim | November 14, 2016, 13:15
  20. Beste Ruud,
    Ik wil heel graag jouw S88-Arduino-versie gaan gebruiken, maar nu blijkt dat mijn Arduino Uno aangesloten op de ECOS2-S88-bus, zoals door jouw beschreven, blijkbaar geen/niet genoeg spanning kriigt (Het groene Powerledje brandt niet).
    Met de Arduino aangesloten op de S88-bus meet ik over de S88-bus-5V 1,4 Volt.
    Ik heb een originele Italiaanse Arduino Uno R3 (Met een lange Atmel ATMEGA328P chip).

    In jouw video’s zie ik een UNO met andere componenten (waarschijnlijk een chinese variant ?).
    Kan het verschil in componenten dan de reden zijn waarom het bij mij niet werkt ?

    Het alternatief is dan een externe voeding (7 – 12 Volt ) aansluiten op de “board’s power jack” en dan ook de Arduino-“ground” verbinden met de S88-bus-ground ?

    Is dan galvanisch scheiden met opto-couplers ook een beter/veiliger idee ?

    Bij voorbaat mijn hartelijke dank.
    Groeten, Wim


    Posted by Wim | November 13, 2016, 12:51
    • Wim, ik kan me niet voorstellen dat welk type Arduino dan ook zoveel stroom trekt dat ie de EcOS voeding van de S88 bus te zwaar belast. Er moet haast wel een andere oorzaak zijn. Heb je de spanning al eens onbelast gemeten? Is de Arduino op de juiste manier aangesloten op de voeding (rechtstreeks op een 5V pin)? Wat doet de voeding als je er een weerstand van 100 ohm aan hangt (waardoor er 50 mA gaat lopen)?

      Een externe voeding is overigens prima te gebruiken mits je de nullen aan elkaar legt.


      Posted by RudyB | November 13, 2016, 14:18
  21. Simply want to say your article is as astonishing.
    The clearness in your post is just great and i can assume
    you are an expert on this subject. Well with your permission let
    me to grab your feed to keep updated with forthcoming post.

    Thanks a million and please carry on the enjoyable work.


    Posted by internetseminarcomplaints | November 2, 2016, 02:50
  22. Beste Rudy,

    Je decoder software is echt geweldig! Ik ben er met veel plezier mee aan het werk, maar ik wil graag het volgende: Ik heb een perron waarin ik alle onderdelen (seinen, wissels etc.) wil kunnen aansturen. ik wil graag de arduino inbouwen in het perron en dat gedeelte is klaar. Helaas heb ik een probleem met de MCP23017 IO-extender. Het is niet mogelijk om jouw sketch te gebruiken icm i2c(twi) of zelfs de serial library. Heb jij enig idee hoe dit op te lossen is of waar het probleem zit/kan zitten?

    Het mooie van deze extenders kan zijn dat je voor 2a3 euro 16 extra poorten hebt voor 1 arduino. Seinbruggen, seinen wissels en ontkoppelaars kunnen dan vanuit 1 enkele sketch worden aangestuurd en ook worden debuged wat kan resulteren in een automatisch werkende modelbaan.

    Hopelijk kun je me hiermee helpen 🙂




    Posted by Joost | August 29, 2016, 13:17
    • Joost, i2c is wellcht wel bij te bouwen, maar ik heb daar momenteel geen tijd voor. Ik begrijp overigens niet precies wat het voordeel is van de module is die je noemt … voor hetzelfde berag van 2,70 heb je een tweede Arduino en heb je weer 16 extra uitgangen.


      Posted by RudyB | August 29, 2016, 13:40
      • Beste Ruud, het probleem van tijd tekort ken ik :p voor mij is t voordeel dat je zowel wissels als seinen vanuit 1 module kunt schakelen. Ik ben vaak niet in buurt van de hardware en modelbaan, dus simpel programmeren lukt dan wel maar testen niet.

        Mijn bedoeling is dat ik de module in een klein perron inbouw. Als de wissel wordt geschakeld, dan moeten de seinen (Zwitsers) in de omgeving automatisch worden omgezet aan de hand van deze wisselomzetting. Dus met een Zwitsers sein heb je als je pech hebt al 8 arduino uitgangen nodig alleen voor de seinbeelden.

        Dus dacht van Arduino is snel/sterk genoeg dus probeer de poorten uit te breiden zodat ik niet 10 arduino’s nodig heb in 1 perron




        Posted by Joost | September 2, 2016, 09:33
      • Heeft een zwitsers sein 8 items die aangestuurd moeten worden? Anyhow, kwa prijs maakt het denk ik niet veel uit. Kwa ruimte misschien, je kunt de ‘nano’ overwegen die is de helft kleiner. Kan je de Arduino’s onder de plank plaatsen?


        Posted by RudyB | September 5, 2016, 10:17
      • Beste Ruud,

        Een volledig hoofdsein van de SBB heeft 7 of 8 lampen voor 8 fahrbegriffe + een voorsein voor het volgende signaal dus kan zelfs 13 lampen zijn.

        Het is me waarschijnlijk gelukt om de MCP aan te sturen dmv I2C. Het blijkt dat I2C routines in de DCChandler moeten en niet in de loop (waarom begrijp ik alleen niet maar t werkt 🙂 ).

        Jouw code is echt geweldig aangezien het dus nog heel veel meer kan dan in eerste instantie blijkt!

        Als je wilt wil ik PM sturen van hoe de Arduino en IO extender zijn verwerkt

        Nogmaals bedankt voor zulk veelzijdig stuk code!




        Posted by Joost | September 19, 2016, 16:33
  23. Hey Rudy,
    here i am 🙂 hope that you can help me!



    Posted by Max Kosma | June 24, 2016, 19:21
  24. Beste Rudy, als leek probeer ik Arduino_DCC_s88 te dowmnloaden via BOX maar er gebeurt niets . Wat doe ik verkeerd??


    Posted by Martin Rummens | May 31, 2016, 13:10
  25. Hi Rudy,

    your videos are absolutely great. Best ever seen on internet !!

    My question is about kato turnouts. These have single coils to switch with a short impuls (1/2 Sek.) with 12V in one direction and -12V the other way. On my Arduino test board with UTFT Display the turnout can be switched with a relais card using 3 relais ( 2 change 12V / -12V and 1 giving short impuls to switch).

    // switch turnout
    digitalWrite(Pin_To_RELAY1, LOW); // or HIGH –> Turns ON / OFF Relays 15 u. 16 with one Arduino pin
    // 12V Impuls on for 1/2 sec.
    digitalWrite(Pin_To_RELAY_12V, HIGH); // second arduino pin
    digitalWrite(Pin_To_RELAY_12V, LOW);

    I have no idea how to get it working via Ecos and your arduino software.
    Turnouts with Servos only have one pin to switch but kato needs more code. Any idea how this could
    be done ?

    Best regards,


    Posted by helmut schmied | May 30, 2016, 20:13
    • Hello Helmut, if you’d download the zip file from the ‘Software’ page, there’s a ‘Solenoid’ file in there. It is specially made for situations like you describe, two outputs are used and they give a pulse of a configurable length. I read you use a relais to switch the 12V. You might consider to use an NMOSFET, it’s cheaper and in the long run probably more reliable.


      Posted by RudyB | May 30, 2016, 21:01
  26. Beste Rudy,

    Ik ben nu bezig om schakeldecoders in mijn perron te bouwen om alle objecten in de buurt van dit perron aan te drijven zoals de wissels. Deze wissels zijn Fleischmann profi-gleis wissels met standaard “solenoid” aandrijving van fleischmann. Maar ik heb om de wissel om te zetten 2 output pins nodig bij mode 2 maar ik krijg de wissel wel geschakeld, maar niet meer terug. Heb jij dit probleem al opgelost?




    Posted by Re465 | March 6, 2016, 21:21
    • Joost, ik ben me er niet van bewust dat dit een probleem was / is. Komt er bij terugschakelen vanuit het cammand station geen puls uit de tweede output pin? Ik zal je een email sturen, dan kunnen we het mogelijk oplossen.


      Posted by RudyB | March 7, 2016, 11:33
  27. Hello Rudy
    First thank you for all your videoes with espechally Traincontroller . Videoes that helped us very much getting startet.
    With big interest we have looked at S88 solutions using Arduino UNO. We got one and so far its possibly to set it up and when toutching with a finger we can read a feed back form various inputs 1 to 16. We are though driving mixed MM and DCC on Märklin C tracks, where one track is isolated so the wheels create a contact to activate a return signal…
    When we testet the Arduino putting a wire to the isolated track, our system read the track as it was accupied, but there was no connection between the tracks. Do we need some sort of electronics to get a clean signal when we are driving mixed or…. ?
    Hope you understand the question.


    Posted by Martin Nielsen | February 27, 2016, 10:37
    • Hi Martin. What the S88 Arduino needs is a 0v / 5v signal at it’s input. When using ‘current detection’ as sensor, indeed some additional electronics is needed. Schematics for this can be found if you’d google some.


      Posted by RudyB | February 27, 2016, 12:28
  28. Did you get my questions?


    Posted by Carl Jaeger | February 16, 2016, 19:13
  29. Hallo Ruud,
    I have a problem with chaining of Arduino for S88 detections.
    I use Intellibox IR and 1 Arduino Uno with 328 processor and 1 Arduino Duemillanove with 168 processor. When I try, each one delivers the S88 signals correctly at pin13.
    But if I chain, and I put Pin13 of the 2nd Arduino to pin12 of the 1st, I cannot detect any signal on the 2nd Arduino.

    My questions:
    -might this depend on the Intellibox?
    -must this be always the same Arduino?
    -which reason else might cause this troubles?

    When I connect the Gnd to one of the inputs, the LED 13 is flickering, so it seems, that Arduino is detecting signal, but from 2nd one I don´t get it to Intellibox.

    Thanks for help



    Posted by Carl Jaeger | February 16, 2016, 19:01
    • I don’t think it is the Intellibox.
      I always prefer similar Arduino’s, the UNO, then I am certain that the Interrupt 0 works at pin 2. Different types may use different interrupt pins.
      I found that I needed to GND the pin 12 of the last Arduino in the chain to get things wiorking reliable.
      Also … it may be needed to tinker a bit with the one timing value that is in the software, not all S** buses use the exact same timnimg.


      Posted by RudyB | February 19, 2016, 13:46
  30. Ciao Rudy,
    how many solenoid it’s possible to configure in hardware and software in “RB_DCC_Decoder_Solenoid”?


    Posted by Fabio | February 6, 2016, 08:41
  31. Hallo Rudy,
    ik wilde de complete set software voor de arduino downloaden maar de link werkt niet.
    Enig idee wat er aan de hand is?

    Mvg Rieks


    Posted by Rieks | February 2, 2016, 20:25
    • Geen idee Rieks, hier werkt de link. Browser cache legen en cookies verwijderen helpt misschien? Of een paar keer Ctrl-R om de pagina opnieuw te laden?


      Posted by RudyB | February 2, 2016, 20:42
    • Hallo Rudy,

      Zowel in IE als Firefox kan ik ook niet je software downloaden. Jammer, want ik ben echt benieuwd naar je werk. De Uno staat al te knipperen. Maar bedankt voor al je werk en inspanning en het delen hiervan.

      Groeten John


      Posted by John | February 4, 2016, 20:10
      • Ik ga er naar kijken … maar als ik nu wist over welke link op welke pagina / post het precies gaat? Zoudenjullie dat even kunnen aangeven?


        Posted by RudyB | February 4, 2016, 21:13
    • Hi Ruud from the UK

      I also cannot download the file on Box

      I have tried IE with cleared history, Firefox and Chrome but none will work on either download link within the grey screen.

      Many thanks

      Tim D


      Posted by Tim D | February 5, 2016, 22:10
      • Yes, I’ve tried myself too and indeed the download does not work, while the link is correct. I’ll look into it some more, try to find out what this is. Else I’ll make some new links from another service than and I’ll let you all know.


        Posted by RudyB | February 5, 2016, 23:49
      • OK guys … download links are up again. I chnaged from to dropbox, that was a drastic solution, but at least it works! 🙂


        Posted by RudyB | February 6, 2016, 13:19
      • Hi Ruud

        Many thanks for rectifying the download issues I now have the zip and can start to play with the sketches

        Also thanks for your excellent website

        Tim D


        Posted by Tim D | February 17, 2016, 23:56
    • Ruud,
      bedankt voor de nieuwe link.
      Ik ga binnenkort even expirimenteren


      Posted by Rieks | February 8, 2016, 20:01
  32. Hallo Ruud, ik heb een soortgelijk probleem wat hierboven ook al is vernoemd. Ik rijd met Rocrail en een DDX software centrale. Ik gebruik voor de wissels een Arduino Uno. Als ik het programma RB_DCC_Sniffer in de Arduino laad worden alle wisselcomando’s keurig op het scherm getoond en wordt er niet een overgeslagen. Ik test dit eerst met een Multimaus en daarna met DDX. Wanneer ik echter in dezelfde Arduino het programma RB_DCC_Decoder_Accessory_Servo_sound+Delay laad werkt dit met de Multimaus prima, maar met de DDX wordt er slechts sporadisch een commando herkend. Is dit een kwestie van timing? Ik heb het idee dat de verwerking van de DCC commando’s bij de verschillende programma’s niet hetzelfde is. Kan ik de timing van het decoderprogramma veranderen?


    Posted by Anton | January 31, 2016, 16:07
    • Klopt, de Snoffer werkt met de NMRA DCC software bibliotheek en de Decoder met de Mynabay. Als je in de Mynabay bibliotheek kijkt dan zie je in de decoder.ccp file bovenaan een aantal timings staan voor one en zero. Daar kan je mee spelen.


      Posted by RudyB | January 31, 2016, 17:10
  33. Hi Rudy,
    I have a problem to work with Arduino Mega 2560 and IB Central Unit.
    I change in sketch “Dcc_Decoder_Solenoid”:
    Line accessory[0].address = 10 and pinMode(21,INPUT_PULLUP); //Interrupt 0 with internal pull up resistor (can get rid of external 10k) without any result.



    Posted by Fabio | October 31, 2015, 09:20
  34. Hallo Ruud,

    thanks a lot your immediate help and support.
    Everything is working fine.

    Best regards to Netherlands.



    Posted by Carl | October 8, 2015, 15:41
  35. Hallo Ruud,
    I used your file “DCC function decoder” dated from 25.01.2015, I did not find other one.
    In that file at my case flasher doesn´t work, maybe you can check.

    Than I have another problem where I hope you can help me.
    Quite often it happens, that a programm from arduino disappears, when I use external AC adapter.
    I already checked that power supply, but voltage is correct and even by oscilloscope I didn´t find any fundamental problem.
    When I load program again from pc, its working well.
    Maybe you have some idea herefore.

    Best regards and thank you in advance.



    Posted by Carl | October 8, 2015, 09:36
    • I uploaded the software again. it can be downloaded from the Software page under the chapter Arduino DCC Function Servo Sound Decoder: prog_char error. There are many files inside the zip, the one called RB_DCC_Decoder_Function contains a flasher that worked over here with me, just tested.


      Posted by RudyB | October 8, 2015, 11:49
  36. Hallo Ruud,
    today i made some experiments with your “DCC function decoder”.
    Fundamentally its working well, but I have some questions:
    1. when I make copy and paste to multilply the functions, do I have also to increase the number (0,1,2 ….) which is mentioned in each line of that accessory?
    When I just copied and pasted without changing that number, it did not work well
    2. when I use your original file, the flash-mode does not work, is there any mistake?
    3. in the line where I have to fill in maximum quantity of functons (maxaccessory….), there is noted 3 in your original file. Is that correct, because you have 4 functions in it?

    I would be thankful for your help.

    Best wishes from Germany



    Posted by Carl | October 7, 2015, 11:54
    • 1: Yes, the numbers in the array should increase, starting at 0.
      2: With me the flash function works. Which file did you download? Then I’ll download that too and have a look if that maybe is a different file that contains a mistake. My version management sucks. 🙂
      3: If you have 2 functions, maxaccessories should be 2 and the array should have numbers 0 and 1.


      Posted by RudyB | October 7, 2015, 13:18
  37. Hallo Ruud,
    thank you very much for your quickest help.
    I have already downloaded that scetch and I will try within the next days.
    I will come bach to you.

    Best regards



    Posted by Carl | October 7, 2015, 07:52
  38. Hallo Ruud,

    thank you very much for your sudden reply.
    From now on I will check your site each day.

    Best regards from the middle of Germany



    Posted by Carl | October 6, 2015, 09:25
  39. Hallo Ruud,
    I am new here an dI must say, congratulations to your software for dcc decoders.
    i woulkd be very much interested to know, whether you or somebody else, already had an idea for an arduino scetch for DCC or MM decoder who can switch junctions with magnetic switches.
    I would be very thankful for help.

    Best regards



    Posted by Carl | October 5, 2015, 18:45
    • Hi Carl. Yes I have made that software for someone who has points with solenoid drive. It uses two outputs to drive the coils for an adjustable amount of ms and then turns of again. I will post ot on the software page one of the coming days. Just have a look there every now and then.


      Posted by RudyB | October 5, 2015, 18:54
  40. Hi rudy, I love your TC videos.. Can you please do one on profiling locomotives
    Thank you Darren johns of Australia


    Posted by Darren johns | July 9, 2015, 13:21
  41. Hello Rudy,

    On 25/1 you’ve published a new version of the servo decoder software (RB_DCC_Decoder_Servo.ino). Unfortunately there is no version numbering in the .ino-files itself. May I suggest to use a version numbering system in the comment section of each file?
    Something like:
    // version 1.2, 19/1/2015:
    // version 1.3, 25/1/2015:

    Also please add more in source comment to the individual procedures
    It makes it more professional.

    I also ordered an Arduino development kit with a servo at AliExpress. It will be connencted to the Daisy II command station of Uhlenbrock. It would be great if that also works.



    Posted by Nico Teering | January 25, 2015, 18:01
  42. Hallo ruud

    ik heb inmiddels je oudere versie van de software geinstalleerd, die werkt probleemloos.
    Als ik met de nieuwe versie werk zie je nauwlijks beweging in de servo’s ( ook al zijn de draaihoeken fors ingesteld)
    Ik heb als quickfix even gekeken naar de volgorde van de statements in de “main” loop. Het naar boven halen van de servo opdrachten gaf verbetering . Mogelijk wordt dat gedeelte van het programma niet goed bereikt door de statements erboven die met return afgesloten worden.
    Mischien geeft de multmaus die ik gebruik toch wat andere signalen af dan de ecos die jij gebruikt.


    Posted by dick koning | January 19, 2015, 08:08
    • Dick, ik zal er eens ‘induiken’. Ik ga waarschijnlijk toch nog een paar aanpassingen doorvoeren, dan onderzoek ik dit ook even. Zou je kunnen aangeven welke twee versies je gebruikt hebt, en welke OK werkt en welke niet?


      Posted by rudyb2014 | January 19, 2015, 10:07
  43. hallo ruud

    ik heb je servo schakeling nagebouwd maar hoewel het dcc commando wel herkend wordt (led 13 licht op) zie geen of slechts minimale beweging van de servo’s
    Heb je enig idee waar ik de fout moet zoeken ?

    dick koning


    Posted by dick koning | January 18, 2015, 19:43
    • Dick, dat het DCC commando binnenkomt is het belangrijkste, en dat (b)lijkt dus goed te gaan. Hoeveel de servo beweegt hangt af van de in de software opgegeven min en max ‘angle’. Alsdie niet aangepast zijn, dan zal de servo inderdaad een kleine verdraaiing maken. Als je die waarden verder uit elkaar legt dan wordt de draaihoek groter. Om per servo de benodigde min en max hoek interactief te bepalen is er een tweede programmaatje genaamd DCC-servo-tuning.


      Posted by rudyb2014 | January 18, 2015, 20:20
  44. Thanx for your fast response.
    This ignor effect takes place in average for one time after 10 to 30 switch commands from RocRail.
    Didn’t you remember about such an effect during testing your servo application?


    Posted by Klaus | January 16, 2015, 13:58
    • Klaus, I haven’t seen the effect yet. Bet then … I have not done any ‘endurance’ testing so far. I’ll get back here if I see something similar, once I am at the point in time to test the 23 junctions on my layout for some serious time in a row.


      Posted by rudyb2014 | January 16, 2015, 14:02
  45. Hallo Ruud,
    really excellent work 😉 !!!!
    I started to create a decoder for 25 magnetic switches based on your code and optocoupler layout. I use a 2560 Mega Arduino in connection with Rocrail and the 1st tests were successfully except one point ;-(.
    Sometimes (randomly) I send a switch command from RocRail but the Arduino ignores this command. On the Arduino side of the optocoupler I connected an oszilloscope to have a look to the DCC signal. This signal seems to be in optimal shape. To save costs I plan to install the switches without feedback, but if sometimes the DCC command will be ignored this would not be so nice.
    Do you have an idea where this effect come from?

    Best regards


    Posted by Klaus | January 14, 2015, 19:23
    • That’s a tough one Klaus. Always difficult to find the cause of something that happens just every now and then, randomly. Nice that you had an oscilloscope available and could check and see that the DCC signal looks good. Maybe we can not completely rule it out as a possible cause yet, but let’s assume that the signal really is 100% ok, then it must be something in the software. Since the code always does the same thing if the DCC command came through, I would look in the direction of interrupt handling and timing, causing the DCC command not to come through correctly. Maybe something unexpected happens there. Alas it would mean an in depth study to figure that out.

      Maybe if you try the ‘minabay’ DCC monitor and you keep switching a point, it is possible to see in the printout that every now and then the DCCcommand came through different? Just a test.


      Posted by rudyb2014 | January 14, 2015, 21:14
      • Hello Rudy,
        Thank you for sharing these great projects. I’ve have created six decoders to drive some leds, and also created some of your S88s and servo decoders. They work great with my Ecos. But the decoder ignores the dcc commands sometimes, I found when my new Bemo and a Trix locos are running this problem occurs. I wonder if these locos create a lot of noise on the dcc track. Is there a way to suppress this noise? Thank you in advance.


        Posted by Oji | February 11, 2019, 17:41
      • Always very difficult to diagnose these effects that happen only every now and then. If it is a problem of ‘unclean’ DCC signals, you could attempt to use a small capacitor on the input of the optocoupler. But I doubt if that eill help. Wr have a couple of locs here at the club too that seem to introduce so much disturbance that some DCC decoders get confused and certain junctions servo’s do not switch. Always those same lovo’s that give the trouble. ESU Lokpilot 4 sounddecoders are notorious for the troubles they sometimes introduce.


        Posted by RudyB | February 11, 2019, 19:20
      • Thank you Rudy.
        I have added a small capacitor and did not work as you said.



        Posted by Oji | February 15, 2019, 12:07
      • Then unfortunately we have to suspect the engines to disturb the signal. We have had it here to with a couple of engines … with one the solution was to adda capacitor on the engine decoder, with the other even that did not help.


        Posted by RudyB | February 15, 2019, 12:26
      • Thank you Rudy. I just found by reducing the speed helps to minimize the problem plus the direction of the engine too.
        Thank you again


        Posted by Oji | February 18, 2019, 15:43
  46. Hallo Ruud,
    Ik was reeds twee jaar geleden bezig om dmv een arduino zaken op mijn in opbouw zijnde trein aan te sturen.
    Heb toen lang gezocht naar een library oid om daarmee te werken. Er was niet iets voor mij te vinden waarmee ik kon werken. Een week geleden de hobby maar weer eens opgepakt, via jouw site kwam ik bij mynabay terecht.
    Eerst maar eens hun DCC monitor ge-upload naar mijn arduino en de schakeling met de 6N137 gemaakt.
    En: direkt data op de rs232 monitor. WERKT!! dacht ik tenminste. Daarna jouw DCC servo en functie decoder aangepast en in de arduino gezet. Niet dus, af en toe data… DCC monitor weer gestart en daar bleek dus ook dat ik lang niet alle data verscheen. Ik gebruik een Z21 centrale en een aduino duemilanove met atmega328 processor en de schakeling zoals door mynabay gepubliceerd met de 6n137. De centrale staat op 20 volt, verder keb ik wat geexperimenteerd met de waarde van de 1k weerstand. Heb jij enig idee?

    Groet, Erik


    Posted by Erik Holewijn | January 10, 2015, 10:39
    • Hoi Erik. Altijd lastig als het niet goed werkt om te ontdekken wat de oorzaak is. In dit geval zou ik toch twijfelen aan de zuiverheid van het bij de Arduino binnenkomende 5V DCC-data signaal. Als die ok is, dan doet de mynabay software echt wel de goede dingen.

      Zeg nooit ‘nooit’ … maar in dit geval zou ik daar eerst zoeken. Hoe het signaal eruit ziet is moeilijk te checken zonder oscilloscoop. Ik heb zelf ooit een paar regels software geschreven die de tijd meet, in us, tussen de flanken, waarmee ik kon nagaan of de pulsbreedte klopte met de DCC specificaties. Die is rond de 50 ms voor een ‘1’ en rond de 100us voor een ‘0’.

      Welke diode, die omgekeerd over de opto-coupler zit aan de DCC kant, heb je gebruikt? Is die misschien niet snel genoeg? Anders inderdaad wat experimenteren met de 1k weerstand. Maak hem iets kleiner, maar zorg wel dat de stroom niet veel hoger wordt dan 20mA. Iets groter is ook te proberen. Soms is het DCC signaal zelf al vervormd. Flanken behoorlijk afgevlakt, of voorzien van opslingeringen … dat alles is helaas alleen goed te meten met een oscilloscoop. Heb je lange draden lopen, of is alles kort bij elkaar … dat kan ook uitmaken.


      Posted by rudyb2014 | January 10, 2015, 12:53
  47. Hi, Rudy.

    I’ve written a library to drive any kind of accessories, and I use also the well done Mynabay library, but I loose a lot of Dcc packets and dont know why. You speak of an optocoupler not fast enough to do this kind of job… Which fast optocoupler have you found for your work ?



    Posted by Thierry Paris | November 30, 2014, 17:28
  48. Hi, Rudy.

    Great work with DCC decoder for servos. I am using also library from Mynabay. I have made a DCC decoder based on their library. I have tried your’s and is working great. But, I have problem with both scripts, yours and mine. On Marklin/Trix Mobile Station 2 everything is working well, but when I am changing to Roco Multimaus, or to Yaasans Desktop Station with his DCC/MM2 shiled Decoder is not working. I am using DCC system on my laout. You can see my work on, link to Yaasans page

    I am using Arduino Uno R3, with DCC/MM2 shield for driving trains on my laoyut, but I am testing solution for my friend, but he is using Roco MM on his.

    Any idea or will be great.

    Thank you in advance,

    Best regards,


    Posted by Sebastjan | October 11, 2014, 09:59
    • Sorry I am so late … completely overlooked your question. With some brands there is a shift of 4 in the addresses. I thought that the Rocomaus was one of them. Solution is to change the DCC_decoder.ino code where it says “// Convert NMRA packet address format to human address”: change address += 1; into address += 5;


      Posted by rudyb2014 | April 5, 2015, 10:00


  1. Pingback: Workshop – Teil 2: Und es wird (vielleicht) doch digitalisiert | BC Northern Rail - March 15, 2019

  2. Pingback: Arduino and model trains. | cyber7 - May 23, 2018

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Archive of all posts

%d bloggers like this: