Introducing DCC++ ---a complete open-source DCC station and interface

Gregg Aug 25, 2015

  1. Atani

    Atani TrainBoard Member

    205
    223
    7
    Not all shields have issues. For the Arduino shield, it is recommended to add a heatsink to the main chip to increase surface area for cooling. The BTS7960B boards have a massive heatsink on the bottom of the board. Pololu boards I am not sure on but likely they wouldn't be hurt by having a heatsink attached to them as well.

    On my setup I plan on using a pair of BTS7960B boards with 40mm fans added to make it active cooling instead of passive.
     
    Scott Eric Catalano likes this.
  2. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    198
    55
    6
    Thanks I would be most interested in how your attempts go and yes the code would help too
     
  3. Ivan Strom

    Ivan Strom New Member

    8
    9
    1
    Still doing some testing. In particular I found a problem if turnout power is applied before Arduino power - the board sees the Arduino outputs as 0, activating all the relays and trying to throw all the turnouts. Just got that solved. Turnout power first goes through one relay on the board which needs to be at "1" to supply power. So if I connect the turnouts to power before the Arduino fires up, that relay will be at 0 and no power is supplied to the other relays. Simple solution that doesn't need code, but does use one Arduino pin.

    I'm also seeing if BT24-600B triacs can be used instead of relays. About the same price per turnout, but I'd need 4 relay boards and have limited space - I can fit all the triacs on one perfboard, along with the IO expanders to control them.
     
    Scott Eric Catalano likes this.
  4. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    63
    66
    3

    I have had no issues with these Deek robot motor boards

    http://www.ebay.com/itm/261516145493?_trksid=p2057872.m2749.l2649&ssPageName=STRK:MEBIDX:IT

    run them on both Unos and Megas on my test track as well as main tack through a booster.
     
    Scott Eric Catalano likes this.
  5. Keith Ledbetter

    Keith Ledbetter TrainBoard Member

    63
    66
    3
    A bit delayed response but I am using the NCE EB1 in between motor shield and track and operates perfectly. When I short track to test the EB1 cuts power but the base station basically doesn't even know it happened and 2 seconds later everything fires back up and starts again.
     
    Scott Eric Catalano likes this.
  6. Kencom

    Kencom TrainBoard Member

    11
    13
    2
    Hi all, I've just been given an oldish "Raildriver" controller designed for use with PC train simulator programs (see http://raildriver.com/). Wondering if anyone has reverse engineered this hardware to use as a DCC cab control? It has a USB interface to the PC running the simulation so in theory it could plug into a raspberry pi/DCC++ system. I'd be interested to get any feedback.

    Cheers,

    Greg
     
    Scott Eric Catalano likes this.
  7. esfeld

    esfeld TrainBoard Member

    368
    345
    10
    Keith
    That's fine, unless you don't know where the short is ...... I added a push button to the EB1 (see "Short Circuit Protection" Msg#3) that way the EB1 LED blinks when a short is encountered .... when short is rectified push the button to reset .... again, the base station stays powered on through it all. BTW I too prefer the Deek-Robot motor shields.
     
    Scott Eric Catalano likes this.
  8. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    Hi Gregg,

    I'm having CV read problems and followed your lead. I tried lowering this value, first to 25, later to 20. The loc on the programming track seems to "stutter" a little bit more (can also be my hopeful imagination), but no dice reading the CV...

    Should I lower this value even further?

    Gerard
     
    Scott Eric Catalano likes this.
  9. Mike23

    Mike23 New Member

    2
    2
    1
    Dear All!

    I’m just found this site and I’m very happy because I started to build a H0 scale railroad system, with some automated control. Arduino is my another new hobby, and DCC++ system is very good to combine them. At the first page I read:

    “The base station consists of an Arduino Uno (or Arduino Mega) and an Arduino Motor Shield, and that's the only hardware needed (with the exception of an 18V AC or similar power pack). “

    I want to buy an Arduino Motor Shield, but when I see the official page, I read that Arduino Motor Shield can have an external power supply maximum 12V. It is not enough for H0. But I read, that some of you use this shield with H0 trains. Maybe I don’t understand something, or misunderstood. So, please help me to solve my problem! Is it good the official Arduino Motor Shield R3, what I found on the Arduino website, for H0 scale trains, or not?

    Thanks a lot. Mike
     
    Scott Eric Catalano likes this.
  10. Jimbo20

    Jimbo20 TrainBoard Member

    74
    80
    4
    Hi.
    The std motor shield can take up to 18V, but if it is supplied with more than 12V you should cut the trace to prevent it passing the supply voltage to the Arduino which DOES have a maximum of 12V; you then would need to have a seperate supply of 7 - 12V for the Arduino.

    This is what the Motor Shield website says:

    HTH
    Jim
     
    Scott Eric Catalano likes this.
  11. Mike23

    Mike23 New Member

    2
    2
    1
    Thank You Jim for your very fast answer.

    I was uncertain because of the Schematics.pdf in documentation section of Arduino website, but now I’m sure, and go to buy the shield.

    Thanks again. Mike
     
    Scott Eric Catalano likes this.
  12. DCYale

    DCYale New Member

    2
    2
    1
    I have read quite a lot of the thread, but it's just too long to read everything at this point. It's very interesting to see how this has all evolved. I am awed by the amount of time and effort people have put into DCC++ (and I include those who have made other projects work with DCC++).

    After playing around with 3D design, I was looking for a new challenge and began playing around with the Arduino. I have a (yet another) gate crossing application about 50% done. I am trying to 3D print the gates and I'm not sure that will work out.

    I am going forward with DCC++ but maybe with a wrinkle or two. I model HO and right now my only layout is a 4 foot module that combines with other modules when my club sets up at shows.

    My present thoughts:

    Stage 1: A Mega based base station running off a laptop. No layout control, just loco control. My club's modules can have a third track that is under local control and that is what I'd be controlling- it can interface with other modules so can be quite a bit longer than 4 feet and some modules have switching setups connected to it.

    Step 2: A Mega based cab control. It would be in the base station enclosure and have a keyboard, a rotary encoder, an LCD readout, and switches for horn and bell. It would eliminate the need for a laptop. This would send the same signals to the base station a laptop would. I am hoping that there would be no or minimal change in the base station sketch. I am still wondering of the DCC++ base could handle a laptop and the base controller at the same time. Would it do anything the laptop couldn't? No. But by using a Mega there are a lot of possibilities for future projects.

    Step 3: A hand help controller. Not just a throttle, but duplicating the functionality of the base cab control. Rather than adding to the code on the base station, I'd have this communicate with by base cab control and have the base unit pass the signals to the actual DCC++ base. I already have some XBee Pro modules I can dedicate to this approach. I have read about some of the other approaches, but we set up in some areas with a lot of background interference (like the Big E in Springfield, Mass) and I am hoping the XBees will have less of a chance of interference.

    At final iteration one person could operate with the base and another with the handheld. Maybe a third on a laptop?

    If anyone has any comments I welcome them. Has anyone already gone in this direction, or a direction that would get me part way?

    Dave Yale
     
    Scott Eric Catalano likes this.
  13. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    My thoughts go more in the direction of having the DCC++ on the Arduino controlled by JMRI on an Raspberry Pi. JMRI can put a webserver "in the air", so we could use phones and tablets as handcontrollers...

    Even more preferable would be a Loconet connection so we could use the existing Digitrax controllers. ;-)

    Gerard
     
    Scott Eric Catalano likes this.
  14. DCYale

    DCYale New Member

    2
    2
    1
    I thought about a rasberry pi with a nice touch screen as the base, the interface could be tweaked until just right, but I'm hoping to learn more about hardware on this one.

    A thought for the future though.

    Sent from my SAMSUNG-SM-G900A using Tapatalk
     
    Scott Eric Catalano likes this.
  15. Dani

    Dani TrainBoard Member

    10
    17
    3
    [QUOTE="
    Even more preferable would be a Loconet connection so we could use the existing Digitrax controllers. ;-)

    Gerard[/QUOTE]

    Hello,

    If you want DCC++ with a Loconet connection, here you have it!!! ;)

    https://github.com/ClubNCaldes/LNetDCCpp

    I wanted a DIY command station with Loconet interface that could replace my Intellibox Basic or my Digikeyjs DR500, so I took the DCC++ source code and added the MRRWA Loconet libraries (http://mrrwa.org/loconet-interface/) to it.

    I wrote an article in my blog where you can have more detailed information:
    http://www.clubncaldes.com/2017/04/cheapest-dcc-command-station-with.html

    I changed the code to run only in a MEGA, and suppressed the current interfaces to have room for the loconet libraries and buffers. I always use an independent Loconet<->Ethernet interface implemented also with an Arduino (UNO version in this case). So I only need the command station to be able to send and receive commands through Loconet.

    Being part of a loconet network I don't need the command station to be able to drive inputs and outpus, so I used the pins to implement new functionalities:

    * 3 external leds to show the state of the command station (ON, OFF, Short circuit)
    * 2 external buttons to change the state to OFF or to ON
    * 1 external Emergency button (in Loconet you can stop the command station in two ways, a "normal stop" or "emergency stop", sent messaged are different)
    * 2 external relay that switch from normal to programming current automatically during a CV read or write operation
    * KeyPad LCD shield support. Display shows current consumption and CV values when read or write. Buttons can also be used to start and stop the command station. It's planned a future development to read and write CV directly from the command station and not only through Loconet.

    I've been using this version of the command station with Rocrail with a 14 meters long modular layout during a weekend and has been proved to be reliable and completely stable.

    Enjoy it!


    [​IMG]
     
  16. Erik84750

    Erik84750 TrainBoard Member

    78
    40
    4
    Hi Gregg,

    re. CURRENT_SAMPLE_MAX what are the min and max values here and what are the corresponding currents? Or is this a hit-and-miss guess?

    And the current sense motor shield output goes to Arduino A0: what is the scaling factor for this conversion?

    Can I substitute the L298 motor shield current sense output to A0 by the current sense output from a booster driven by this motor shield? Or maybe superimpose both (maybe by adding the 2 values with two resistors?)?

    Erik
     
    Scott Eric Catalano likes this.
  17. Scott Eric Catalano

    Scott Eric Catalano TrainBoard Member

    198
    55
    6
    Hello,

    If you want DCC++ with a Loconet connection, here you have it!!! ;)

    https://github.com/ClubNCaldes/LNetDCCpp

    I wanted a DIY command station with Loconet interface that could replace my Intellibox Basic or my Digikeyjs DR500, so I took the DCC++ source code and added the MRRWA Loconet libraries (http://mrrwa.org/loconet-interface/) to it.

    I wrote an article in my blog where you can have more detailed information:
    http://www.clubncaldes.com/2017/04/cheapest-dcc-command-station-with.html

    I changed the code to run only in a MEGA, and suppressed the current interfaces to have room for the loconet libraries and buffers. I always use an independent Loconet<->Ethernet interface implemented also with an Arduino (UNO version in this case). So I only need the command station to be able to send and receive commands through Loconet.

    Being part of a loconet network I don't need the command station to be able to drive inputs and outpus, so I used the pins to implement new functionalities:

    * 3 external leds to show the state of the command station (ON, OFF, Short circuit)
    * 2 external buttons to change the state to OFF or to ON
    * 1 external Emergency button (in Loconet you can stop the command station in two ways, a "normal stop" or "emergency stop", sent messaged are different)
    * 2 external relay that switch from normal to programming current automatically during a CV read or write operation
    * KeyPad LCD shield support. Display shows current consumption and CV values when read or write. Buttons can also be used to start and stop the command station. It's planned a future development to read and write CV directly from the command station and not only through Loconet.

    I've been using this version of the command station with Rocrail with a 14 meters long modular layout during a weekend and has been proved to be reliable and completely stable.

    Enjoy it!


    [​IMG][/QUOTE]
    Very good work I have read your blog...so the question is this....how hard would it be to implement NCE/Digitrax controllers? I am sure another re-write of code would be needed?
     
    Atani likes this.
  18. Dani

    Dani TrainBoard Member

    10
    17
    3
    If you want to connect any Loconet compatible controller (I guess these NCD/Digitrax you mention are Loconet) nothing has to be done. All loconet protocol is already implemented and you can move trains from any software connected to the layout or from any (Loconet compatible) controller.

    Cheers,
    Dani
     
    Scott Eric Catalano likes this.
  19. Trains In The Attic

    Trains In The Attic New Member

    2
    2
    1
    Hi all,
    I have built a DCC++ system using a mega 2560 and standard arduino motor shield and I am running it through a high power booster(thanks to Dave Bodnar for this).Everything is working fine using it with JMRI.
    I am looking to use all the sensor pins available to me on the mega and maybe more.My question is how do I get more pins?
    Can I add another Mega or Uno to the system to do this.
    If yes,could someone please advise me on how to do this as I am still new to using the arduino.

    Many thanks

    Cheers Gary
     
    Scott Eric Catalano likes this.
  20. Gerard A. Wassink

    Gerard A. Wassink TrainBoard Member

    13
    11
    2
    Hi Gary,

    To be able to use more pins I used a chip called MCP23017-E/SO I2C 16 bit I/O expander. I used it for output in my Relay board (see my Github page), but it can be configured as inputs as well. It works based on the I2C protocol. I originally built and tested it for the Raspberry Pi, but I have also tested it on an Arduino.

    Gerard
     

Share This Page