Jump to content
 
  • entries
    9
  • comments
    7
  • views
    13,406

Magnetic position detection experiments


Rabs

2,635 views

To automate my layout I've been investigating sensors to accurately locate the trains so that I can run realistic operations without user intervention. I will update this post with photos when I get my camera out at the weekend.

I've been experimenting with using hall effect sensors for detecting train position on my N gauge layout. In particular I've been trying this sensor:

 

Honeywell Latching Hall sensor

 

 

As I see it these sensors have a number of advantages over other sensor systems.

  • Not susceptible to ambient light conditions like optical sensors
  • Don't require dividing the track into electrical blocks like current sensors
  • Much more sensitive than reed switches (so smaller magnets)
  • Can differentiate N from S poles - unlike a reed switch
  • very localised effect (initial testing suggests better than 5mm resolution - easily good enough to detect when a train is clear of a set of points for example
  • Can be completely concealed below ballast
  • Very cheap (~80p per sensor)
  • Virtually no additional circuitry needed

The other option that I considered was RFID, but other people report problems caused by accidentally triggering tags on adjacent, parallel tracks (of which I will have a few). I'm sure that this could be overcome with a bit of optimised antenna design to reduce the transverse axis sensitivity - but RFID tag antenna design is a complex area and I'm not all that keen to get into it just for this project. Finally, RFID is usually designed to be omnidirectional - not what you want from a positioning system!

 

You can get Hall effect sensors without a latching effect as well. I went for the latching effect because this means that I will be able to detect both the start and the end of each loco/coach or wagon by placing a magnet of opposite polarity at each end of the car - very useful if I want to position a specific coupling over a decoupler automatically.

 

The magnets that I'm using are 4mm diameter, 1mm thick NeBFe rare earth magnets, available from many suppliers such as:

 

Magnet suppliers

 

 

I found that Ebay was the cheapest source - with a pack of 50 magnets costing ~£2.50 - so you can kit out each member of your rolling stock for just 10p. The ones I have are N48 grade. (Higer grade magnets have higher surface flux densities). The difference in the range between N42 and N50 isn't all that great, so I would imagine that any of these would work ok - but I've not tested any other grades.

 

For my first tests I just placed the magnets on the ends of the steel screws which hold the chassis of my test loco together. I put the sensor on a little bit of stripboard (PCB prototyping board) and glued it to the underside of the sleepers, with the sensor between two sleepers. With this arrangement the top of the sensor was just below the level of the top of the sleepers. Passing the loco back and forth over the sensor showed it working perfectly first time (much to my surprise!).

 

With just two magnets the sensor is 'set' when the front of the loco passes over it and 'reset' when the back passes over it. With my current arrangement it only works with the loco travelling forward over the sensor - but I have some ideas for different arrangements of magnets on the underside of the rolling stock to overcome this.

 

Watch this space - if you find this at all interesting that is :), otherwise I'll be making some posts about the more normal bits of my modelling soon!

4 Comments


Recommended Comments

  • RMweb Premium

Very interesting. I'm looking for train detection mechanisms for Waton so will be watching. :)

 

Cheers

Dave

Link to comment

Th advantage of RFID is that it identifies a particular vehicle in a train, magnetic detection does not tell you which vehicle is passing over it.

Link to comment

Yes, that's very true. In a situation where you're performing anything more than basic shunting I can see that would be extremely helpful. In my case I will be putting most of my rolling stock into fixed rakes, with a few DG couplings at selected points in the train to allow operations - so hopefully I can get away with counting cars as the train passes over to identify the correct coupling. That does rely on not missing counts though, which I've heard is an issue with reed switch type detection. Hopefully the Hall effect switches will be more resilient because of the higher sensitivity and faster response.

 

Have you found any RFID tags that comfortably fit under an N/2mm gauge wagon? I had a look, but all the 13.56MHz ones are too big as far as I can tell. The 125kHz ferrite rod types would fit, but are much more expensive - and I don't think that my budget would stretch yet to ~£2 per vehicle, is there a cheaper RFID option?

  • Like 1
Link to comment

Just wanted to add a couple of points, a linear Hall sensor would allow you to detect range upto around 11 inches each way (depending), you shouldnt need magnets as most hall sensors if used correctly will pick up the motor flux easy enough. Also IR smd diodes and transistors can be used as a kind of bar code reader, the idea is simple enough, you put a tiny 2x2mm smd IR led and smd IR transistor next to each other, then print 'stickers' on any printer with barcode on them, with a suitable microcontroller you have a powerful system to know what is where! Much easier than RFID and much cheaper, also you can print labels as you want and they can be made to fit any size.

Just for the record I have built such systems and currently working on a custom layout for a friend, I am not personally into the model railway world but I am a electronics engineer with 30+ years experiance

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...