Here's a project I've been working on for the last, oh... year or so, that I thought folks might be interested in.
A little background: I've been running DCC on my layouts for a while now. I do a large, temporary layout around the holidays each year (see this post for more details), so I wanted a standalone DCC accessory decoder for my turnouts. Nothing commercially available fit the bill, and I don't already have nearly enough other projects going on, so...
I decided to design and build one myself. I wanted to be able to basically just pop the turnouts into the layout like any other piece of track - no setup after installation, no wiring, but still independently controllable. Also, I wanted something based on a widely available microprocessor, so that it would be supported and upgradeable well into the future. The design had to be DCC powered and controlled for easy installation, and the whole thing had to be small enough (both the electronics and the mechanical bits) to attach to the side of a turnout and be installed above board.
Skipping months of development and getting to the good part, here is a picture of the completed assembly installed on a #4 Ross Custom turnout.
And the same turnout from the underside showing the circuit board in the enclosure:
I came up with three different versions of the circuit board and enclosure designs, one for standard size turnouts, one for longer turnouts like the #6s and #8s, and one for double crossovers like the Ross model #175 or #280. The long version has two relays for controlling the turnout leads depending on the position. The crossover version controls four servos instead of just one, and has four relays for all the turnout leads. All three versions share a similar design and features, including:
- Operation configurable via CVs
- Controllable via accessory commands for normal turnout operation
- Controllable via signal aspect commands for external outputs and optional functions
- Non-derail sensors (contact or optical) automatically throw the turnout for trains approaching from the wrong direction
- Two solid state relays for powering or grounding switch rails as needed
- RGB LED for status indication
- Manual control via pushbutton on enclosure
- 5A switching power supply powers the board, servos, and externally accessible 5V output
- Two external controllable outputs for lighting or other accessories
- Servos are powered off when not in use
- Two servo speeds, slow for normal operation and fast for non-derail
- Software upgradeable in place
Here are a couple pics of the printed circuit board assembly. The blue Arduino daughterboard is an off the shelf item from Sparkfun. The green PCB is the part that I designed and built.
I wrote up a paper detailing the mechanical, electrical, and software aspects of the design, if anyone is interested in more details. It's on my website here. The code is maintained on GitHub, which I will open up once it's a little more combat proven.
At this point, I have sixteen of them built and installed on an assortment of Ross Switches, including a bunch of #4s, some O72s, two #6s and two O96 curved switches. I am putting the final touches on the installation on a #280 crossover as I type.
Setup of this year's layout starts tomorrow, so I better finish up tonight!
Update 9/10/18:
Here is the github repository for the code I developed.
Update 4/7/20:
For a related project that builds on some of the development I did for this one, see my Tale of Two Turntables.