I have a project that includes an Ablic S-5716ACDL1 omnipolar Hall effect switch. It has a sensing range of about 3 mT (±1.6 mT).
Prior to going down a rabbit hole of magnetism in physics, I confirmed that the sensor works as expected when bringing an axially magnetized neodymium disc magnet (22 mm dia. X 6 mm thick) within approximately 30 mm.
There is about 2 cm of plastic/air between the sensor and magnet, so this establishes the minimum distance I'm able to place a magnet for testing.
Please excuse the crudity of the diagram, I didn't have time to build it to scale or to paint it...
My goal is to automate this particular test by employing an electromagnet instead. I naively purchased a small electromagnet thinking it would be similar in characteristics.
Unfortunately, while it has a reasonable holding force of 5 kg, it is not detected by the hall effect sensor until surprisingly near, about 10 mm (with the plastic cover removed).
I purchased a larger electromagnet (10 kg holding) expecting to increase the detection distance, but without luck.
I suspect that the construction of these electromagnets (with a metal chassis surrounding all but the "business end") lends itself to their holding strength, but also might be limiting the distance at which the magnetic field can be detected. Bringing an energized electromagnet near steel doesn't seem to have any noticeable attraction/effect until roughly the same 10 mm distance that I experienced with the Hall effect sensor.
There's a similar question here, but the answer goes beyond my understanding at this point. For example, I know that 1 mT = 10 gauss, but I don't know how to derive that for a given electromagnet, or more precisely, a given distance from said electromagnet.
I've only found a few electromagnets that are constructed differently, but this is based on my potentially wrong assumption that the construction method is key. I'd like to find a solution with somewhat less trial and error, and without vastly overdoing it with respect to the electromagnet strength.
My design limitations allow for up to 25 watts (up to 24 VDC), and physical space for the electromagnet is up to 80 mm vertically and about half that in depth and width.
I've also considered just mounting a neodymium magnet to a servo arm, but that introduces a mechanical/moving aspect which could be more likely to require service.
Q: What electromagnet specs should I be looking for, knowing that I need to detect 3 mT at 30 mm?