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.

Friday, January 15, 2010

Sensors for model railroads - 1

I had originally planned to start writing about the construction of my layout but I am going to jump ahead a little and talk about sensors, a subject that has been the focus of much of my recent work on my layout. I'll get back to layout construction in subsequent posts.
The basic purpose of a sensor, in the context of model railroading, is to detect whether or not there is a train on a particular piece of track. Now, there are some new kinds of sensors that can additionally identify which specific train. However, they have not gained widespread popularity at the current time. In any case, as I will explain later in this series of postings, its rarely necessary to be able to identify individual trains. You can generally get by just fine with a simple yes/no status from the sensor. When a train is detected by a sensor, there are two ways to use the information generated by the sensor:
  • Send a notification message to a computer: There are a number of model railroad specific programs that can handle such notifications including JMRI, Railroad & Co. Train Controller, RocRail and Win-Digipet.
  • Directly control some electronic gadget such as signals, grade crossing gates, lights, sound effects. In addition, some DCC turnout controllers can be configured to directly select routes based on sensor notifications.
The main model railroad applications for sensors are listed below:
  • CTC (Centralized Traffic Control) installations require sensors to help the dispatcher (or line controller) determine whether a particular block of track is occupied by a train. Track circuits are a commonly used kind of sensor on prototype railroads that implement CTC. A number of model railroaders have implemented CTC on their layouts in a very sophisticated manner.
  • Computer control of the layout: If you wish to have a computer running trains on your layout, you will need sensors to allow the computer to keep track of the location of trains accurately. In fact, you will need a lot of them. My friend Dale Schultz has described this approach to automation very nicely nicely on his web site. As I have indicated previously on this blog, my own interests lie squarely in this direction.

  • Control automatic block signals: Many prototype railroads use automatic block signal systems on sections with heavy traffic. Among the model manufacturers Atlas offers a line of automatic block signals.
  • Specific layout function control: Even those model railroaders who prefer manual of their trains, often use sensors for a number of specific functions such as:
    • Simplifying the operation of staging areas, especially hidden ones. It is useful for operators to be able to quickly determine which staging tracks are occupied at the moment.
    • Operating grade crossings: Trigger flashing of lights, wig wags or crossing arms when a train approaches a grade (i.e. level) crossing.

Types of sensors


Broadly speaking, there are two kinds of sensors (note that this is my own terminology. I have not seen this used anywhere else but I think it serves a useful purpose so please bear with me):
  • Point sensors: This class of sensors are used to detect the presence of a train at a particular point in the layout. If you are interested in layout automation, the use of point sensors is, more or less, mandatory since the computer needs to know exactly where a train has reached. However, they can also be used for some of the other applications listed above. A number of technologies have been used to implement point sensors including infrared, reed switches, mechanically trigged switches and (recently) RFID.
  • Span sensors: This class of sensors are used to detect the presence of a train anywhere on a section of track. Span sensors are a natural fit for CTC and automatic block signals. The main technology for implementing span sensors is by detecting current drawn by the electric motors in locomotives and from special resistor wheel sets in other rolling stock. In the case of three rail systems like Märklin, it is also possible to take advantage of the fact that wheels are electrically conductive and create a span sensor by electrically isolating one of the outer rails in a block.

I will present the pros and cons for the various sensor types and their technologies in subsequent posts.

Friday, January 1, 2010

How I designed my layout - an overview

Lets cut to the happy ending :-) Here is the final design that I came up with:




But how did I get here? In the course of some ten odd postings on this blog, I have described the process I followed in coming up with this design. It therefore seems like a good moment to provide an overall narrative that ties it all together. Some background material first:


  • My model railroading background:I have been a model railroader for a long time. I describe some of my past activities in this hobby in this posting.

  • Capturing complexity: Some thoughts about why I enjoy the hobby of model railroading - its all about selectively capturing the complexity of the real world in miniature.

  • Operating styles: An analysis of the distinct styles of model train layout operation that I have encountered. I find it interesting that operating styles vary considerably between the US, the UK and Germany.

  • Inspirations for my train layout: My interest in railroads both model and prototype arises from long train journeys taken while growing up in India.



I started work on designing my current layout in earnest in October 2007 after I visited my friend Dale Schultz and saw his layout in person.


Dale has built a truly innovative layout that featuring a very high level of craftsmanship and full computer control. It is remarkable that Dale has written his control software entirely by himself from scratch. Motivated by what I had seen, I designed my layout in a matter of just six weeks. I kept a diary of my progress which was the basis for the next set of articles:




Having reached a design that I was happy with, I started construction of the layout in November 2007 - and its still under way as I write this in in January 2010. Here is a peek at the layout as it currently stands:




In the next few months, I will be describing the construction and control systems - stay tuned!