Old School – DC Control

powerpackmrcag990

The most basic kind of model train control has been around for decades. A variable DC power pack. The outputs from this are connected to the rails, turn the knob to the right, more power goes to the track and the locomotive goes faster, turn it toward the left and it goes slower. A slider or toggle switch controls the direction. Very simple.

However, this method has it’s drawbacks. The only thing you can control is the speed, any other functions you may wish to do (lights, sounds, etc) you basically can’t. Also, only one locomotive can be controlled at a time. Over the years, people have devised ways to make this work with multiple trains on large layouts but the wiring quickly becomes very complicated with toggle switches for specific areas of track and multiple power packs. Some people still do this but it’s rapidly fading out for larger layouts.

Digital Command Control – DCC

prodigye-rev-3DT402_jpg_2000x2000_q85

In the early to mid 90’s, a new form of train controls was introduced called Digital Command Control or DCC. This is an open source protocol that is now extremely popular and supported by almost all manufacturers. It uses a different method than DC to control trains. Instead of a variable voltage on the track, DCC uses a constant voltage and modulates that with a control signal. This signal is broken up into control messages, each with an address. Each locomotive is assigned it’s own unique address and then responds only to commands intended for it.

This system really changed the model train market and is the dominant form of control today. While the protocol is somewhat clunky when you get down into the bits, bytes and message packets, it does work quite well and is now the standard. Many small companies make various add-ons and circuits for DCC as it can be used to not only control the locomotives but pretty much anything else like turnouts, turntables, lights, sounds and various other animated things on a layout.

Here is a logic analyzer capture of a typical DCC bitstream

logicAnalyzer

Radio Control

While DCC is very popular in the smaller scales and is sometimes used in the large G scale locomotives, it presents a challenge when your track and layout are outside- which is typical of the larger G Scale market. For this reason and that the larger size of the locomotives in G scale, many modelers started putting Radio Control into their trains. At first, most would use a cheap airplane type transmitter but these are meant for flying airplanes so are somewhat awkward for controlling trains.

HK-T6XV2-M1(2)

I went this route at first and got one of these and took it apart. Took out the joysticks and replaced them with simple pots. This worked quite well and I experimented with this for a bit.

transmitter

The idea was to use R/C like this and have my tablet control the turnouts on the layout, so to that end, I tried this:

txhack

Commercial Solutions – R/C for trains

While this worked ok, it did present one serious problem, I could only control one locomotive per transmitter. Real pain in the rear when trying to run multiple trains. So I looked about for a commercial solution and did not find much. Two manufacturers, Crest and Airwire were all I could find and they were quite pricey.

Crest

crest

Airwire aw_t5000_1

Besides the price, there are a couple of problems I could see with these units. First, Crest is now, as of last month, defunct. So that leaves Airwire. Airwire is based on the 900mhz ‘Lynx’ chipset which is ok and able to switch channels to control multiple trains, but said trains have no knowledge of each other. In otherwords, it’s not a network, it’s just point to point control. Not what I was after.

BlueTooth

Image2

BlueRail


My Xbee Stuff

widgetsm

So, after a bit of research and some false starts with other chips, I decided to roll my own train controller with the Xbee as the core wireless device. This is my first breadboard for my device. It consists of an ATtiny 1634 Atmel microcontroller and the Xbee Series 1 device.

The Xbee is really nice device. Self contained with FCC approval out of the box. It offers a true point to multi-point wireless network that runs at 250kbs. It has an excellent range (for model trains anyhow) of 300ft. It is a bit pricey at $20 a pop but it’s a true industrial strength solution. The unit above is meant to be the device in the locomotive, here is my breadboard of the controller side:

handheldAnewradio

My design is setup to resemble a standard R/C sort of receiver unit with the connectors as servo pins- signal wire, 5v plus and ground. I had good success with the breadboard so I decided to have a set of PCBs done. I used pad2pad, which offers free PCB layout software and ordered up a batch. Here is the bare board and one populated:

nakedwidget
widget-pinscontrolwidget-R21

Hand-Held Controller

proto-front

proto-back