DCC Plus Plus
Summary: DCC Plus Plus is an open-source hardware and software system for the operation of DCC-equipped model railroads.
The DCC++ system consists of a DCC++ Base Station and DCC++ Controller.
The DCC++ Base Station consists of an Arduino microcontroller fitted with an Arduino Motor Shield that can be connected directly to the tracks of a model railroad.
The DCC++ Controller provides operators with a customizable GUI to control their model railroad. Written in Java using the Processing graphics library and IDE and communicates with the DCC++ Base Station via a standard serial connection over a USB cable or wireless over BlueTooth.
DCC Plus Plus BaseStation
DCC++ BASE STATION is a C++ program written by Gregg E. Berman for the Arduino Uno and Arduino Mega using the Arduino IDE 1.6.6 or higher.
A standard Arduino Uno or Arduino Mega with an Arduino motor shield (as well as others) can be configured a fully-functioning Digital Command Control Command Station with integrated Booster that conforms to the current NMRA DCC standards.
The newest version of DCC++ BASE STATION supports:
- Two and Four Digit addressing
- Simultaneous control of multiple locomotives
- 128 speed steps
- Functions F0-F28
- Activate/de-activate accessory functions using 512 addresses, each with 4 sub-addresses
- Optional functionailty to monitor and store of the status of turnouts
- Programming on the Main
- write configuration variables
- Programming Track
- read CVs
Controlled with simple text commands via the Arduino's serial interface, or other supported interfaces. When compiled for the Arduino Mega, communications can be via Ethernet. DCC++ Controller, (available separately) a configurable graphic interface to the DCC++ Base Station.
The Author's Announcement
The DCC ++ implementation was announced on Trainboard by the author:
- 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). All of the code for the Arduino is written in C++ using the Arduino open-source IDE, hence I named my home-brew system DCC++ (pun intended).
- The interface is written in Java using another open-source IDE and basic graphical library called Processing. The interface runs on Windows as well as Mac systems, though I have not yet written an iOS version. Connection between the PC/Mac and the Arduino is either by USB cable or BlueTooth for wireless control.
- The system itself supports just about everything you can do with DCC, including multi-train throttles, 28-function decoders, programming on the main, reading and writing CV's from a dedicated programming track, controlling turnouts, etc. It has built-in support for IR sensors which I have found work very well for train detection and enable complete automation of very complex operations.
- One of the reasons I created DCC++ is because I was disappointed with the commercial controller I had purchased when I first started building my N-scale railroad. I really want to automate my entire layout and thought I might give JMRI a try, but at that time it did not support my controller. But the real reason I created DCC++ was because I always wanted a good excuse to program an Arduino, and a good reason to learn Java.
- All of the code, both the C++ for the Arduino as well as the Java for the interface were developed by me from scratch and are not derivations of any other system, commercial or otherwise. Since I relied heavily on other open-source systems (Arduino and Processing), my intention is to provide all of my code back to the community for anyone to freely use, modify, hack, distribute, etc.
- Though all of my code is heavily documented, bundling any code for distribution to others in a way that is useable is not that easy. So, as an initial step in this process I've created a DCC++ youtube channel with a few videos demonstrating the interface as well as showing how the system is used to fully automate my small but complex N-scale layout.
- Over the next few weeks I plan on creating and uploading a few more detailed videos that explain how the Arduino is configured, how the Arduino Motor Shield turns out to be the perfect add-on for producing two channels of bi-polar signals (one for the Main track and one for the Programming track), how the Java graphical interface works with the Arduino, and how to create some simple IR sensors for use with the system.