DCC Train AutomationAn independent UK guide to automating a DCC model railway — home

Computer control

How to build a DCC-EX command station with an Arduino

Assemble the free, open-source DCC-EX EX-CommandStation from an Arduino Mega and a motor shield, install the software with EX-Installer and drive your first train.

Time
2–3 hours
Difficulty
Medium
Cost
Moderate cost
Steps
8
Checked
Report a problem

What you’ll need

As an Amazon Associate we earn from qualifying purchases. The Amazon links go to search results, so you can compare what’s available.

Before you start

  • Never plug the higher-voltage track supply into the Arduino's own power socket by mistake.
  • Use enclosed, correctly rated mains power supplies from reputable sellers; don't open or modify mains units.
DCC-EX command station wiringTrack PSU12-16 V DCMotor shield(Vin trace cut)A: MAIN trackB: PROG trackArduino MegaUSB / 7-9 V
Wiring diagram Separate supplies for track and Arduino; output A to the main track, B to the programming track.

Step by step

  1. Step 1: Gather the parts

    DCC-EX's own parts list for a beginner build is: Arduino Mega (or clone), a motor shield (EX-MotorShield8874 or Arduino Motor Shield Rev3), optional EX-WiFiShield 8266, a 12–16 V DC track supply, a 7–9 V tip-positive Arduino supply (skip it with the 8874), a DC plug-to-screw-terminal adapter, USB cable, 18–16 AWG twisted pair and a known-good DCC loco.

    Next: step 2
  2. Step 2: Cut the Vin trace (standard motor shield only)

    On the Arduino Motor Shield, the Vin pin shares power with the Arduino. DCC-EX says more than 12 V on the shield can then damage or destroy the Arduino. Turn the shield over and cut the Vin trace with a craft knife (2–3 firm scratches), or bend out or snip the Vin pin. Check with a multimeter on resistance: no continuity across the cut. Not needed with the EX-MotorShield8874.

    Next: step 3
  3. Step 3: Fit the shield onto the Arduino

    Put both boards with the power connectors at the same end. Straighten any bent pins, line up pins 0–7 first, then the other side, and press gently with a slight rocking motion. Don't force it, and check no pin has missed its socket.

    Next: step 4
  4. Step 4: Connect the track supply – but don't plug in yet

    Connect the track supply to the shield's Vin (+) and GND (−) terminals, using the screw-terminal adapter for a plug-in supply. Get the polarity right.

    Next: step 5
  5. Step 5: Wire MAIN and PROG

    Output A is MAIN (your layout) and B is PROG (programming track) – on the EX-MotorShield8874 A is the output furthest from the barrel socket. If the programming track joins the main, connect the positives to the same rail so the two are in phase.

    Next: step 6
  6. Step 6: Install the software with EX-Installer

    Connect the Arduino to a Windows, macOS or Linux computer by USB and close anything else using the port. Download and run EX-Installer, let it install the Arduino CLI, choose your board, select EX-CommandStation, pick your motor driver and WiFi options, then Compile and Load. DCC-EX strongly advises beginners to use EX-Installer rather than the Arduino IDE. Antivirus software can sometimes block it.

    Next: step 7
  7. Step 7: Test with EX-WebThrottle

    Disconnect from the computer, connect MAIN to the track, power the motor shield, reconnect USB and wait about 30 seconds. Open EX-WebThrottle, connect over Serial, and send <s> to see the status line. Put the loco on MAIN, switch track power on, enter its address and press Acquire.

    Next: step 8
  8. Step 8: Add a throttle you like

    With WiFi fitted you can use Engine Driver (Android) or WiThrottle (iOS), or connect JMRI. See our JMRI guide.

Tips

  • DCC-EX notes the Arduino Motor Shield gives about 1.5 A in practice, so 18 AWG wire is plenty; higher-current drivers need thicker wire.
  • Use the voltage that suits your scale – DCC-EX warns too high a voltage can damage locos.

When to get expert help

If you're not comfortable with basic electronics, DCC-EX lists ready-to-run command stations from its dealers.

Questions people ask

Is DCC-EX really free?

The software is free and open source under the GNU GPL v3. You pay only for hardware.

Which boards are supported?

DCC-EX recommends the Arduino Mega, ESP32 and ST Nucleo boards; Uno and Nano are listed as not recommended.

Will it work with my existing decoders?

Yes – it generates standard DCC.

Sources

Checked 18 October 2026. We wrote this guide in our own words, using:

  1. DCC-EX home (dcc-ex.com)
  2. DCC-EX: purchasing parts (DIY) (dcc-ex.com)
  3. DCC-EX: initial assembly (DIY) (dcc-ex.com)
  4. DCC-EX: install the software with EX-Installer (dcc-ex.com)
  5. DCC-EX: test your setup (dcc-ex.com)
  6. DCC-EX CommandStation-EX licence (GPL v3) (github.com)

Tags: Arduino command station DCC-EX DIY EX-Installer open source

Was this guide helpful?

Report a problem with this guide
What’s the problem?

Please don’t include personal details we don’t need. See our privacy notice.