An Unexamined Railroad Is Not Worth Running

David G. Bodnar
September 29, 2007

My apologies to Socrates for paraphrasing his quotation for the title, but I must admit that I am one who loves to measure, count and analyze things.  This interest in quantifying my world came a few steps closer to being satisfied recently when I was exploring one of our local retail establishments.  I am always on the lookout for items that I can “repurpose” for use in my garden railway. In was in Wal-Mart and a small, inexpensive pedometer caught my eye. A pedometer is a device that is designed to count the number of steps you take in given time, frequently a day, so that you can determine how far you have walked and the amount of energy you may have expended.

This pedometer had a number of interesting features . It had a digital LCD readout that would count to 99,999 (5 digits), a reset button and a mode button that recorded miles walked rather than steps.  One of its most interesting feature was the price, $3.88!

I knew that pedometers usually depend on a weighted mechanical switch mechanism that adds one to the count every time it is jostled. If the connections to this switch were readily accessible inside of the unit I would have a counter that I could use for any number of different things.

Disassembly was just a matter of removing three screws from the back of the unit and separating the two halves of the case. Inside, as I suspected, I found a weighted arm that moved up and down as the pedometer was shaken. The end of the arm came into contact with a small metal spring. To test if I could use an external switch with the unit I simply touched a piece of wire to the arm and the metal spring and observed the display. Each time I touched the wire the count increased by one, excellent!

Next I drilled two small holes in the back of the case and passed thin wires through them. I soldered the end of one of these wires to the spring and the other to the base of the metal arm. I reassembled the pedometer and touched the ends of the newly added wires together and the count increased each time the circuit was completed.

Now that I had an inexpensive digital counter I had to put it to work. The first project was to connect a small magnetic reed switch to the end of the wires. As you may know, a reed switch is a small glass tube containing two magnetized contacts. When a magnet comes close to the reed switch the contacts come together, completing an electrical circuit.  For detailed information on reed switches see my article "Garden Railway Sensors - Part 1"

One of my engines is battery powered and controlled by a microprocessor circuit that I designed (see: "Robot Trains in the Garden" ). The engine moves back and forth on a 30 foot piece of track that runs between my railroad's coffee mine and the coffee refinery. I knew that the batteries in the engine were good for more than 6 hours of operation but I had no idea of how many round trips it made. Just recording time would not work since the speed and delay at each end of the track are random. The modified pedometer was just what I needed to satisfy my curiosity.

I attached the reed switch to the space between the rails with some foam tape and glued a small magnet to the bottom of the engine so that I would pass directly over the reed switch each time it went by.  After starting the train on its coffee run around noon I glanced at the counter a few times throughout the day just to make sure it was working properly.  I forgot about it until near dark when I returned to the back yard to find the engine slowed but still running.  The most surprising thing was the count, just under 1000 trips back and forth from the mine to the refinery.  Not bad for a little engine and 12 NiMh AA cells!

In this photo the train passes the pair of counters that I used for testing.  Can you tell the direction it is traveling from the counter readings?

Other Uses

Other uses for the counter quickly came to mind. Since the counter does not have an automatic power off function it can easily be used to keep track of the number of times a mechanical device, a switch or semaphore signal for example, were activated. If the counter were waterproofed inside of a clear plastic pill bottle or plastic case it could be left outside indefinitely.

The counter could also be used to count the number of times a particular engine passed a point on the track by installing the reed switch and counter on the engine and the magnet on the track. This kind of running time counter could provide information that would help in determining when an engine needed to be lubricated.  It would also be an interesting bit of information to have after a long day of running trains.

Don't feel that the only device that can be used with the pedometer is a reed switch.  It would be a simple matter to connect these units to other sensors including light sensors, mechanical switches, relay contacts, hall effect sensors and so on.  See the other sensors described in parts 2 and 3 of the series of articles on Garden Railway Sensors.  ( and  Another interesting application would be to connect the counter to a PIR (Passive Infrared) sensor that is used in burglar alarms and other devices to detect people passing by.  It would provide you with an automatic head count during your next open house!


I have made a few other observations about these units that might be of interest.. I found that the units work just fine out of doors but that the display heats up in direct sunlight and becomes the display becomes difficult to read until it cools. The counting continues and is accurate.  You just can’t read it when it is very hot.

One major limitation of this pedometer is its inability to tally events if they occur more frequently than once every 4/10 seconds.  I suppose that is to prevent multiple and erroneous counts from vibration as one runs or walks.

This article focuses on a Wal-Mart pedometer but there are literally dozens of different pedometers available that are likely work just as this one does.  I found several with a Google search and even more on eBay.  I recall that McDonald's gave them away a few years ago in hopes of encouraging diners to walk off their Big Macs!

The battery is a 1.5 volt watch battery that is likely to provide a year or more of service. If you want to extend battery life so that the unit does not reset when the watch battery fails just substitute a 1.5 volt AA battery for the watch battery. Put the battery in a one cell holder and solder the wires from it to the battery contacts. The bottom, center contact on the pedometer is negative and the contact that touches the edges of the battery is positive.

If you mount the pedometer inside of a sealed container you may want to bring out the connection for the reset switch so that you can reset to zero without opening your enclosure. To access the reset switch contacts open the case as described above and then remove the three screws that hold the circuit board to the front of the case. Solder wires as shown in the photo.  You will note that I used very thin wire that I was able to pass through a hole in the circuit board to get to the soldering point.  The red wire in the photo goes through the hole to the right and is soldered just to the left of the contacts for the reset button.  If you make this connection carefully the manual reset button should still work.  One word of caution.  The display is not physically connected (soldered) to the circuit board.  It MUST be positioned correctly or the contacts that are on the back will not align properly with those on the circuit board.  If you place the display into the notch in the case first and then circuit board it should go together properly.

I hope that this unit finds a place in your garden railway as it has in mine!  Be sure to let me know how you use it.