Hacker News new | past | comments | ask | show | jobs | submit login
Common Hall-effect sensor myths (2022) (ti.com)
98 points by zdw on Jan 15, 2023 | hide | past | favorite | 55 comments



I didn't know much about Hall-effect sensors until I built a solar M&C system (in 2003) and I wanted to accurately measure currents (into/out of battery, out from solar array, and out of auxiliary charger). I didn't want to use shunt resistors because of losses, dealing with voltage offsets, and calibration uncertainty. I ended up using some metrology-grade Closed Loop Hall Effect Current Sensors (F.W. Bell CLN-200).

Hall-effect sensors by themselves are pretty poor for this application, but these sensors consist of a traditional (AC type) current transformer, but instead of a closed core, there's a Hall-effect sensor placed in a small gap in the core loop. Instead of measuring current from the transformer windings, the windings are fed from an op-amp current source with feedback from the Hall-effect sensor with the result that the magnetic field produced by the transformer windings exactly cancels the magnetic field produced from the current flowing through the source cable. The current in the cable is thus known because it equals the product of the CT current and the turns ratio (in this case 200/1).

The Hall-effect sensor here is only sensing the presence or absence of a magnetic field, and the CT is driven to null the field, so the system calibration is simple. (There's no need for any temperature compensation of the Hall-effect sensor.) Also, IIRC, these sensors have a pretty high operational bandwidth (DC to ~200kHz).


> calibration uncertainty

What is the uncertainty? I thought you just need to zero each ADC after it stabilizes on boot before powering up the load?


For a start, if you're monitoring your whole house, getting to zero load while keeping the sensor powered on is not trivial :)

For another, in my experience a lot of current sensing options are just a bit.... suspicious on the accuracy front. I've had resistive sensors tell me 1W is flowing through a plug with nothing plugged into it. Turning off a resistive load but the measurement slowing falling back to zero over several seconds, instead of dropping immediately. Solar monitoring current clamps that claimed zero current when the power company's meter said we were exporting 20W. Fancy £800 fluke clamp meters tell me 2A is flowing when there isn't even a cable in the clamp. Clamp ferrites getting broken in transit and producing bad results. Installers putting the CT clamp the wrong way. Installers installing the power meter the wrong way around, because the installation instructions assume you want to meter import not export.....

Current sensing is surprisingly hard to get right :)


> For a start, if you're monitoring your whole house, getting to zero load while keeping the sensor powered on is not trivial :)

Hahahaha! Duh. I just assumed you could power cycle the target (which you could but not without potentially drastic consequences).

thanks for the follow-up.


i should preface this by saying that my knowledge here is entirely theoretical, and i'd be interested in knowing if i'm mistaken. as i understand the situation:

your ±1% 1Ω shunt resistor might actually be 0.99Ω, maybe depending on temperature (which changes after you power up the load), but you can get ±0.01% resistors pretty cheap these days

(maybe not if they have to handle 150 amps tho)

typically the bigger issue is the reference voltage the adc is comparing it against, because a voltage reference with 1% precision that's stable over time is pretty challenging, and also needs to be calibrated

but i'd think that would also be the case for calibrating the driver for the cancellation current in the hall-effect sensor?


That's how clamp-around DC ammeters work. It's amazing that's even possible.


But those require constant zeroing


since the device (clamp/fork meter) doesn't know if there is a current going or not... but if you control the load/current - it should be trivial to zero 'em.


Do you have any references or diagrams for the system?


Hall effect sensors are really neat. I'm a mechatronics engineer by education, but I almost exclusively work with software. One of the reasons for this is that I dislike the fallibility of The Real World™. Switches wear out with time, you get noise in your circuits if someone turns on the microwave, and all that - I click better with solving problems in the domain of ideas, and software is closer to that.

On one hardware project I did a couple of years ago, which involved automated closing and opening of a sliding door, we used hall effect instead of mechanical for the limit switches. I didn't react strongly to the idea at the time but boy, was it a good one. No issues with aligning switches precisely, no worrying about switches wearing out or getting stuck, minimal handling of debouncing necessary. And it was even totally silent! I think this was the closest I got to perceiving something in the real world to be as elegant and consistent as (most) things are in the code world.


If you enjoyed triggering against events in the milliTesla range [1] imagine the excitement of continously measuring nine inputs in the nanoTesla range [2] - three axis magnetometers at the wingtips and tailboom of a drafting airframe [3] 80m above ground for millions of line kms per survey [4].

[1] https://www.ti.com/product/TMAG5124

[2] https://georesults.com.au/product/geometrics-g-822a-caesium-...

[3] https://scintrexltd.com/wp-content/uploads/2017/02/CS-VL-Man...

[4] https://www.youtube.com/watch?v=AZyNIGFHsE4


Hahaha whereas Hall effect sensors caused me no end of trouble using it as a design component to measure the current draw of an AC motor in a valve actuator.

The EMF from the motor played all kinds of havoc on the Hall effect sensor.


There is another type of switch even more common in industrial automation: inductive switch, where the trigger mechanism relies on inductive coupling between an external target and a coil in sensor (for all practical purposes the target is ferrous metal- they do usually work against aluminum alloys or stainless steel but at greatly reduced range).

I usually see hall-based switches being used to detect pneumatic cylinder position- the plunger in cylinders has an embedded magnet and there is a rail on the outside of cylinder where you can fix a small sensor.


Reed switch for this application might be even better


I will die on the hill that hall effect control sticks and triggers are superior to pots. SEGA used them on the Saturn and Dreamcast controller sticks and triggers and they were awesome. It's good to see Gulikit making OEM stick parts and OEMs like NYXI putting them into products like the Wizard.


For the game controller context, anyone who thinks otherwise has probably never taken apart an old potentiometer, and looked inside at the carnage. Things scraping together, wearing each other away, until they fail in a non graceful way.

Solid state analog is hard to beat, in low current devices, with human speed dB/dt.


Hah you don't even need to take one apart

Just get an old radio, fiddle with the volume control and hear the scratching


Atari pioneered the use of Hall effect joysticks in the arcade I Robot from 1983. I think they had a patent on it at the time.

There are interesting stories online about the problems they had. They were stumped by a game at a specific location that kept going haywire and requiring recalibration. Kept sending engineers out to fix it over and over. Turned out the arcade was next door to a scrap yard with one of those big magnetic cranes, which was completely messing up the sensing. [1]

[1] https://www.rotheblog.com/2009/06/arcade/transcript-from-rus...


Good story, but it’s unlikely it was the (magnetic part of the) Hall effect sensor at fault here — the field due to a magnetic dipole (like a lifting magnet) drops off as an inverse cube of distance. Unless the machines were IN the scrapyard, the field would be negligible.

More likely boring old electrical grounding issues. Oh how I hate them.


I don't think it's necessary to die on the hill of the popular opinion you hold.


Unless you live in Iran of course.


Not if it's popular there too!


not all popular opinions are popular inside the government


I mean there is nothing to argue here they are, they are just pricier alternative


There's also some work being done to retrofit hall effect sensors in older game consoles, like the GameCube [0], I'm definitely going to try it in one of my older controllers sooner or later, I'm tired of replacing pots. I just had to purchase replacements for an orange controller and a wavebird.

[0]: https://github.com/PhobGCC/PhobGCC-SW


And then there is the N64 which used optical chopper rotary encoders in it's stick. It is a weird design, you can tell the engineers were trying to figure out how to make a small joystick and managed to do it with ball mouse tech. Don't get me wrong the stick still sucked, but it was the mechanical pivot that wore out not the detectors.


Okay I have almost zero hardware chops but this sings to me.

Does that mean that the sensor is all solid state and the only moving bit is just a gimbal-like thingy attached to the rubber thumb interface to move a little magnet around? That’s got to be ridiculously simple and long-lasting. Or even trivial to make replaceable without having to replace any of the electronics.


That was literally why the infamous hall effect keyboard switches of Honeywell were designed. Keyboard were required to be very robust, and switches that required direct interaction were found lacking in reliability.

Thus no-touch, special integrated circuit per key, hall effect keyboards were born before the advent of cheapness and higher reliabilty of mechanical switches drove them out due to price difference.


There are still modern keyboards using Hall effect switches, e.g., https://wooting.io/lekker


Why are they infamous? It seems from your post they were more reliable, even if they were more expensive.


If you spend some time in keyboard aficionado circles, you will find a lot of talk about them, especially in relation to (similarly infamous) Knight, Space Cadet, and other Lisp Machine keyboards.

Thus "infamous".

The fact that they required special IC per key only makes them even more "wild" :)


Wait, pots are still used in game controllers? I would've thought they'd all have given way to 3D Hall sensors by now.


Unfortunately, yes. And they wear out fairly frequently, too.


Wow, that's mindblowing. I haven't considered using pots for anything in almost 15 years. Sliding contacts? No thank you.

Just today I diagnosed my truck's failed climate control to be due to a failed potentiometer in the temperature control mix damper actuator. Curse on whoever screwed up and didn't use a magnetic sensor for this application.


The very popular Nintendo Switch is infamous for dying controllers. I've had to replace the thumb stick twice within three years, and we weren't even using it that much. The Playstation 5 also them, and I've had to replace it once. No idea whether Xbox uses them though, but I would not be surprised if they did.

What's funny is that, the controllers are already pretty effin expensive. Buying a new single PS5 controller is ca 1/6 cost of the console. With the Switch it's even worse, then it's about 1/3.


Who said they screwed up? The engineer could well have suggest the right solution, but management saw an opportunity to Design for Repair. No one builds things to last anymore, particularly not cars.


I think drift may have actually gotten worse, modern systems don't seem to do the same boot time self calibration old systems did.


It might be changing, at least to a degree. It's now possible to buy at least two third-party cross-platform controllers that use Hall effect sticks (that I can think of). I don't know when we'll see them again in first-party controllers, though.


8bitdo released their Ultimate Controller and the bluetooth edition has hall-effect joysticks.


I really hope to see more come out of this


I expect to see an explosion of hall-effect switches in gaming keyboards in the next few years following the success [1][2] of the Wooting 60HE [3] and the Steel Series Apex Pro [4] keyboards.

[1] https://www.youtube.com/watch?v=2kvmccinWMk [2] https://www.youtube.com/watch?v=dUZxW2VzyIk [3] https://next.wooting.io/wooting-60he [4] https://steelseries.com/gaming-keyboards/apex-pro


I bought the Wooting Lekker keyboard and while the hall-effect switches are awesome, I realized afterwards that I've come to love low-profile mechanical keyboards too much to go back. If they release a low-profile version of the switches I'll gladly change over.


I love my apex pro TKL Keyboard! The switches are a part of it, but the overall build and quality are amazing. I highly recommend it!


#1 is weird. I would never look at a bipolar sensor with a wide hysteresis and think "latch", but after re-reading it that's totally what it is and makes me rethink my idea of a latch. And here I just thought they were for non-intrusively measuring current.


>There are also those who believe that Hall-effect sensors don’t have a good range for practical use because magnetic fields decay exponentially over distance.

That would be because they decay quadratically over distance...


i think it's actually cubic, but 'exponential' is still wrong


I used a Hall Effect sensor on my robotics team and it caused nothing but issues. We were using it to PID our motors to be the same speed. I think there might’ve been some kind of interference from the motors, but I’m not sure. We ended up switching to an optical rotary encoder and all of our problems went away.

Given my bad experience, reading that they’re so popular really surprised me. Are they actually finicky or did my team just do something wrong?


Many brushless motors (fans, electric scooters) have digital output (i.e. on/off) hall sensors triggered by motor magnets to read a coarse motor's shaft (to know which coil should be energized).

There is even a higher resolution approach of using two or three analog output hall sensors sensing motor magnets to read fine stator position (for example, gimbal motors for DJI drones use this technique).

Then there are ICs that contain several hall sensors that are arranged to measure absolute angle of diametrically magnetized target (these are the one's used in hall effect potentiometers, and I've seen them used for position feedback in brushless motor control).

So, most likely your project had an issue with sensor placement, or the sensor wasn't correctly selected for the application They are no more finicky than IR sensors reacting to sunlight, or just about every type of sensor *also* being a temperature sensor: you have to be aware of what exactly is the sensor measuring and how the environment may affect it's measurements.


They seem to work incredibly well when everything is made of plastic, and incredibly badly when everything is made of steel. What is quite reasonable.

If you go to a gym, try to keep track of your exercise counts and compare them to the machine counters. The machines almost never get them right. But for keyboards they seem to be pretty great.


Halls depends on magnetic fields. Motors generate magnetic fields to a large degree, hence electromagnetic interference handling becomes important in those applications.


Analog hall sensors are amazing. With a bit of filtering you make your activation point any arbitrary distance, and do hysteresis, and have a bit of flexibility to reconfigure if you decide you want to mount the magnet farther away.


Myth #6:

Mixing SI and imperial units makes for good reading. How many millimeters are three inch again?


76.2 - still puzzles me, though. While I can convert units in my my head, I have never used anything but metric... so I always convert them. The most common misuse is likely to be attributed to Canadian folks, I guess.


also why my 1997 Jeep Cherokee was running funny and a proper PITA to fix


Those are particularly prone to failure on 4.0 (as you are now know) make sure you use an OE crank sensor.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: