Software

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:

libraries
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.

RB_RGB_LED_Control

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.

RB_DCC_Decoder_Function
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

RB_DCC_Decoder_Function_ATtiny
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.

RB_DCC_Decoder_Accessory
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;

RB_DCC_Decoder_Accessory_ATtiny
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.

RB_DCC_Decoder_Servo
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

RB_DCC_Decoder_Servo_Tune_v3.0
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.

RB_DCC_Decoder_Solenoid
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

RB_DCC_Decoder_Sound
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.

RB_DCC_Decoder_Accessory_Servo_Sound_Delay
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.

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

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

RB_S88
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.

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.

Connections:
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)
2 GND – GND
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.

Videos:
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.
Rocrail
Koploper (a Dutch program, no English translation)
JMRI (Java Model Railroad Interface)
iTrain

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

Advertisements

Discussion

93 thoughts on “Software

  1. 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,
    Adrian

    Like

    Posted by Adrian Hall | November 13, 2017, 16:00
  2. 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,
    Adrian

    Like

    Posted by Adrian Hall | October 7, 2017, 22:07
  3. 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 (http://www.facebook.com/mscboz), maybe it is nice to visit eachothers clubs to Exchange Some idea’s

    Greetz,
    Leo Ooms
    MSC-BoZ

    Like

    Posted by Leo Ooms | August 12, 2017, 09:40
  4. 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

    Like

    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.

      Like

      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? https://www.sparkfun.com/products/13810

        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

        Like

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

    Regards

    Walid

    Like

    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. 🙂

      Like

      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: https://talkingtracks.com.au/TT_Projects.shtml

      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.

      Like

      Posted by Warren | April 28, 2017, 16:25
  6. 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):
    https://talkingtracks.com.au/TT_Projects.shtml

    Like

    Posted by Warren | April 26, 2017, 16:48
  7. 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.

    Like

    Posted by Mark Sheldon | April 3, 2017, 00:35
  8. 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.
    Mark

    Like

    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?

      Like

      Posted by RudyB | April 2, 2017, 10:04
  9. 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 ! ! !

    Groetjes,
    Wim

    Like

    Posted by Wim | November 14, 2016, 13:15
  10. 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

    Like

    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.

      Like

      Posted by RudyB | November 13, 2016, 14:18
  11. 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.

    Like

    Posted by internetseminarcomplaints | November 2, 2016, 02:50
  12. 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 🙂

    MVG

    Joost

    Like

    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.

      Like

      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

        MVG

        Joost

        Like

        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?

        Like

        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!

        MVG

        Joost

        Like

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

    Max

    Like

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

    Like

    Posted by Martin Rummens | May 31, 2016, 13:10
  15. 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
    delay(500);
    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,
    helmut

    Like

    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.

      Like

      Posted by RudyB | May 30, 2016, 21:01
  16. 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?

    MVG

    Joost

    Like

    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.

      Like

      Posted by RudyB | March 7, 2016, 11:33
  17. 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.
    Regards
    Martin
    Denmark

    Like

    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.

      Like

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

    Like

    Posted by Carl Jaeger | February 16, 2016, 19:13
  19. 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

    Carl

    Like

    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.
      Success.

      Like

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

    Like

    Posted by Fabio | February 6, 2016, 08:41
  21. 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

    Like

    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?

      Like

      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

      Like

      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?

        Like

        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

      Like

      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 box.com and I’ll let you all know.

        Like

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

        Like

        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

        Like

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

      Like

      Posted by Rieks | February 8, 2016, 20:01
  22. 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?
    Groeten,
    Anton

    Like

    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.

      Like

      Posted by RudyB | January 31, 2016, 17:10
  23. 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.

    Tnx
    Fabio

    Like

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

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

    Best regards to Netherlands.

    Carl

    Like

    Posted by Carl | October 8, 2015, 15:41
  25. 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.

    Carl

    Like

    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.

      Like

      Posted by RudyB | October 8, 2015, 11:49
  26. 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

    Carl

    Like

    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.

      Like

      Posted by RudyB | October 7, 2015, 13:18
  27. 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

    Carl

    Like

    Posted by Carl | October 7, 2015, 07:52
  28. 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

    Carl

    Like

    Posted by Carl | October 6, 2015, 09:25
  29. 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

    Carl

    Like

    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.

      Like

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

    Like

    Posted by Darren johns | July 9, 2015, 13:21
  31. 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.

    Regards,
    Nico

    Like

    Posted by Nico Teering | January 25, 2015, 18:01
  32. 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.

    Like

    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?

      Like

      Posted by rudyb2014 | January 19, 2015, 10:07
  33. 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

    Like

    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.

      Like

      Posted by rudyb2014 | January 18, 2015, 20:20
  34. 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?
    Best
    Klaus

    Like

    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.

      Like

      Posted by rudyb2014 | January 16, 2015, 14:02
  35. 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
    Klaus

    Like

    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.

      Like

      Posted by rudyb2014 | January 14, 2015, 21:14
  36. 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

    Like

    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.

      Like

      Posted by rudyb2014 | January 10, 2015, 12:53
  37. 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 ?

    Regards,
    Thierry.

    Like

    Posted by Thierry Paris | November 30, 2014, 17:28
  38. 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 http://www.potepanja.eu/modelarstvo, link to Yaasans page http://www.yaasan.mints.ne.jp

    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,
    Sebastjan

    Like

    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;

      Like

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

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: