A magnetic field is the invisible vector region around a magnet or current-carrying wire that exerts mechanical force on ferromagnetic materials and deflects moving electrical charges. In a real circuit or installation, the geometry and strength of this field dictate everything from the actuation distance of a Hall effect limit switch to the holding torque of a stepper motor and the core saturation of an inductor. When makers research magnet and magnetic fields, they frequently confuse magnetic flux density (measured in Tesla or Gauss, describing field concentration at a specific point in space) with pull force (measured in pounds or kilograms, which is the mechanical breakaway force against a flat, thick steel plate). Understanding this distinction is the difference between a sensor that triggers reliably at 15mm and one that fails because the field density dropped below the silicon threshold, regardless of how "strong" the magnet feels to your fingers.
Flux Density vs. Pull Force: The Core Confusion
To design reliable electromechanical systems, you must separate the physics of the field from the mechanical marketing specs. According to NIST SI unit definitions, the standard unit for magnetic flux density is the Tesla (T), though the CGS unit Gauss (G) remains heavily used in component datasheets (1 Tesla = 10,000 Gauss).
1 Tesla (T) = 10,000 Gauss (G)
Earth's Magnetic Field ≈ 0.5 Gauss
MRI Machine Bore ≈ 1.5 to 3.0 Tesla
Pull force, on the other hand, is a system-level metric. It depends on the magnet's flux density, but also on the mass, thickness, and permeability of the target steel, as well as the surface area contact. A massive N42 neodymium block might boast a 150 lb pull force rating against a 1-inch thick steel plate, but its flux density at a 20mm air gap might be identical to a much smaller N52 disc. If you are triggering a reed switch or a Hall sensor across an air gap, pull force ratings are entirely useless to you. You must look at the remanence ($B_r$) and the physical dimensions to calculate the flux density at your specific gap distance.
Worked Example: Sizing an N52 Magnet for an A3144 Hall Sensor
Let’s apply this to a common DIY robotics scenario: building a limit switch using an Allegro A3144 Hall effect switch and a neodymium magnet.
The A3144 datasheet specifies a typical operate point ($B_{OP}$) of 30 Gauss and a release point ($B_{RP}$) of 15 Gauss. This means the magnetic field at the sensor's silicon die must reach at least 30G to pull the output transistor LOW.
Assume we select a standard 10mm diameter x 3mm thick N52 neodymium disc magnet. According to K&J Magnetics material properties, N52 has a remanence ($B_r$) of roughly 1.45 Tesla (14,500 Gauss). However, that is the field inside the magnet. The surface field at the center pole of a 10x3mm disc is approximately 4,200 Gauss.
Because magnetic fields from a dipole decay roughly according to the inverse-cube law ($1/z^3$) once you move beyond the magnet's radius, the field drops aggressively across an air gap:
- Surface (0mm gap): ~4,200 G
- 5mm gap: ~650 G
- 10mm gap: ~160 G
- 15mm gap: ~55 G
- 18mm gap: ~30 G (Threshold $B_{OP}$)
Where You Meet This in Practice
Beyond simple limit switches, the behavior of magnet and magnetic fields governs several critical components on your workbench:
- Electromechanical Relays and Contactors: The coil generates a magnetic field that pulls a ferromagnetic armature. The air gap between the armature and the core dictates the inrush current; if the armature gets stuck open (due to debris or mechanical binding), the coil's inductance remains low, current stays high, and the coil burns out.
- Brushless DC (BLDC) Motors: The rotor contains permanent magnets (usually NdFeB). The stator's rotating magnetic field pulls the rotor. If you exceed the magnet's maximum operating temperature, it suffers irreversible demagnetization, permanently dropping the motor's torque constant ($K_t$).
- Inductors and Transformers: Here, the magnetic field is generated by current and contained within a core (ferrite or powdered iron). The core's permeability concentrates the field, but if the flux density exceeds the core's saturation point (often around 0.3T to 0.4T for ferrites), the inductance collapses, turning your inductor into a low-resistance short circuit and destroying your switching MOSFETs.
Decision Tree: Picking the Right Magnet Material
Choosing the wrong magnet material leads to sensor failures in high-heat environments or shattered magnets in high-vibration assemblies. Use this decision matrix to select your material.
| Material | Max Flux Density ($B_r$) | Max Temp (°C) | Temp Coefficient (%/°C) | Best Application |
|---|---|---|---|---|
| N52 Neodymium (NdFeB) | 1.45 T | 80°C | -0.12% | Room-temp sensors, high-torque BLDC rotors, magnetic couplings. |
| Ferrite (Ceramic) | 0.39 T | 250°C | -0.20% | Low-cost fridge magnets, low-end DC motors, where size/weight isn't critical. |
| Alnico | 1.10 T | 500°C+ | -0.02% | High-temp environments, analog panel meters, vintage guitar pickups. |
| Samarium Cobalt (SmCo) | 1.15 T | 300°C | -0.04% | Aerospace, automotive under-hood sensors, high-temp stepper motors. |
Field Interference and Shielding Mistakes
A common failure mode in mixed-signal PCB design is magnetic crosstalk. If you route a high-current, fast-switching PWM trace (like a 20A motor driver output) near an unshielded Hall sensor or an audio amplifier, the expanding and collapsing magnetic field from the wire will induce voltage spikes in adjacent loops via Faraday's Law of Induction.
How to fix it:
- Distance: Because the field from a straight wire drops off linearly ($1/r$), simply moving your sensor 20mm away from a high-current trace reduces the interference by half.
- Twisted Pairs: Always route high-current supply and return wires as a twisted pair or tightly coupled traces. The magnetic fields from the outbound and return currents cancel each other out at a distance.
- Shielding: Standard copper and aluminum do not block static magnetic fields. If you must shield a sensitive magnetometer (like an IMU's compass) from a nearby neodymium motor, you must use high-permeability materials like Mu-metal or soft iron to divert the flux lines around the sensor.
Frequently Asked Questions
Can I stack two N52 magnets to double the trigger distance for my Hall sensor?
No. Stacking magnets axially increases the total magnetic moment, but it does not double the field density at a distant point. Due to the inverse-cube decay, stacking two 10x3mm magnets might only increase your maximum trigger distance by 20-30%, not 100%. If you need more distance, use a single magnet with a larger diameter, as the field decay rate is tied to the physical radius of the pole face.
Will an N52 magnet wipe the flash memory on my ESP32 or Arduino?
No. Modern solid-state flash memory (like the Winbond SPI flash chips used on ESP32-WROOM modules) stores data using trapped electrical charges in floating gates, not magnetic domains. You can safely mount an N52 magnet directly against an ESP32 PCB without corrupting the firmware. However, strong magnetic fields will interfere with the onboard MEMS magnetometer if your specific board variant includes a 9-DOF IMU.
Why did my neodymium magnet crack when I let it snap onto a steel plate?
Neodymium magnets are sintered from powdered metal and are mechanically brittle, behaving more like ceramic than ductile metal. When two large N52 magnets, or a magnet and a heavy steel plate, snap together from a distance, the kinetic energy exceeds the shear strength of the nickel-copper-nickel plating and the NdFeB core. Always slide magnets onto ferromagnetic surfaces edge-first, or use rubber-dipped magnets for high-impact mechanical stops.






