Computer Controlled Railroad
 with Multiple Cars

Erik Riggenbach
Computer Science Major
Senior at St Norbert College


Here Is the Project

My project is to create an operating system for a model train.  The track setup has photo cell sensors embedded into the track.  I am to use these to track the progress of the train around the track.  There are also turn outs that need to properly turn when requested.  This whole system is to run under computer control.  I/O boards are used to relay the information from the computer to the track\train as well as provide feed back from the track to the computer.  There is no communication from the train to the computer. Having laid out a brief description of what the setup is for this project, there are several objectives that need to be completed to consider this project a success. 

The program must correctly allocate the photocells and turnouts to the train.

It must be able to couple and uncouple cars .

It must detect uncoupled cars.

It must block the train when a resource it requests is unavailable and restart the train when that resource becomes available.

Detect the speed (to scale) and direction of the train.

Use the libraries that were developed last year

Be able to control the speed, direction, stop and emergency stop.

Implement one other application:  For this I chose to switch the order of two cars on the train.  Essentially decouple both and re-couple them in the opposite order

This web site is dedicated to explaining how I did this.  I will explain both the hardware and the software solutions.