Train Modeling Digital Control (DCC)


    This is a common project with my father, building a train modeling. One more time it could be simple, but I had decided to challenge myself once again.  The train modeling had changed with years, now you can have more than one engines on the same track and each one could have a different speed, direction "watch out".  It's done by sending data on the track by reversing the voltage on the track with an exact timing protocol. 

Like you can imagine it's not the output of your MCU who drive directly the track, you need a driver that will at lease give you 3 amps.  Those controllers already existed but it's costly and they don't do what I was looking for. You can find more info on the protocol and how it's work just by typing "+DCC+train" in Google, that's what I have done.


  • Control 4 engines simultaneously
  • Control 30 switches
  • Short track detection and power cutoff
  • Side track programming engine registers
  • Train head beam control
  • Firmware upgradeable



Schematic DCC MCU Control in PDF format
Schematic DCC Driver in PDF format
Source Code
DCC protocol standard 1/2 in PDF format
DCC protocol standard 2/2 in PDF format

4 Comments to “Train Modeling Digital Control (DCC)”

  • Zsolt November 18, 2010 at 11:32 am

    Could you upload the latest source code, becouse I can't compile it.

  • Sylvain Bissonnette November 18, 2010 at 1:46 pm

    With time the compiler had change, and I never modify this old code to work with the new compiler,


  • Zsolt November 20, 2010 at 12:23 pm

    The "void Sound(unsigned char i);" implementation is missing from the Lcd.c source file. Without this I had to comment the sound from TrainControl, but I could to compile.

  • Sylvain Bissonnette November 22, 2010 at 2:23 pm

    I m not shure but I think this function is with the keypad function?

Post comment

Please note

All my source codes were taken from my personal projects.

Everything is for your information only. The C/C++ codes have been written
with ICCAVR. You can find the header and source CRT files by downloading their compiler.

All is for your information and everything is AS IS without any warranty of any kind. No other files are available and I don't make any modification for any body.



Electronic Links


AGC Anemometer AVR AVR Bootloader Bootloader Capacitence Capacitor Clock Color Control DCC Debugger Devices Digital driver Function Generator High Gain Microphone Humidity Inductance Inductor Laser LCD LED 3W Library Lightning Detector MegaLoad Meter Moodlight Mood Light MS5534 Nixie OscilloScope projector Rain Fall Sensor rgb RGB LED Scop Sensor SHT75 Temperature Terminal Tipping Bucket Train Modeling Vintage Water Detector