yorkshirengauge.org.uk
Hints and Tips
Arduino Signal Control

Inspired by other DCC users who have been using Arduino devices to control turntables and traversers, I have been doing some experiments to try and use one for Signal Control. 

There is allot of information on the web about how to get an Arduino connected up to your DCC System, I found a simple enough circuit to isolate the track voltage from the Arduino and get the DCC Packet info to it safely (http://www.mynabay.c...o-dcc-monitor-2). Then using a slightly modified version of their 'sketch' (DCC_Signal_Decoder.ino), I did some testing using the Arduinos Serial Monitor and my Sprog as a Command Station.

After some tweaking of the wires on the breadboard, the Arduino sprang to life and started reacting to the accessory commands being sent from the Sprog. Now it was time to put some LEDs and resistors (220 Ohm for the Arduinos 5v) onto the board and see what would happen. This is what I ended up with, seen here mocking up two 3 aspect signals displaying 'Proceed'. 

20140318_205353.jpg

OK, so I had an Arduino Decoder with working LEDS now, but each aspect was being controlled independently and had a separate address. This didn't make for very realistic control from a throttle as the aspects would remain lit or the signal go out while the operator fumbled with the addresses. So what I needed was some control to send a burst of packets, to the signal to 'throw' or 'close' all of the aspect LEDs at a time. I decided on JMRI to do this, as it has an incredible level of support for signal logic, but it's a bit of a steep learning curve, so when I found these tutorials on YouTube it really helped. 



There should be 8 of them, but I could only find 1-7. Even so, Nigel and Kevin really deliver the info well and at a reasonable pace, thanks guys if you read this.

So in a very short time, I'd defined my Signal Heads (in my case 3 Aspect), linked them to the Accessory addresses that the Arduino was reacting to and attached them to Signal Masts in JMRI meaning that I could then control them by setting the signals to 'Proceed', 'Caution' and 'Stop'. Here's a short video showing the signals being set to each in turn.

 

Rather than use the Arduino Uno Rev 3 shown here, a cheaper alternative is to use Arduino Nanos, which if you shop around can be bought for around £5, add to that some vero board and components for the DCC Bus opto-isolator and it's possible to build a Accessory Decoder, able to operate as either 11 (digital only) or 17 (using the analogue output as digital) individual addresses for £7.

Cheers, Mark.
 

HomeNewsDiaryMembers - NewsletterMeetingsExhibition LayoutsStandardsDCCShowsHints and TipsLinksContact Us