# Hall sensors for motor RPM?



## Shdwdrgn (Dec 23, 2014)

A couple years ago I picked up some A3144 hall-effect sensors to try to use for detecting some of my magnetically-operated cars. It turns out this particular sensor is made for very close ranges, like around 5mm -- about half the range I needed for that application. Oh well.

However last night I was thinking about adding a tach on my test loco, and I remembered reading that this sensor was actually made for reading the speed of motors. I think. So I'm trying to figure out if I'm thinking about this correctly... If I were to glue one of these directly to the side of a metal can motor, do you think I would be able to pick up the magnetic field of the windings inside? Could it really be that simple, or am I missing something here?

It doesn't matter how many pulses I get per revolution. My goal is to count the number of pulses over a fixed length of track and translate that into a known distance per pulse. That information could then be used for a number of purposes, such as writing code to tell the train to move X inches past a fixed location before backing up onto a spur. It could also provide diagnostics -- if the loco knows it usually counts 10,000 pulses going up a grade without a load, but with a load it counts 20,000 pulses, then I'll know there was a lot of slippage and I need to back off the loads for that loco, or add a tandem loco to make the same run. And it could help automate the process of synchronizing tandem loco speeds on the fly, especially when you have mismatched motors that may speed up at different rates.

...But it all comes back to being able to easily read the motor's RPMs, and a hall-effect sensor would give a nice analog or digital output for the arduino.


----------



## DonR (Oct 18, 2012)

Well, you might heed the words of an old popular
song...

Accent the positive. Eliminate the negative. And
don't mess with Mr. in between.

Sorry, that's as high tech as I get at this pay grade.

Don


----------



## time warp (Apr 28, 2016)

Wouldn't the Hall effect device need to work off of a disc attached to the motor shaft? I believe the disc would need a hole or slot to give a trigger pulse.


----------



## RT_Coker (Dec 6, 2012)

I bought a couple of these HO size motors on eBay.
Bob


----------



## Shdwdrgn (Dec 23, 2014)

@time warp -- hall effect sensors read the strength of a magnetic field. What you're thinking of is LED photodiodes.

#RT Coker -- nice find, and I bet that would help a bit with momentum as well, but all of my locos already have motors in them.

Ah well, I wasn't sure if anybody had already tried this or not. Maybe this evening I'll have a chance to set one up and see what I can read from it.


----------



## crusader27529 (Apr 3, 2016)

Shdwdrgn said:


> A couple years ago I picked up some A3144 hall-effect sensors to try to use for detecting some of my magnetically-operated cars. It turns out this particular sensor is made for very close ranges, like around 5mm -- about half the range I needed for that application. Oh well.
> 
> However last night I was thinking about adding a tach on my test loco, and I remembered reading that this sensor was actually made for reading the speed of motors. I think. So I'm trying to figure out if I'm thinking about this correctly... If I were to glue one of these directly to the side of a metal can motor, do you think I would be able to pick up the magnetic field of the windings inside? Could it really be that simple, or am I missing something here?
> 
> ...


First, the a3144 parts are obsolete, and aren't being made anymore, so anything you get now would be old stock. Replacements are available, with better internal design.

Second, the magnetic field from the windings on the motor would likely be inconsistent, as the field strength would vary with voltage applied and speed. Attaching a small magnet externally to the output shaft or a multiple magnets to the flywheel would be more reliable.

I'm using the a3144 to detect the speed of a train car with 5 magnets attached to the inside of one of the wheels, and I can reliably detect and calculate speeds well in excess of 150 scale MPH, and in testing have seen speeds approaching 300 scale mpg. If there were 4 magnets attached to a flywheel for example, with a motor running 10K rpm(a realistic rpm for an HO locomotive at maxumum speed), the detection time between magnetic pulses would be approximately 1.5ms. On my speedometer car, 7ms between pulses I think calculated to about 100 scale mph.

So, the arduino could certainly detect and count the pulses.


----------



## D&J Railroad (Oct 4, 2013)

I would be inclined to think the magnetic source that is provided with the sensor is built to match the sensing capability. As Crusader noted, the motor field would probably not be focused enough for your sensors pickup area. While a hall effect sensor typically works with one magnetic field generator, an electric motor has several armatures and would produce numerous fields causing a false reading.


----------



## Shdwdrgn (Dec 23, 2014)

@crusader -- yeah I might be able to attach a small bar magnet across the end of the worm gear. There's really no other option for an external mount. Will have to keep that in mind. And I wasn't concerned about the arduino keeping up with the count, I've seen it done before, but since I actually use an ESP8266 I have 10x the speed available so it will also have time for all the other functions it needs to do.

@D&J -- huh? Every hall sensor I've ever bought was just the components by themselves. There's no magnetic source that comes with them. As for the multiple armatures, well I was counting on that for greater precision.


----------

