My first decoder for controlling 4 servos to switch 4 turnouts. The little black boxes at teh bottom of the board are realsy for switching the frog power. The little PCB is for manual control and a typical servo is on the right side.
Jan 18 2009 - Do-It-Yourself DCC Accessory Decoders
I took a break from the carpentry of building the Donner Summit and decided to work on something I have wanted to get into for a while - DCC hardware and software. Like many people I have been a user of DCC and have installed a lot of decoders. However, for the last five years I worked for a Japanese instrumentation company and spent some time looking into using DCC to replace some of the systems they use for machine control. It became apparent that DCC would NOT work well for this kind of instumentation - most ntably because of the lack of easy two-way communication.
Now that I find myself with more time on my hands having been laid off from that company, I started seriously getting into building some decoders. Specifically I wanted to use model airplane servos for switching turnouts. They are small powerful and cheap and I happen to have a few dozen around the house leftover from my RC model airplane and battlebot hobby days.
I chose to use the Parallax SX system of chips (www.parallax.com) rather than the PIC family of microprocessors that virtully all the DCC manufacturers use. Mostly because the SX chips are really well suited to running mutliple servos while simultaneously interpreting the incoming DCC system as they are very fast. Also Parallax makes a BASIC compiler available for their chips and the programming system is a bit nicer. The picture on the right shows the first successful design. A nice thing about microprocessors for me is that they are 90% software and 10% hardware. Since I have been programming since the 60's and I built and sold a software company, the programming aspect was very appealing to me.
The servos are mounted with double-sided foam "servo" tape and the wire sticks up to move the points. What could be easier? Notice how thin the servo is - perfect for double-deck layouts with thin upper decks.
Now that I find myself with
more time on my hands having been laid off from that company, I started
seriously getting into building some decoders. Specifically I wanted
to use model airplane servos for switching turnouts. They are small
powerful and cheap and I happen to have a few dozen around the house
leftover from my RC model airplane and battlebot hobby days.
I
chose to use the Parallax SX system of chips (www.parallax.com) rather
than the PIC family of microprocessors that virtually all the DCC
manufacturers use. Mostly because the SX chips are really well suited
to running multiple servos while simultaneously interpreting the
incoming DCC system as they are very fast. Also Parallax makes a free BASIC
compiler available for their chips, there is a lot of nice code available at their web site and the programming system is a bit
nicer. The picture on the right shows the first successful design. A
nice thing about microprocessors for me is that they are 90% software
and 10% hardware. Since I have been programming since the 60's and I
built and sold a software company, the programming aspect was very
appealing to me.
The controller for my decoder has 2 LEDs to indicate the turnout state and a small button to switch the turnout mounted on a small PCB board. It is meant to be mounted behind teh fascia with the LEDs and button sticking out 3 holes.
Frankly the hardest part of the project was trying to understand the almost completely opaque and totally dry NMRA DCC specs. These specs could use some real life examples and some code psuedocode to show how to implement it. The standards also layered with lots of legacy stuff left in to maintain backwards compatibility. However, once I got through all the layers it turned out to be straightforward to implement. I now have a number of decoders happily switching on my Tam Valley layout. It turned out to be trivial to adapt the decoder to drive my old Tortoises so I removed the DPDT switches I used for these and replaced them with my decoders. Now I can control the turnouts from my hand controller. The real advantage though is the ability to set up routes - one button switching of groups of turnouts. This really makes running the railroad a lot simpler.
I am getting back to the carpentry this month and moving forward on getting the staging basement built. I'll get back to you when that is done!