Building a Speedometer for model trains

Ever wondered how fast your model trains go? Here’s a way to measure the speed of your trains on your model railway.

As electronics projects go, this speedometer from is one of the more fun ones. One wired and set up (below) it’ll measure and display the speed in actual miles, or kilometers, per hour o your trains are going at scales speed from 1:1 (full size trains) to 1:220 (Z-gauge).

This guide comes via the supplier, the original instructions can be found here.

Initial setup

  1. Connect the cable from the IR sensors and IR LEDs, which terminates in an RJ-12 plug, into the matching receptacle on the circuit board.  Note that the RJ-12 plug looks like a standard telephone connector.
  2. speedo-1The two IR LEDs must be placed directly across from the two IR sensors.  They must be precisely aligned to get accurate results. The most accurate and reproducible results will be achieved if the IR sensors are placed as close as possible to the side of a passing train.  Note that the LEDs that are in the image below are no longer used as the software has been modified to send bursts of IR rather than a continuous stream.  Due to this modification the lights do not function.
  3. Connect the MSTS to an appropriate power source.
  4. If the sensors and LEDs are properly aligned when power is applied you should see an initial screen that shows the software version and a copyright notice.
  5. If the sensors are not properly aligned or if one or both are blocked the LCD will automatically display an LED alignment screen.  Adjust the position of the LEDs and sensors until both sensors display “ON”.  Press the “Program” button to exit and return to the setup screen.
  6. Test the sensors by blocking just one IR detector.  You should see “sw 1 activated” or “sw 2 activated” on the display.   Block the 2nd sensor and you should see the speed display screen.
  7. Note that the speed display screen will flash “TRAIN” until both sensors are unblocked.  This feature keeps a long train from giving multiple readings as the unit senses the space between cars as they pass.  When no train has been detected for several seconds “Train passed…READY” will be displayed and the unit will be ready to time the next train.

Setting scale

The range of scales supported is 1:1 through 1:220

  1. To activate the programming mode press and hold the “Program” button while the initial screen is displayed at power up.  The program button is the red button below the display in this picture.
  2. The display will show “SCALE ADJUST”, “Block Sensor to Adjust.
  3. Briefly block either of the sensors with your hand and you will see the current scale displayed followed by: “L = UP  R = DWN”
  4. To change the scale block the left or right sensor to move up or down the list of scales.
  5. Note that the text representations of scale (as displayed below) are not used in the latest software versions.    Scale is shown as a ration only, 1:24, for example.speedo-3
  6. Press the “Program” button when the desired scale is displayed
  7. You will be returned to the startup screen and can begin to use the unit.
  8. Note that once the scale setting has been changed the speedometer will remember it even after the power is disconnected

On the wired version of the MSTS you use the two IR sensors to adjust scale and other features.  On the wireless version (shown above) there are two additional buttons (the ones together on the left in this photo) that are used to make adjustments.

Using the speedometer

Once the scale is set just run your train through the sensors and the speed in real MPH (or KPH) will be on the first line of the display.  It will be expressed as a decimal rounded to the nearest 1/100 of a mile (kilometer) per hour.

speedo-4Scale (1:24, for example) and scale speed will be displayed on the 2nd line

If the sounder is activated the speed will also be “Beeped” out in code.  First the number in the 10s place of the scale speed will beep out then the number in the ones place.  If either is a zero a long beep will signify that.  If you manage to reach a scale speed in excess of 99 mph the number of hundreds will be beeped out using a different sound.  In the photo above the unit would beep once, signifying the 1 in 13, pause briefly then beep three time for the 3 in the ones place.


The sensors for the MSTS are made up of a pair of infrared LEDs and a pair of infrared detectors.  As mentioned above, the IR LEDs are pulsed at a frequency of 38 KHz and the detectors only respond to IR at that frequency.

The MSTS comes with one set of sensors that are mounted in a clear, plastic “U” shaped bracket.  This mounting method allows users to place the sensors over the track so that they can easily be moved from place to place on the layout or to another layout entirely.

The sensors can be mounted in any number of trackside scenery items.  The photos above show two “G” scale installations, one inside of two barrels and the other inside of two piles of railroad ties.

The sensors and IR LEDs are available separately.

Founder of ModelRailwayEngineer, Andy Leaning

Andy is a lifelong modeler, writer, and founder of He has been building model railways, dioramas, and miniatures for over 20 years. His passion for model making and railways began when he was a child, building his first layout at the age of seven.
Andy’s particular passion is making scenery and structures in 4mm scale, which he sells commercially. He is particularly interested in modelling the railways of South West England during the late Victorian/early Edwardian era, although he also enjoys making sci-fi and fantasy figures and dioramas. His website has won several awards, and he is a member of MERG (Model Railway Electronics Group) and the 009 Society.
When not making models, Andy lives in Surrey with his wife and teenage son. Other interests include history, science fiction, photography, and programming. Read more about Andy.

Afflliate disclosure:The links on this page may take you to carefully selected businesses, such as Hornby, Amazon, eBay and Scale Model Scenery, where you can purchase the product under affiliate programmes. This means I receive a small commission on any orders placed although the price you pay does not change. You can read my full affiliate policy here. I also sell my my own ready to use, pre-made and painted buildings and terrain features. browse the range.

Add Comment

Required fields are marked *. Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.