This is the download link for the TC Gold file, with the icons and backgrounds graphics. Please copy the yrrg file to the folder where you store your TC files. TC does not store background images inside the yrrg file. They can be placed in any folder and then double click the image icon (diagonal striped square) and tell TC where the image is stored.
The LCD is available in 4 colors, blue, orange, grey and green. The counters on the LCD screen have a comment that mentions the counter color used with each of the LCD colors.
Click the image to enlarge.
Over time several types of the Arduino DCC decoder software have been made, such as accessory-, servo-, function-decoder, S88 interface, DCC sniffer, Sound software. All are available from now on in one overall zip download:
To find the various blog posts and video’s on the subject please do a search (upper right, in header) on the words arduino decoder.
Please visit the Arduino website for download and installation of the Arduino development environment, needed to use Arduino sketches (‘sketch’ is the name for an Arduino software app).
Unzip the file and you’ll find the following folders:
The folders inside need to be moved to the Arduino Sketches/libraries folder on your PC. All other folders go into your Arduino Sketches folder.
Arduino sketch to control max 6 PWM channels that can control a 12V LED strip via nMOSFET’s. User manual desrcibing the needed hardware and how to configure the software is included.
Arduino sketch for a one address function decoder with max 13 outputs, controlled via the F0 – F12 buttons on your Command Station or handheld controller. More info on this post. Configuration is very straightforward:
int decoderAddress = 1830; // This is the decoder address, change into the number you want.
#define F0_pin 13 // Define the output pin for every Function number in use. 13 has on board LED.
#define F1_pin 0 // Available pin numbers: 3-19
#define F2_pin 0
#define F12_pin 0
ATtiny sketch for a one address function decoder with max 5 outputs, controlled via the F0 – F12 buttons on your Command Station or handheld controller. More info, see above.
Arduino sketch for DCC control of accessories. More info is available here. Configuration per output:
accessory.address = 1; // DCC address
accessory.mode = 1; // Continuous: HIGH until DCC switches the address off again
accessory.outputPin = 10; // Arduino pin to which this function is connected
accessory.address = 2;
accessory.mode = 2; // Oneshot: HIGH for ontime ms, then LOW and stays LOW.
accessory.outputPin = 11;
accessory.ontime = 1000;
accessory.address = 3;
accessory.mode = 3; // Flasher: HIGH for ontime ms, LOW for offtime ms, repeats till DCC off
accessory.outputPin = 12;
accessory.outputPin2 = 13; // Flasher can use 2 outputs, they will flash on/off alternatively
accessory.ontime = 500;
accessory.offtime = 1000;
ATtiny sketch for DCC control of accessories. Configuration is identical to the Arduino version above.
See this post for more info on installation of drives and ATtiny support for the Arduino IDE.
Arduino sketch for DCC control of servos. Click here for a list of posts on the servo decoder.
Configuration per servo:
servos.address = 1; // DCC address for this accessory
servos.outputPin = 13; // Arduino pin number for additional accessory output
servos.servo.attach(3); //Arduino pin number where servo is connected to
servos.offangle = 68; //Angle for DCC=off
servos.onangle = 126; //Angle for DCC=on
Very basic sketch that I use to tune the servo’s min and max angles to switch a turnout. The workings are explained inside the software. Here are a few video’s. Min / Max values are displayed on screen and then need to be manually configured in the DCC_Servo sketch.
Version of the accessory decoder sketch that can be used to switch turnouts that use two coils for switching. Some additional hardware is needed to power the coils, the Arduino outputs do not deliver enough current for that. Configuration:
accessory.address = 1; // DCC address for this accessory
accessory.durationMilli = 250; //Duration of pulse in ms
accessory.outputPin = 12; //solenoid 1 connection
accessory.outputPin2 = 13; // solenoid 2 connection
Arduino sketch on DCC control of playing sounds. For use with the Sound Software that also is included in the download. This version only plays sounds, has no accessory or servo functions, just to make it simple to use. More info here.
Arduino sketch that combines ‘all in one’ control of accessories and servo’s and can play sounds using the additional PC sound software. There’s also a delay function, that makes it possible to delay an output. Useful for instance with a railway crossing: first the 2 lights start blinking (2 output flasher function) and the ding-ding sound starts to play, then some time later the servo moves the beams down.
More info here.
Sound_Software (For MS Windows PC’s only)
Software to install on the PC that works together with the Arduino DCC_Decoder_Sound sketch to play sounds, triggered by DCC.
Some sample sounds for use with the DCC_Decoder_Sound and the Sound Software.
Detailed description how to install and to use the Sound Software and the DCC_Decoder_Sound.
Arduino sketch for connection of track sensors to an S88 bus and transmit their data to a command station or PC.
See this post for more info
I’d like to see if an Arduino can be used as an S88 16x detector board. Why? Well … for one it is just a fun challenge to see if we can get that to work. And next, more interesting, an S88 board sets you back some €40,- … an Arduino just some €6,- !
The S88 interface is a shift register with the timing diagram as shown in the image (info from this website). The ECoS sends out the “PS” and ‘Clock’ signals and reads the data line. I did some measurements on the ECoS. It sends out 512 clock pulses between the PS signals, which means it always reads the maximum of 32×16 detector inputs. With that knowledge I started work on the Arduino hardware and software.
The Arduino code can be downloaded here: Arduino s88 interface sketch.
The main loop scans all 16 inputs and stores the state in a 16 bit integer called ‘sensors’. Upon receipt of the PS pulse interrupt-1 is triggered, in which ‘servos’ is copied into an integer called ‘data’, after which ‘servos’ is reset to zero. Every ‘Clock’ pulse triggers Interrupt-0, which sequentially sends out the 16 bits from ‘data’ to the ‘dataOut’ pin, using a modulo 16 counter. After sending each bit it reads the data-in, to which the data-out of the next Arduino in the chain is connected. This way all sensors up to max 512 are sent to the Command Station.
The wiring between ECoS and Arduino, looking at the S88 connector, from left to right:
S88 pin – Arduino pin
1 data – 13 (dataOut and LED indicator)
2 GND – GND
3 Clock – 2 ( =interrupt 0)
4 PS – 3 (=interrupt 1)
5 Reset – not used
6 Vcc – 5V
not conn – 12 (dataIn)
Arduino pin 12 is used for ‘data-in’. If more than one Arduino is used, they can be ‘chained’ by connecting the data-out pin 13 of the next Arduino to the data-in pin 12 of the previous Arduino. The first one in the chain has data out pin 13 connected to S88.
For the sensors anything can be used that pulls an Arduino input to GND, like a reed switch or an optical detector. I wanted to try the TRCT5000. See the hardware page for details. However … I changed to using reed switches and little magnets under the rolling stock. See this blog post for a video on that. The reason is that the IR sensors are too sensitive to surrounding light.
See this blog post for a video that shows the Arduino S88 board in action, initially with just one Arduino and max 16 inputs.
And see this blog post for a video that shows the final version of the software, with miltiple Arduino’s in ‘chain’.
(Sep 2014) ECoS firmware 4 has a VNC server built in, which makes it possible to not only show the ECoS screen on your PC or tablet, but also to operate it! A very nice feature.
One could use the Internet browser and connect to the ECoS IP address. To get VNC to work Java Runtime Edition (JRE) needs to be installed and some Java security settings need to be modified. It’s all in the video mentione below.
In stead of using the web browser, the way I prefer is to use a VNC client on the PC, simply because it looks better. RealVNC has a viewer that has a small footprint. It does not even need an insall, just create a shortcut to the file and run it. Works very nice, with scalable window and some other options..
VNC clients are also available (for free) for tablets and smart phones. On the iPad I tried several. The one I liked best is the Mocha VNC Lite viewer.
See this post for a video on the connection and the use of the VNC server / client.
(Aug 2014) For model rail layout CAD: SCARM. It’s free and it’s easy to use.
For railraod control I intend to try out:
Traincontroller This is the software I currently use for layout control (Gold version). Many video’s are available on this blog on its use.
Koploper (a Dutch program, no English translation)
JMRI (Java Model Railroad Interface)
All are free software (iTrain is free with limitations, 3 types of licences are available fom €79,- onwards)