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
What you’ll need
- Arduino Mega 2560 or compatible (Uno R4 is not supported) Search Amazon for Arduino Mega 2560
- Motor driver: Arduino Motor Shield Rev3 or DCC-EX EX-MotorShield8874 Search Amazon for Arduino motor shield rev3
- Optional WiFi: EX-WiFiShield 8266
- Track power supply, 12–16 V DC (voltage to suit your scale) Search Amazon for 12V 5A DC power supply
- Arduino power supply, 7–9 V DC tip-positive (not needed with the EX-MotorShield8874) Search Amazon for 9V DC power supply 2.1mm
- 2.5 × 5.5 mm DC socket to screw terminal adapter Search Amazon for DC barrel jack screw terminal adapter
- USB A-to-B cable Search Amazon for USB A to B cable
- Twisted pair wire, 18–16 AWG Search Amazon for 18 AWG twin wire
- Craft knife and a multimeter Search Amazon for digital multimeter
- A decoder-fitted loco already known to work on DCC
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.
Step by step
-
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 -
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 -
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 -
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 -
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 -
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 -
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
Next: step 8<s>to see the status line. Put the loco on MAIN, switch track power on, enter its address and press Acquire. -
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:
- DCC-EX home (dcc-ex.com)
- DCC-EX: purchasing parts (DIY) (dcc-ex.com)
- DCC-EX: initial assembly (DIY) (dcc-ex.com)
- DCC-EX: install the software with EX-Installer (dcc-ex.com)
- DCC-EX: test your setup (dcc-ex.com)
- DCC-EX CommandStation-EX licence (GPL v3) (github.com)
Was this guide helpful?
Report a problem with this guide
Printed from dcctrainautomation.uk/guides/build-a-dcc-ex-command-station-with-arduino/ · Checked 18 October 2026 · General information only. Follow the maker’s instructions for your own equipment, and keep mains wiring inside properly made, enclosed power supplies.