---
title: "MRR Speedometer (Arduino)"
canonical_url: "https://www.widowcreekrailroad.com/mrr-speedometer-arduino/"
published: "2026-08-05T14:27:02+00:00"
modified: "2026-08-25T15:37:18+00:00"
author: "Chris"
featured_image: "https://www.widowcreekrailroad.com/wp-content/uploads/2025/03/speed-fet.jpg"
---

# MRR Speedometer (Arduino)

## Article

# MRR Speedometer (Arduino)

Aug 5, 2026 \| [General](https://www.widowcreekrailroad.com/category/general/), [The Build](https://www.widowcreekrailroad.com/category/the-build/) \| [6 comments](https://www.widowcreekrailroad.com/mrr-speedometer-arduino/#respond)

![MRR Speedometer (Arduino)](https://i.ytimg.com/vi/ro1C2nhckyQ/hqdefault.jpg)

Several years ago, while working on DCC programming and speed matching locomotives, I wanted a simple way to see how fast a locomotive was actually moving. Judging speed by eye only gets you so far, and measuring a section of track, timing a locomotive and doing the math every time gets old pretty quickly. 

It also seemed like exactly the kind of problem an Arduino could solve.

The basic idea behind the MRR Speedometer is pretty simple. Two infrared sensors are placed a known distance apart along the track. When a locomotive passes the first sensor, the Arduino starts measuring time. When it reaches the second sensor, the Arduino knows how far the locomotive traveled and how long it took to get there. From those two numbers it can calculate the scale speed and display it immediately in miles per hour.

Since the sensors operate independently of the track, the speedometer doesn’t care whether the railroad is running DC or DCC. It also works in either direction. Whichever sensor the locomotive encounters first starts the measurement and the other completes it.

[![](https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/mrr-speedometer-f5-200x200_c.jpg)](https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/mrr-speedometer-f5.jpg)

Components

Everything needed for the original MRR Speedometer prototype: an Arduino Nano, infrared sensors, LCD display, breadboard and a handful of inexpensive components.

[![](https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/mrr-speedometer-e-200x200_c.jpg)](https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/mrr-speedometer-e.jpg)

Breadboard Protype

The original working prototype. Before making anything permanent, I used a breadboard to work through the sensor placement, timing and software and make sure the idea actually worked.

[![](https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/mrr-speedometer-a-200x200_c.jpg)](https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/mrr-speedometer-a.jpg)

Finished build

The completed speedometer moved from the breadboard onto a permanent prototype board, with the Nano, two infrared sensors and display connections all in one compact package.

### Using It on the Railroad

The original version used sensors spaced about 2.65 inches apart, but there isn’t anything particularly special about that distance. The software can use whatever distance exists between the two detection points. The scale is handled the same way, allowing the same basic hardware to calculate speeds for Z, N, HO, S, O or G scale.

I also experimented with several different ways of mounting the sensors. They can sit beside the track as part of a portable speedometer, but there is no reason they have to be obvious. They can be separated and incorporated into scenery or structures as long as they can reliably detect the train and the distance between them is known.

Where the speedometer became especially useful was DCC speed matching. Rather than watching two locomotives and trying to decide whether they looked close enough, I could run each locomotive through the speedometer at several throttle settings and have an actual number to work with. Make an adjustment to the decoder, run the locomotive through again and immediately see the result.

It was also a good reality check for normal operation. Model trains have a funny way of looking slower than they really are. Something that appears to be moving at a reasonable switching speed can look considerably different when the display says 30 scale miles per hour.

The electronics for the project were deliberately simple. An Arduino Nano handles the timing and calculations, two inexpensive infrared sensors detect the train, and a small LCD displays the result. I initially built everything on a breadboard while working through the software and sensor placement, then moved the project onto a more permanent prototype board once I was happy with it.

At the time, that was really all I was trying to accomplish.**I needed a speedometer, so I built a speedometer, the way I wanted it.**

- Scale: Z, N, HO, S, O, G
- Kits include v2 Components
- Bi-Directional
- DC or DCC
- Displays Scale Speeds

- Speed match your DCC locomotives
- 4 Different Sensor configurations
- Compact and portable
- On-board Status LEDs.
- It requires a 5v supply, USB, or direct for the Nano.

### One Piece of a Larger Puzzle

What became more interesting over the years was the idea behind it.

The infrared sensors don’t actually know they’re part of a speedometer. One simply reports that something has happened at one location and another reports that something happened somewhere else. The Arduino gives those two events meaning. In this case it uses the time between them to calculate speed, but measuring speed is only one thing you can do once the railroad can tell you where something is happening.

A train passing a sensor might affect a signal. It might trigger lighting in a building, start an audio sequence, operate an animation or tell another part of the railroad that a train has entered or left an area. Two or more events can also be related to each other instead of every little electronic project underneath the railroad living completely on its own.

That’s part of the thinking behind IRROD, the system I’m currently developing for my own railroad.

IRROD isn’t simply this speedometer expanded into something larger, and I’m not trying to turn every old Arduino project I’ve built into part of it. But projects like this are where a lot of the ideas came from. They gave me a chance to experiment with sensors, microcontrollers and physical events on the railroad and start thinking about how those pieces could work together.

The speedometer still does exactly what I originally built it to do. Put a locomotive through the sensors and it tells me how fast it’s going.

It just turned out to be one small piece of a much larger puzzle.

## SEO metadata (SSL)

- Seo title: Arduino Model Railroad Speedometer \| Widow Creek Railroad
- Seo description: Build and use an Arduino model railroad speedometer that measures locomotive scale speed with infrared sensors. Bi-directional and compatible with DC or DCC.

## Social metadata (SSL)

- Social title: Arduino MRR Speedometer: Measure Scale Speed
- Social description: See how an Arduino and two infrared sensors measure locomotive speed in scale MPH for realistic operation, DCC speed matching, and consistent running.
- Social image: https://www.widowcreekrailroad.com/wp-content/uploads/2026/08/speedometer-fb.png

## Published JSON-LD


```json
{
    "@context": "https://schema.org",
    "@graph": [
        {
            "@type": "WebSite",
            "@id": "https://www.widowcreekrailroad.com/#website",
            "url": "https://www.widowcreekrailroad.com/",
            "name": "Widow Creek Railroad",
            "alternateName": "WCRR",
            "description": "Widow Creek Railroad explores smaller, smarter, and more interactive model railroading through compact layouts, modular construction, realistic railroad operations, electronics, software, and hands-on experimentation. The website documents Creekside Timber \u0026 Milling, a fictional N scale railroad inspired by the Denver \u0026 Rio Grande and Colorado\u0027s Marshall Pass region, along with practical projects involving T-TRAK modules, switching operations, sensors, microcontrollers, 3D printing, and digital fabrication. It is also the development home of RAILS (Railroad Awareness, Intelligence \u0026 Logistics System) and IRROD (Interactive Railroad Operations Dispatcher), technologies designed to enhance model railroad operations while keeping the human operator in control.",
            "inLanguage": "en-US",
            "publisher": {
                "@id": "https://www.widowcreekrailroad.com/#organization"
            }
        },
        {
            "@type": "Organization",
            "@id": "https://www.widowcreekrailroad.com/#organization",
            "name": "Widow Creek Railroad",
            "url": "https://www.widowcreekrailroad.com/",
            "alternateName": "WCRR",
            "logo": {
                "@type": "ImageObject",
                "url": "https://www.widowcreekrailroad.com/wp-content/uploads/2017/04/wcrr-2026-logo-v2.png"
            },
            "image": {
                "@type": "ImageObject",
                "url": "https://www.widowcreekrailroad.com/wp-content/uploads/2026/10/wcrr-fet.jpg"
            },
            "description": "Widow Creek Railroad is a model railroad project focused on building smaller, smarter, interactive railroad experiences through meaningful switching operations, modular construction, electronics, software, sensors, sound, fabrication, and practical experimentation. The current railroad is Creekside Timber \u0026 Milling, a compact N scale switching railroad inspired by the Denver \u0026 Rio Grande and the high country around Marshall Pass, Colorado. Widow Creek Railroad is also the development home of RAILS, the Railroad Awareness, Intelligence \u0026 Logistics System, and IRROD, the Interactive Railroad Operations Dispatcher, modular technologies designed to work across different layouts, scales, and operating environments.",
            "knowsAbout": [
                "Model railroading",
                "Compact model railroads",
                "N scale model railroading",
                "HO scale model railroading",
                "T-Trak modular railroading",
                "Model railroad operations",
                "Switching operations",
                "Switching layouts and puzzles",
                "Denver \u0026 Rio Grande",
                "Marshall Pass",
                "Creekside Timber \u0026 Milling",
                "RAILS Railroad Awareness, Intelligence \u0026 Logistics System",
                "IRROD Interactive Railroad Operations Dispatcher",
                "Model railroad electronics",
                "Arduino",
                "ESP32",
                "Microcontrollers",
                "Sensors and controls",
                "Digital Command Control",
                "Model railroad sound and lighting",
                "Modular railroad technology",
                "3D printing",
                "Laser cutting and fabrication",
                "Track planning",
                "Model railroad scenery"
            ],
            "makesOffer": [
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Model railroad project documentation"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Model railroad reference resources"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Interactive model railroad technology development"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Online model railroad tools"
                    }
                },
                {
                    "@type": "Offer",
                    "itemOffered": {
                        "@type": "Service",
                        "name": "Educational project documentation"
                    }
                }
            ],
            "keywords": "Widow Creek Railroad, Creekside Timber \u0026 Milling, RAILS, Railroad Awareness, Intelligence \u0026 Logistics System, IRROD, Interactive Railroad Operations Dispatcher, Compact model railroading, N scale, HO scale, T-Trak, Model railroad operations, Switching operations, Switching layouts, Denver \u0026 Rio Grande, Marshall Pass, DCC, Arduino railroad electronics, ESP32 railroad electronics, Model railroad sensors, Model railroad sound, Model railroad lighting, Modular railroad technology, 3D printing, Laser cutting, Track planning, Model railroad scenery",
            "email": "chris@widowcreekrailroad.com",
            "sameAs": [
                "https://www.facebook.com/chrissgaraglino/",
                "https://twitter.com/outdoorlifeus",
                "https://www.instagram.com/chrissgaraglino"
            ],
            "foundingDate": "1999",
            "founder": [
                {
                    "@type": "Person",
                    "name": "Chris Sgaraglino"
                }
            ],
            "slogan": "Smaller. Smarter. Interactive.",
            "areaServed": [
                "Worldwide"
            ],
            "brand": [
                {
                    "@type": "Brand",
                    "name": "Widow Creek"
                },
                {
                    "@type": "Brand",
                    "name": "Widow Creek Railroad"
                },
                {
                    "@type": "Brand",
                    "name": "Creekside Timber \u0026 Milling"
                },
                {
                    "@type": "Brand",
                    "name": "RAILS"
                },
                {
                    "@type": "Brand",
                    "name": "IRROD"
                }
            ],
            "address": {
                "@type": "PostalAddress",
                "addressLocality": "Jacksonville",
                "addressRegion": "Arkansas",
                "postalCode": "72076",
                "addressCountry": "United States"
            },
            "contactPoint": {
                "@type": "ContactPoint",
                "email": "chris@widowcreek.com",
                "contactType": "General inquiries",
                "areaServed": [
                    "Worldwide"
                ],
                "availableLanguage": [
                    "English"
                ]
            },
            "dateModified": "2026-10-08T10:28:25-05:00"
        }
    ]
}
```


## Published JSON-LD


```json
{"@context":"http:\/\/schema.org\/","@id":"https:\/\/www.widowcreekrailroad.com\/mrr-speedometer-arduino\/#arve-youtube-ro1c2nhckyq","@type":"VideoObject","author":{"@type":"Organization","name":"Chris Sgaraglino"},"embedURL":"https:\/\/www.youtube-nocookie.com\/embed\/ro1C2nhckyQ?feature=oembed&iv_load_policy=3&modestbranding=1&rel=0&autohide=1&playsinline=1&title=0&autoplay=1&enablejsapi=1","name":"MRR Speedometer (Arduino)","thumbnailUrl":"https:\/\/i.ytimg.com\/vi\/ro1C2nhckyQ\/hqdefault.jpg","uploadDate":"2023-12-27T20:49:18Z","description":"Speedometers are mandatory safety equipment in the driver\u2019s cab of locomotives, so it only makes sense that your railroad should have the same. But speedometers can be more effective than just displaying speed, especially for the modern Model Railroader.\n\nSpeed matching your consisted DCC locomotives is vital to the health of your locomotives and the smooth operations of your layout. The objective is to get your locomotives to run at the same speed. Not just the consist pair, but all of them so that you can consist any of them anytime with any loco in your fleet.\n\nOld-school speed matching involves running locomotives on a long section of track and timing how long a locomotive takes to travel a defined distance. For N-Scale, 15-20 feet is needed; adjust this method to your scale, blah, blah, blah\u2026 Now, run your best locomotive past the speedometer and adjust the speed table of each locomotive to match.\n\nMore Info:"}
```

