You're reading ...
Hardware, Software

Arduino as DCC servo decoder – tuning and configuration.

Two new video’s are out on the Arduiono as DCC servo and function decoder.

The first video shows how the Arduino can be tuned to find the minimum and maximum angles for our servos to correctly control our junctions or other hardware.

The second video shows the installation and configuration of the Arduino DCC software: the Mynabay library, the tuning software plus the DCC servo decoder software.

Download available on the software page.

About RudyB

Hobbyist

Discussion

14 thoughts on “Arduino as DCC servo decoder – tuning and configuration.

  1. Is it possible, to connect a couple of arduinos to dcc e.g. to drive more servos? how can i adress the arduinos to use the servos? i need about 40 servos)

    Like

    Posted by Dirk | September 29, 2017, 15:33
    • Yes, that is no problem at all. The only think you need to provide is the DCC signal converted to 5V via the optocoupler circuit. You can use one opto circuit for multiple Arduino’s, unless they are further than say 100 cm away from each other, then multiple opto circuits are needed. The DCC addresses have to be written in the code before you upload to the Arduino. As an Alternative you can use the MARDEC software (and if you wish also the hardware shield) from this website: https://arcomora.wordpress.com

      Like

      Posted by RudyB | September 29, 2017, 16:21
      • OK, so i don’t need an adress for each arduino? i only have to write the ongoing adresses for the accessories? my problem is, that it’s not possible to drive more than 14 servos with one Arduino, tested with Arduino mega 🙂

        Like

        Posted by Dirk | October 2, 2017, 11:11
      • Indeed the Arduino’s themselves do not have an address of any kind. They listen to the DCC data and if they recognize a DCC address (as defined in their software) they start the defined action(s) for that address e.g. rotate a servo from start- to end angle or switch on/off an output pin.

        Like

        Posted by RudyB | October 2, 2017, 12:08
  2. Hi Rudy I can not find the file RB_Servo_init in the Dropbox down load cheers Ray.

    Like

    Posted by Raymond salter | March 2, 2016, 21:20
  3. Hi Rudy I have done loaded the files for the DCC Servo at the link to Dropbox but the file RB_Servo_init does not seem to be included any help would be great.
    Cheers Ray.

    Like

    Posted by Ray | March 2, 2016, 21:13
  4. Hi everybody,

    I am starting to build recomanded circuit to connect Arduino and a DCC . I used Optoisolator 6N137 and schematic from mynabay.
    I downloaded from rudysmodelrailway the latest DCC_Decoder software and imported to the Arduino application.

    I mention that i’m using Arduino Leonardo and Arduino 1.6.5.

    When i finished i just make a test, turn on the serial monitor, turn on the DCC Command station (made from Roco)..and all the results from serial monitor is 0. Total Packet is 0 , Idle Packet is 0….

    I chek for tree times each wire, each conections and everything is look ok.

    Do you have any idea why my board can’t read DCC signal ? Maybe something not compatible with my board or software ?

    Like

    Posted by Dragos Sogard | July 30, 2015, 20:00
    • Hi Dragos. Let’s see if we can get this to work.

      First of all … it is of course possible that the optocoupler circuit does not function? If you do not have thepossibility to use an oscilloscope to check if the input signal on Arduino pin 2 is ok, this will be hard to check. Although, what I once did is make a small piece of software that uses interrupt 0 and only increments a counter. Enable the interrupt for one second exactly and see if the counter has reached approximately 15.000.

      I have had it happen more than once that the DCC-monitor software gave me all zero’s like with you, which made me test and try all kinds of things, nothing helped. But then when I run the DCC decoder software it simply works! I have no clue as to why this happens, but why bother if the decoder SW works? 🙂 Maybe you can simply try by configuring a function output and have it use pin 13 on the Arduino in order to put the led on/off by DCC, just as a test. If that works, then all is fine.

      Also … I have not checked, but it is possible that the Arduino version you uses different interrupt pins. The software was made for interrupt 0 via pin 2. If your board has interrupt 0 on another pin, it will not work. Please check the Arduino info about your board.

      Like

      Posted by RudyB | July 30, 2015, 20:50
      • A lot of thanks for this little suggestions with interrupt 0 via pin 2. On the Leonardo board is PIN no. 3. I just changed the wire and everything is ok now. I will start to test few scripts from this page 🙂 Greetings from Romania !

        Like

        Posted by Dragos Sogard | July 30, 2015, 21:03
  5. Thank you for you sketch. I have managed to modify it so I can use a LCD to readout the angles. This makes life easier without having to plug in the computer.

    Alan

    Like

    Posted by Alan | April 19, 2015, 17:33
  6. Hello, Rudy.

    I can’t find your sketch for DCC servo decoder.
    The link in your description is for differnt sketch https://app.box.com/s/gntyhw0eyrfu2700njpv

    Thank you for your help.

    Regards,
    Sebastjan

    Like

    Posted by Sebastjan | December 2, 2014, 19:21

Leave a comment

Archive of all posts