DCC++ and turnout control

Art99 Mar 3, 2020

  1. Art99

    Art99 TrainBoard Member

    16
    0
    6
    What combinations of turnout controllers and servos/switch motors are there that could directly connect to an Arduino Mega board/Arduino motor shield? I have viewed a number of videos that use breadboards but is there nothing cleaner (i.e. eliminate the breadboard)?

    I have a Lenz LS150 but I don't know if that can be directly connected to the Arduino Mega board/Arduino motor shield; I don't think it will control servos.

    Any recommendations or ideas where I can look? I have looked through Trainboard threads but I haven't found anything?

    Thanks
     
  2. Mani

    Mani TrainBoard Member

    76
    15
    4
    What type of turnouts ? I have bult a DCC decoder with Arduino and simple circuit (board) to turn my Kato turnouts.
    Have look:



    Sent from my GM1901 using Tapatalk
     
    IronMan1963 likes this.
  3. Mani

    Mani TrainBoard Member

    76
    15
    4
    This code can be modified to run any type of motors. Just need to change a logic a bit depends on the type of turnout or motor you are using..

    Sent from my GM1901 using Tapatalk
     
  4. Art99

    Art99 TrainBoard Member

    16
    0
    6
    I have Atlas and Peco (insulfrog) turnouts. I was hoping to avoid building a circuit board as I have zero knowledge and skill in that area.

    I have been looking for a solution that involves Arduino mega, motor shield, DCC decoder ( I was thinking there may be a solution involving a PCA 9685 but it looks complicated) and perhaps servos for the turnout operation, IDE and JMRI in one place. I am beginning to think that perhaps the reason it is not together is that it is not a simple build and needs the expertise you show in your video. I guess that is why the makers of DCC charge the big bucks for their product. It is an impressive video.

    Thanks for taking the time to respond and I would welcome any other comments that you may have.
     
  5. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Mani likes this.
  6. Art99

    Art99 TrainBoard Member

    16
    0
    6
    You are right! I am not much of a DIYer when it comes to electronics; I am in most other things. Thanks for the two references. I will check them out.
     
  7. Mani

    Mani TrainBoard Member

    76
    15
    4
    Just to encourage you. I am also not an electronics wizard. But have enough programming knowledge. I just started hobby recently and did my own research and found the mentioned method is simplest of all...

    Sent from my GM1901 using Tapatalk
     
  8. Mani

    Mani TrainBoard Member

    76
    15
    4
    If you are interested in going DIY way, I am happy to help..

    Thanks
    Mani

    Sent from my GM1901 using Tapatalk
     
  9. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    The type of switch ( servo or solenoid type) you have will determine what board you will be looking for/ buying. Most will have a power input for the switches and a separate DCC input, normally taken from the track output. Some boards will have up to 16 outputs, other will have a mixture of output for switches, signals, toggle switches and even LEDs to indicate position. Programming the boards is an other story/ headache. The easiest one to program I came across, is the one described in the last 2 MRH magazines. (last link in the previous post).
     
  10. Art99

    Art99 TrainBoard Member

    16
    0
    6
    Thanks for the encouragement
     
  11. Art99

    Art99 TrainBoard Member

    16
    0
    6
    I am going to study your video closely and see if I can get all the components locally (western Canada). I have an old MRC Prodigy Advance 2 that I got from someone and realized (too late) that it is old technology and will require some significant $$ to add components, etc. When I started down the DCC++, it seemed relatively easy putting boards together. Now the turnout control is next on the list and things are getting complicated. I do have programming experience but on the business/application side.

    Another area that I am into besides building my layout is learning how to wire the Atlas and Peco switches that I have. I have dropped track wires to a common bus about every 3 feet but am finding dead spots around the switches and crossovers that I need to resolve.

    I truly appreciate your offer to help.

    Thanks again
    Art
     
  12. Art99

    Art99 TrainBoard Member

    16
    0
    6
    Are you referring to https://model-railroad-hobbyist.com/node/24316?page=53#comment-418081? It looks like a discussion that started in Nov. 2015 on
    SMA20 Low Cost 17 Channel DCC Decoders Ver 6.01 with Sound,Triggered Sound,Stepper,Dual Motor,LED and Servo Control and has only been updated in 2020. I want to make sure I have the right reference before I starting reading the history.

    Thanks for your help.

    Art
     
  13. Les B49

    Les B49 TrainBoard Member

    37
    3
    7
    I'm from a software background back in the '70s, but had no electronics knowledge or skills. Now retired, I used Arduinos (Mega plus Motor Shield) as a way into electronics to control a small garden railway using DCC++. It took a while but I'm now there, using JMRI's DecoderPro and WiThrottle on iPhone or iPad.

    Next I wrote a simple program using an ESP32 to control servos by my points, through a simple webpage interface I created - also now working nicely - but had long wondered if there was a homebrew, low-cost DCC decoder that would enable me to run everything through a single interface.

    By chance, I came across this series of YouTube videos by "Ruud" from the Netherlands last week which were very interesting.
    https://www.youtube.com/channel/UC8z5SHQhi9veBOAaFPZffNA - if the link fails, search YouTube for "Rudysmodelrailway"
    (The link above is to a sort of Index Page - scroll quite a way down to look at videos 29 & 30 to see how to build a simple Arduino-based servo controller for points.
    Or a little earlier in the list, nearer the top, between episodes 36 and 37, is where Ruud introduces a board built by his friend, Rico, as part of his ArCoMoRa (ARduino COntrolled MOdel RAilway) hardware and software offering which does the same, and can be bought as a kit or ready-assembled. I've just ordered a ready-built set, but it may be 5 weeks in arriving, since parts come from China to be assembled in the Netherlands, then shipped out - and you can guess what's causing delays in getting parts from China just now...)
    upload_2020-3-4_18-26-43.png

    NB This unit is an Accesory Decoder that would pick up the DCC signal (maybe from the track or directly from the feed to the track) - you would still need your Mega/MotorBoard to generate the DCC signal in the first place.

    Scan Ruud's other videos too - there are interesting one's on controlling railway crossing gates, a turntable, etc.

    Hope this helps.
    Les
     
  14. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Ruud also have a webpage (rudysmodelrailway.wordpress.com) where you can find all his projects, including software.
     
  15. Art99

    Art99 TrainBoard Member

    16
    0
    6
    Thanks Les,

    I will certainly look into this.

    Art
     
  16. Bill Wyatt

    Bill Wyatt New Member

    5
    0
    3
    Good day all and thank you for approving my membership request.

    I hope this is the correct place for this question if no please let me know. I picked this thread because it's title contains two of the items I need help with, Dcc++ and turnouts. Also, may I include JMRI and arduino mega and nano. My goal is to control Kato switches with an arduino nano (software by board developer) which is controlled by an arduino mega running Dcc++ and JMRI. Electronics is my background however, computer programing is not.

    My problems is, how does JMRI tell the arduino which output pin to use and how do I get the first arduino, the mega, to talk to the second arduino, the nano, through the Dcc track connection. I have contacted the board developer and he has offered some help by suggesting using a sniffer to monitor the commands sent via the dcc rail, no real luck. I have read a great deal of JMRI's instructions, I find some talk about the arduino pins and that the software assigns it own id and does no use the arduino PIN number directly.

    My hope is to have JMRI programed so that I can control turnout via arduino mega pins and through the second arduino nano board. Thank you very much and sorry to be so long winded.
     
  17. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Bill, basically you are using the second Arduino (the nano) as a dcc decoder. The nano sees reads that address as it's own then knows what to do based on the dcc command. That nano my guess is your issue. What sketch have you loaded? You should relook at @Mani solution above. Also look here https://model-railroad-hobbyist.com/node/24316
     
  18. Mani

    Mani TrainBoard Member

    76
    15
    4
    Hi Bill,

    I will try to explain as simple as possible.

    There are majorly 3 components in DCC system

    1) Controller
    2) Base station
    3) Decoder

    - Controller is where you sends commands to locos, accessories etc. In your case it's JMRI.
    There will be a USB connection from your Laptop (with jmri software installed) to the base station.

    - The Base station (Arduino Mega will be your Base station) will encodes the command received from the JMRI (controller) and send it via tracks

    - Decoder will receive the signal from the track (or from extra bus from base station) and decode it and process the command. In your case it is Arduino Nano.

    Sent from my GM1901 using Tapatalk
     
  19. Mani

    Mani TrainBoard Member

    76
    15
    4
    Now talking about your use case of using Nano as decoder. The following things needs to be remembered to make an Arduino decoder.

    1) You need a circuit protects the Arduino from the higher voltages on the rails. You can't keep changing Arduino.

    2) An Arduino software library that can monitor for signal and decode when signal arrives

    3) An Arduino (any model) that we can flash the code.

    With these you can use the Arduino as accessory decoder.

    In the code you need to mention the following things
    1) What is the dcc address
    2) What is the Pin to use for this dcc address

    So, one Nano you can control more than 10 accessories.

    Coming to my solution above. My code is written to work with Arduino shield. More over the code may also change depending on the shield type.

    I have good news & bad news:
    Good news is you can alter the code to make it work with out shield. The bad news is the voltage provided by Nano is not sufficient to turn Kato turnouts. You need minimum 12v to turn them.

    So, Shield is the way to go.

    If you can get a shield for Nano and alter the code I posted in my post you are good to go.

    (or just simply use UNO.)

    The key aspect is:

    Kato turnouts are bi-polar type turnout machines with capacitive discharge. You need to
    send the power to charge them for few seconds depends on the polarity and disconnect the power after it turned.





    Sent from my GM1901 using Tapatalk
     
  20. Bill Wyatt

    Bill Wyatt New Member

    5
    0
    3
    Keith and Mani thank you for your response. You are correct, I am using the nano as a stationary decoder which should be capable of controlling up to 8 outputs. The software I downloaded with the order for the unbuilt board should be capable of controlling 6 momentary turnouts and 2 regular switches.

    My biggest problem is being very new to the DCC++ world. In the past I have used digitraxx and NCE systems and for turnout control I used digitraxx ds52, now I feel the bug of a new adventure has bitten me. What I need to know and understand is, how do I make by DCC++ base communicate with the nano and tell it which switch to activate for the turnout I wish to change.

    I feel, as much as anything, it is lack of understanding on my part. I have communicated with the board supplier and think he may have given up on helping. I hope I did not cause any consternation on his part.

    Again thank you both,. Bill
     

Share This Page