DCC++ and turnout control

Art99 Mar 3, 2020

  1. Mani

    Mani TrainBoard Member

    76
    15
    4
    Its is easy. There is alot of discussion going on in another thread to bring next gen DCC base station. But for you start building DCC++ to run DCC trains ready, follow the below series by Gregg:

    https://www.youtube.com/channel/UCJmvQx-fe0OMAIH-_g-_rZw



    These are the videos I followed as newbie.

    Note that you need UNO or Mega for Base station.


    Sent from my GM1901 using Tapatalk
     
  2. Mani

    Mani TrainBoard Member

    76
    15
    4
    I recommend first go through the youtube series to get logic an technology behind it and then go for the next video.
     
  3. Mani

    Mani TrainBoard Member

    76
    15
    4
    I should have asked this in first. You have DCC++ BaseStation & Jmri ready and you are only looking for controlling turnouts with Nano (only) using them?

    OR

    Looking to build BaseStation and trying to find out instructions how to link BaseStation to JMRI?

    OR

    Everything?


    Sent from my GM1901 using Tapatalk
     
  4. Bill Wyatt

    Bill Wyatt New Member

    5
    0
    3
    Thank you so much for your help . Yes I do have the base station working and controlling trains. Now I am trying to communicate with the nano to control several turnouts. They are Kato and in the past I have controlled them with digitraxx DS52 which would do 2 turnouts. However at 30 dollars per unit and with several more turnout I went with the nano. I have had some luck using the base station Arduino mega to control turnouts but fear I will run out of pins before I'm done. So, you are correct, I am trying to get the nano to control my turnouts. All done through JMRI (which I have working). Thanks.
     
  5. Mani

    Mani TrainBoard Member

    76
    15
    4
    As per my knowledge, Nano (or UNO) alone cannot turn with their limited Voltage hence I used motorshield.

    The way to control turnouts may differ from the software to software. I am using Mynabay library.

    It will work with Nano and UNO which I have tested. But note that voltage limitation. it is ok to switch on off lights and signals with this limited Voltage but to Operate Kato turnouts more voltage is needed.

    I answered these based on my reasearch. If you are planning to use motor sheild and use the same library for turnouts I can help wiring up things. And note that 'Adafruit motorshield' can control upto 4 turnouts.

    It is interesting that you have controlled turnouts directly with base station. Any references on that?

    Sent from my GM1901 using Tapatalk
     
  6. Bill Wyatt

    Bill Wyatt New Member

    5
    0
    3
    I think I miss lead you a bit with respect to controlling turnouts directly, actually I controlled them through a relay which was controlled by an arduino output. Also, the board with the nano has built in "H-bridges" and onto isolation that will allow the nano outputs to handle the current and voltage to deal with the turnout.

    My real problem, I think, is how to address the base station through JMRI so the nano and its hardware can control the turn out. I think I am beginning to understand that the base must know the address of the nano and which pin on the nano is used to control a certain turnout. Where do I find the address of the nano and which pin I need to use then, how do I write the command to cause this to happen.

    The address below is where I got my nano decoder and some background about it and it's software/sketch.

    https://www.instructables.com/id/Arduino-Pointsturnoutaccessory-Control-V2/

    Hope I did a better job of explaining my problem. Basically my problem is talking to the nano decoder across the track with the arduino mega/base station. I don't know how to tell the base how to communicate with the nano decoder.
     
  7. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Helpful. You will need to setup a turnout table in JMRI. Do you know the address of the decoder. If you didn't modify that sketch it looks like decoder address should be 1 I think but again look and see. If you get the decoder number correct I bet you'll be good to go.

    https://www.jmri.org/help/en/html/tools/Turnouts.shtml
     
  8. Mani

    Mani TrainBoard Member

    76
    15
    4
    As Keith pointed out already. Or to test it temporarily use 'Turnout control' from tools menu.

    Sent from my GM1901 using Tapatalk
     
  9. Bill Wyatt

    Bill Wyatt New Member

    5
    0
    3
    Thank you Keith, I will re-read this section and use 1 as the decoder address however I am still unclear as to the format I need to use. There seems to be different names given for the same thing and perhaps I am just thick headed. One of the formats I have used is as follows:

    <T 10 1 1>

    This is entered via the JMRI send command window. The T was to address turnout, the 10 was used as turnout id, the first 1 was used to address the nano decoder, and the 1 was to cause the turnout to be thrown, that value could be a 1 or 0. When using this setup I would see tx rx LEDs show traffic on the base station but, no action on the nano decoder. I think you are correct in that my addressing is no right.
     
  10. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    279
    195
    12
    Ya i think you are really close. Need to get the decoder address and pin right and then think you are there.
     
  11. Erik84750

    Erik84750 TrainBoard Member

    355
    145
    12
    Hi Mani, where can your code be downloaded?
    Regards,
    Erik
     
  12. Mani

    Mani TrainBoard Member

    76
    15
    4
  13. Erik84750

    Erik84750 TrainBoard Member

    355
    145
    12
    From your code I see that the output (pin 3) is either high (thrown) or low (straight)?

    Can you write a version where 2 outputs are temporarily set high (for example Bachman twin coil turnouts): pin "a" pulsed high for straight, pin "b" pulsed high for "thrown"?

    Thank you very much!
    Erik
     

Share This Page