Wednesday, January 20, 2010

Sensors for model railroads - 2 - reed switches

Reed switches are a very simple and effective way to implement point sensors (see my previous post that explains my sensor taxonomy). I have experimented with several kinds of reed switch and generally find them to be reliable, robust and easy to install. Reed switches are installed between the rails while small but powerful rare-earth magnets are mounted on the locomotives. When a magnet equipped locomotive passes over the reed switch, the magnet causes the reeds to make the contact. Since a reed switch requires no separate power, you can directly connect the switch to a sensor encoder or some other electronic gadget. Sensor encoders are devices that generate messages for a computer based on sensor activity. I will discuss them in detail later in this series.

The above photo illustrates two different kinds of reed sensors that have I tried on my layout. Click on the photo for a bigger version.
On the left is a traditional inexpensive reed switch which I bought from All Electronics. I found that it was necessary to mount this sensor longitudinally, that is to say, along the length of the track. I drilled two holes and ran wires up to the reed switch and soldered them to the leads of the reed switch. The sensitivity of this kind of reed switch does not permit any other method of installation. I did try to mount this reed switch parallel to the ties (its actually small enough to permit this) but found that it just did not work.
On the right side of the photo, a different kind of reed switch called a cylindrical reed sensor can be seen peeping out from between the ties. This little gizmo, which is made by a German company called Meder Electronic, is really just a reed switch but is packaged in a way so as to permit vertical mounting. It is available from Mouser Electronics.

Now turning to the topic of magnets: I bought a few small disc shaped neodymium magnets from a small company called KJ Magnetics and mounted them on my locomotive as shown in the photo above in a very simple way - I simply stuck them to the steel screw that holds the knuckle coupler in place! This particular locomotive is a Proto 2000 U30B but the same technique also works fine on Athearn and Bachmann locomotives. The only requirement is the presence of a steel screw for the coupler. I also have a Trix German locomotive that uses European style couplers which do not have such a mounting point. For this locomotive, I had no choice but to super-glue the magnet to the chassis.

Now, although this may not sound like a secure way to mount the magnets, it actually works very well in practice. You have to play around with neodymium magnets to appreciate how strong they are. I have had a few derailments on locomotives equipped with magnets mounted this way but the magnets have never been displaced.

Both kinds of reed switches work well but there are some tradeoffs to consider in making a choice:

  • Traditional reed switches: The main advantage of traditional reed switches is that they are very inexpensive - only 50 cents apiece. However, they have two drawbacks. Firstly, they must be installed in a rather obviously visible manner. Secondly, due to a quirk in the physics of magnetic fields, a traditional reed switch actually delivers two pulses when a train passes over it. This phenomenon is explained the following illustration taken from this document from the Meder Electronic web site.

  • Cylindrical reed sensors: This kind of reed switch has the advantages of being far more sensitive than conventional reed switches and is also very small. In fact, its barely noticeable when installed. Furthermore, the small size makes it very easy to install. All you need to do is to drill a single 1/8" diameter hole. The reed sensor fits snugly in such a hole and needs no glue to hold it in place. Even though I am a rather ham-handed carpenter, I found it easy to drill a hole between the ties on code 83 HO track. The only drawback to reed sensors is that they are considerably more expensive. The particular model that I bought (MK20/1-B-100W) is between five and six dollars depending on quantities which is almost 10 times the cost of ordinary reed switches.

After weighing the merits of the two kinds of reed switches, I decided to go for the cylindrical reed sensor mainly for reasons of ease of installation. I find that I am able to install a sensor in just ten minutes.


  1. Thanks for this very interesting and useful description

  2. After reading this post I decided to try this for myself. I ordered some vertical reed switches, an s88 module and was ready to go. So, with the first switch I went to install a wire fell off as I was handling it. How common is this? They are rather pricy to have them decintegrate? Ideally I'd like to hook them up to longer wires before I mount them, so I can then hook those leeds onto the bus from the module but I'm worried the tug will be too much and I'll have more fall apart. Was fragility a problem for you? Did you find it awkward hooking up the switched under your table with so little wire to work with?

  3. I have installed over 40 of these reed sensors on my layout and have not had any problems with leads breaking off. Perhaps just a bad piece? Once installed, they seem to be quite reliable too - no problems in over two years of operations.