DCC++ and atlas snap switches

John W Zerbe Nov 22, 2017

  1. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    Hi all, My question is this. Does anyone use dcc++ to control atlas snap switches. I'm considering adding a relay board to control the power to the switches, but am concerned about handling the timing of how long to supply the power to the turnout "motors". I built my DCC++ on the arduino mega so I have lots of 5v pins to use, but controlling them via jmri looks like its generally an on or off prospect. I think that you would have to do something like telling the relay to be "on" for a short period of time, then off again in order to simulate the momentary button press of the atlas controls.

    I'm still in the experimentation phase of layout planning. I have track set up on a temporary table and can control multiple trains on it via jmri on raspberry pi connected via usb to the arduino mega with the arduino motor shield on top. I'm ready to move to the next level of trying to control turnouts and still have time to decide between the snap switches and possible under table mounted servos. I simply already have a couple snap switched to play with so was looking for a possible solution for controlling them.

    Thanks for any advise on this.
     
    Scott Eric Catalano likes this.
  2. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    you are probably better off [with snap switches], to use a capacitor discharge system on the output of the relays, that way timing isn't too important , and you won't burn out the momentary controls
     
    Scott Eric Catalano likes this.
  3. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    I found something like NCE's snap-it or Q-Snap dcc stationery decoders made specifically for this purpose. I found a Q-Snap on ebay for about $30 to control 4 snap switches. That may be the way to go.
     
    Scott Eric Catalano likes this.
  4. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    Hi all,
    I'm finally back to this part of my project. I have discovered that with JMRI's support of dcc++, you can map a track switch to the DCC++ individual digital output pins. I believe that this means that once mapped, I should be able to control a JMRI track switch by ultimately setting a digital output pin high or low as a continuous output. This doesn't work directly for energizing the pair of solenoids in an atlas track switch. However, if I dedicate a second arduino to driving the actual track switches, I can connect a digital output pin to a digital pin on the second arduino, assuming shared ground and 5v power leads across the pair of arduinos.

    That second arduino will be set up just like this project: http://ralf.alfray.com/trains/arduino_turnouts.html

    The main loop in that arduino will poll the digital pins for input and when a pin changes from low to high or high to low, it can activate the logic to throw the track switch to the correct position. I can also add the control of a pair of LEDs on the layout to indicate which way the switch is positioned from this second arduino.

    JMRI and the DCC++ code/hardware does not need to change at all for this. ie a digital pin on my mega per track switch in the DCC++ setup. State of the track switches is saved in the DCC++ setup between power recycles and the track switches set to that state on power up.

    Eventually I should be able to use this technique to use a digital pin from the DCC++ command station to "activate" automation of just about anything. ie on means start the automation for the steel mill or its now night, so activate the "light up sequence". I know this can be done with stationary decoders, but this seems to be a simpler first implementation.

    Anyone see any flaws in this logic?
    Thanks,
    John Zerbe
     
    Last edited: Jan 27, 2019
  5. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    an arduino itself doesn't have the power to actuate twin coil turnouts , does it ?
     
  6. John W Zerbe

    John W Zerbe TrainBoard Member

    96
    59
    7
    An arduino does not have the power to activate the twin coil turnouts by itself, but it can drive a relay board who in turn acts as on/off switches for the actual 18v AC power that goes to the twin coil turnouts. The url I referenced above shows how that can happen.
    Below is a picture of what I intend the hardware to look like for the second arduino. This is taken directly from Ralph's Train Pages
    [​IMG]

    You just have to take care that your logic doesn't energize the relays for more than about 100ms at a time so that you don't burn out the coils in the track switches.
     
  7. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    i didn't go to the url ... my fault ..
    it all makes sense now ..' lol
     

Share This Page