# Hall sensors and Kadee couplers



## Shdwdrgn (Dec 23, 2014)

I'm looking into options for sensing track occupancy, and was thinking about magnetics and hall-effect sensors (which are dirt-cheap). It occurs to me that the standard Kadee HO couplers already have a magnet built in. My question is, has anyone experimented to see if a hall sensor can be triggered by the passing of these small magnets?

If so, that would be amazingly convenient, since the hall sensors are so cheap. Instead of having large blocks, one could break down occupancy to small, nearly exact locations.


----------



## wvgca (Jan 21, 2013)

kadee ho couplers have no magnet... but it would be fairly easy to glue one onto the bottom of the trucks to accomplish that...


----------



## Shdwdrgn (Dec 23, 2014)

Gah! I think the metal shim I was using to check the couplers must have gotten magnetized. But I was also thinking that the decoupling worked because there was a small natural magnet in the 'hose'...

Ah well, seemed like it was going to be an easy built-in solution, but I can still work with adding my own magnets. Thanks for checking.


----------



## DonR (Oct 18, 2012)

Kadees uncouple when they are over a magnet under the track. The 'hose'
is metal and will swing to one side, opening the knuckle.

New super power magnets can be small enough to glue to the bottom of
trucks if that would fit with your idea. I wonder if they would react to
the rails as they pass through a turnout or crossing.

Don


----------



## Shdwdrgn (Dec 23, 2014)

It's been almost 25 years since I was in tech school, but as part of our class final we had to put together an automation project. We built a setup that ran scrap paper through a shredder, and was eventually loaded through a chute into some HO hoppers. We hot-glued small (cheap) ceramic magnets to the bottom center of the hoppers, and fed the output from a hall sensor into a microcontroller that I programmed. It was a cool little setup that didn't care how many hoppers were available, it just kept moving the train forward and the magnets told the computer when a car was in place, stopped the train, and dumped another load of shredded paper. The programming was simplistic, but it really hooked me on the whole aspect of automating a train layout.

I know it doesn't take much to trigger a hall sensor. In fact, I just removed those old magnets from the hoppers here a couple months ago when I started looking at my trains again, and it was that stack of magnets that I believe magnetized the metal shim I mentioned above. Anyway, as I've been looking around, I've seen basic hall sensors for as little as 11 cents each. I've also seen new models that will feed a *value* of the magnetic field to a computer, rather than just acting as a simple switch (could be useful for identifying specific cars or locos over a position?), and it looks like some might even report the orientation of the magnet. So there appears to be a lot of possibilities in the field, I just need to get my hands on some samples and start experimenting.

Regarding the way the kadees uncouple, I'm a bit confused about this now. I've seen videos of how the delayed uncoupler works -- when you back the train and provide some slack on the coupler, the magnet appears to push the two hoses away from each other. However magnets do not 'push' iron away, they only attract it. The only way a magnet can push something away is if it is facing another magnet of the same pole. So how exactly are these uncoupling magnets pushing the couplers apart???


----------



## wvgca (Jan 21, 2013)

Shdwdrgn ... you're right .. magnets don't push, they pull .... when you use [for example] five cube magnets between the ties, the only effective ones are the ones on each end, either pole will attract the 'hose' and pull it towards the outside of the track,opening the coupler, on my layout I just used two small round bar magnets, just inside the track between the ties, for convention I did align the poles on both sides, but it's not necessary .. if you want to carry automation a little further, check out microchips and under track readers.. that way you can identify individual cars if that's your intent?? I also use one centered magnet on grades that will hold a few cars and keep them from rolling, without uncoupling them..


----------



## Shdwdrgn (Dec 23, 2014)

Ah ok, that makes a little more sense now... One of these days I'll start playing with uncoupling. There's so much new stuff to learn about, and so many ideas I have that need further research. I figure if I can get the basic framework in place this Summer, then next Winter I can start digging into the specifics of the electronics I'll use for the automation, and maybe ever start building some of the custom crossovers and turnouts.

For individual car identification, I've been looking at NFC tags (newer version of RFID). The readers are under $10 off ebay and hook up to a microcontroller easily, so I was thinking of just scattering 2-4 of those around the track as a means of verifying that a loco is pulling all of the cars it expects. Additionally, since the computer will be tracking each train, it could count cars as they pass each hall sensor any make sure there are no unexpected disconnects. The only issue with using magnetics for position sensing is that it won't work over the uncoupling magnetics -- for those I plan to use IR sensors. The computer will see everything as simple on/off switches anyway, but the IR's take a little more work to hide.

I like that idea of using the magnets to hold cars in place. I have a couple spots where hoppers will be left by mines in the mountains, but the track will be live and the cars *could* be picked up and moved.

The last thing I'm trying to figure out is if it's possible to have some kind of compact 'bump' sensor in the locos. For example, when you're backing onto a spur to pick up some cars, it's easy to *see* when the loco has coupled, but how do you translate that into something that the computer can pick up? Sure I could program it so the loco just goes a certain distance up the spur and assumes the cars were grabbed, but what if someone dropped off 6 cars instead of 4 -- Then the computer would end up pushing cars off the end of the spur. I dunno, I think this one might be a tall order to figure out.


----------



## DonR (Oct 18, 2012)

You won't want to use the magnets under any mainline track. If you
want uncoupling in main line areas Kadee makes an under table
electromagnet that uncouples the cars immediately over it when you
push the button.

You will also want to buy or make a HAND OF GOD uncoupling
wand. It is simply a 1/4" or so plastic or wood rod but has
one end filed down to a flat 'point' that will fit in the tiny area
where the knuckles interlock. You stick it in, give it a slight
twist and the knuckles open, (Most of the time). It's a
thing that you must practice using to gain proficiency with it.
You use this when you want to uncouple where there is
no magnet, which seems to be most places you want to
spot a car.

Don


----------



## irishthump (Jul 1, 2013)

DonR said:


> New super power magnets can be small enough to glue to the bottom of trucks if that would fit with your idea. I wonder if they would react to
> the rails as they pass through a turnout or crossing.
> 
> Don


I tried attaching small neodymium magnets to tension lock couplers before I switched to Kadees and they caused no end of problems! It's was'nt so much the magnets reacting to the rails but every time they passed over the head of one of the track pins the coaches/cars would buck like crazy...


----------



## Shdwdrgn (Dec 23, 2014)

That might explain why so many tracks and car parts are being sold as non-magnetic these days? My old Tyco track is magnetic, but the ME dual-gauge flex track I have here is not.


----------



## irishthump (Jul 1, 2013)

Shdwdrgn said:


> That might explain why so many tracks and car parts are being sold as non-magnetic these days? My old Tyco track is magnetic, but the ME dual-gauge flex track I have here is not.


That would make sense.

I model Irish prototype as well and when I switched to Kadees I had a lot of problems as most wheelsets on Irish RTR (and UK RTR which I converted) are magnetic. I made the HUGE mistake of placing the Kadee undertrack magnets on the mainline and stock would uncouple every time I ran over them! I finally snapped and added braking strips on the trucks to prevent this but it was a major pain in the a**!


----------



## Shdwdrgn (Dec 23, 2014)

Yeah I'll have to plan on a few of the electromagnet decouplers... I had four decouplers on my mainline, didn't realize this would be a problem for through-trains.


----------

