Model Train-related Notes Blog -- these are personal notes and musings on the subject of model train control, automation, electronics, or whatever I find interesting. I also have more posts in a blog dedicated to the maintenance of the Randall Museum Model Railroad.

2023-11-11 - DCC-EX Command Station

Category DCC

I realize I don’t know the exact details of what’s needed for DCC-EX. So let’s look into it.

I also wonder how much some of the hardware parts cost, out of curiosity.

To start with, a DCC-EX Command Station is, as the name suggests, a command station for DCC -- digital control of model trains. What makes this interesting is that it’s a complete DIY system based around an Arduino board, an extra board providing the track power, and an open-source free software. Depending on the kind of Arduino board used, the trains can then be controlled via a computer and a web page, or even an Android or iPhone.

Here’s the one I made using the recommended components. It is pictured next to an HO-scale engine to show you how small it is:


An Arduino UNO with a Motor Shield.
Bottom jack is the input power for the track.
The USB cable provides power to the Arduino + web page for control.

Of note, a DCC-EX command station can generate two track outputs. That can be 2 DCC signals -- for example for a mainline track + a separate programming track -- or it can be one DCC signal plus a separate DC signal. E.g. one could make a circuit with one loop on DCC and one loop on DC voltage and control both independently..

On the hardware side, one needs two things:

  • An Arduino board -- that’s the “computer” part
  • A “motor shield” -- that’s the part at the top that produces the track voltage.

One thing to know is that the Arduino boards are “open design” and the Arduino company encourages others to make compatible boards. Thus it’s easy to find “clones” of Arduino boards on Amazon or Aliexpress. Some are better than others.

Arduino board examples. For each one I compare an official Arduino board with a known compatible clone:

  • An “Arduino Uno” is the cheapest board one can find. It lacks wifi, and is limited in memory.
  • An “Arduino Mega2560” is a more powerful board and is the recommended choice. Some clone boards have custom wifi which may or may not work.

Then one needs a “Motor Shield”, the board that powers the track. This is a very generic term and the DCC-EX project only supports a subset of those available -- here are the known supported ones:

Next one needs a power supply. Technically two power supplies are needed: one for the Arduino “computer” part, and one for the “motor shield” that powers the track.

The Arduino can be powered by a simple USB power brick, or even better by the computer controlling the Arduino. In my case power the Arduino via the USB cable so I don’t need a power supply for that. How to choose:

  • If an Arduino Uno is used, there’s no wifi, so it must be connected to computer for control. And since it’s always controlled by JMRI, then it requires USB, thus just power it via USB from the computer. No need for an extra power supply here.
  • If an Arduino Mega is used via Wifi, then it needs its own power supply.

Example of Arduino power supply:

In my case, I only need a power supply for the track power. And for these it’s easy: we can choose any of the 12 V LED power supplies that are abundant on the market. Two examples:

Minimal costs to expect:

  • Using an official Arduino UNO R3 + Arduino Motor Shield R3 + Power Supply, the cost is $25+$25+$12 = ~$62.
  • Using good “clones”, Elegoo UNO and FlashTree Motor Shield + Power Supply, the cost is $17 + $17 + $12 = ~$46
  • That requires usage via JMRI (no direct Wifi or ethernet).

If the goal is to bypass JMRI, then we need an option with an Arduino Mega and a wifi shield. This increases the cost by around $20+$15 respectively so in the range $100-$70 overall.

In my case, I selected:

My total was ~$50 plus taxes. Not bad considering DCC command stations are typically in the $200-300 range!

As I was tinkering, I first tried using an existing Arduino UNO I had then I tried again using the Arduino MEGA clone board. My first Motor Shield board was partially busted (only one of the 2 tracks had power) and it worked after I got an exchange.

Once we have all the hardware, we need to load the software on the Arduino board. That is done using “DCC EX Installer”. There’s a single download for Windows, Mac, or Linux which will install various tools such as Arduino CLI and other stuff. If you’re not a programmer already familiar with Arduino dev, just go with the easy installer. And even though I am familiar with Arduino development, I found the already-made installer excellent and quite a time saver. The installer asks which board one has -- it can automatically detect the Arduino “official” ones but not necessarily the clones, then it offers options. That’s where one would choose if they have a display, if they have wifi, if they want “1 dcc track + 1 dc” or just “2 dcc tracks”, etc.

As a developer, I think the DCC-EX folks did a fantastic job here at making this accessible instead of arcane -- and not just the installer, also their web site in general. There’s a ton of information -- for example on how to choose the hardware, and they clearly list what should work, what will not work, and what they recommend.


 Generated on 2024-11-20 by Rig4j 0.1-Exp-f2c0035