Arduino and O Gauge Model Railroading

So the interesting thing about O gauge Model Railroading is that the this is a three rail system that uses AC rather than DC. Unlike DC locomotives where to run in reverse you reversed the current, older O scale locomotives required the cutting of power. A locomotive running forward, cut power to neutral, cut power to reverse.

The newer lionel locomotives come with an RC remote that controls the train itself. The track receives a constant power.

I have a few projects in mind and am unsure on where to begin with any of them because I am very new to electronics and programming. However, the project that I am most interested in figuring out how to start is to replace the RC remote controlling my son's percy with an arduino board so I can control forward and backward. Then to control switch points to automate the train some. I do not want to destroy the remote.

Project 1: Replace/Replicate RC remote to control Percy
Tasks -

  1. Determine how to receive and decode the signal that the track master remote transmits. Forward, backward, stop,(all on a dial), and three sound whistle buttons.

  2. Program Arduino board and Radio transmitter to transmit these codes to train.

  3. begin work of programming siding switches to direct the train on various routes using forward, stop, and backward. As well as built in sounds when leaving stations, etc..

Project 2: Find a way to control the variable voltage the train needs to run with programs to stop voltage to trigger neutral in reverse for the three pre-war Lionel trains I own.

  1. Figure out how to translate code coming from arduino into AC voltage set by the arduino program speed control(possibly using current transformer). I thought of using servos to physically move the throttle stick,but would prefer something more elegant.

  2. design forward, backward, neutral cases to cut power to track to switch between these states.

If you have any input on parts i could use for either of these projects, please let me know. Or if you know helpful tutorials that can help me accomplish this, please pass them on. Especially the RC remote item.

If I were trying to reverse engineer the remote, I think at a minimum, I'd need to know the frequency at which the existing radio link works, and the modulation format. Depending on that information, I'd try to break into the receiver in the locomotive and read the demodulated data, which is probably a few simple bit patterns. At the very least, I think you'd need an oscilloscope that operates at the demodulated data rate to determine the needed information. If you are very new to electronics, I think you'll need quite a bit of study for this. Reverse engineering is almost always harder than forward engineering, which is hard enough.

I am controlling an OO Gauge train with an Atmega 328 and an nRF24L01+ 2.4GHz transceiver at each end of the communication. My loco is battery powered, but there should be no problem adapting the system to use track power, including, presumably an AC powered track. All this should be much easier in O Gauge because there is more space.

If you want to use an Arduino to interface with an existing wireless control system I suspect I have little useful experience.

...R

rutledgek:
So the interesting thing about O gauge Model Railroading is that the this is a three rail system that uses AC rather than DC. Unlike DC locomotives where to run in reverse you reversed the current, older O scale locomotives required the cutting of power. A locomotive running forward, cut power to neutral, cut power to reverse.

Memory serves that Märklin trains ran on AC and reversal was achieved by an over-voltage pulse.

I pulled this from an article on the original marx trains.

Most Marx motors have a simple directional device known as an "E" Unit. The E unit is engaged every time the motor is turned on and off. Each time the E unit is engaged, it changes the direction which the train will go. Modern O Gauge E units tend to have a third stage: neutral. Marx motors only have forward and reverse.

I could control various parts of the track with the arduino and some sort of controller to control the voltage going to the various sections of track. This method of control has long been used with physical switches. However, the problem with this set up is that this method of control does not work with some of the RC LionChief Remote trains(my percy).

Is there an AC motor driver that can be used with an arduino board to power the track and run the train. I see plenty of DC options, and O gauge can run on DC, but some of the elctronics in the newer locomotives will malfunction(play continuously) on DC.

When a controller enters the model scene, most locomotives include their own slave controller, that allows them to move independently from the supplied voltage.

I am looking at classic control of the engines which is an AC motor in the engine itself. Speed is set by the voltage running through the tracks. Direction is set by a switch that detects a drop in voltage to 0. Direction is set in a forward - Neutral - Backward - Neutral - forward setting.