A Hall effect sensor outputs either a continuous analog voltage or a discrete digital logic state that changes in proportion to the magnetic flux density passing through its semiconductor die. If you are using a linear (analog) sensor, the output is a ratiometric voltage that you must scale using your microcontroller's ADC. If you are using a switch or latch (digital), the output is a standard push-pull or open-drain logic signal tied to the sensor's supply voltage.
Understanding how Hall effect sensors work requires separating the physics of the silicon from the practical realities of microcontroller interfacing. Below, we break down the operating principle, compare real-world IC specifications, and provide the exact math required to convert raw ADC bits into physical units like Gauss or milliTesla (mT).
The Physics: Lorentz Force and Transverse Voltage
At the core of every Hall effect sensor is a thin piece of semiconductor material (usually gallium arsenide or indium antimonide) through which a constant bias current flows. When a magnetic field passes perpendicularly through this material, it exerts a Lorentz force on the moving charge carriers (electrons), pushing them toward one edge of the semiconductor. This charge accumulation creates a measurable transverse voltage across the material, known as the Hall voltage, which is directly proportional to the strength of the perpendicular magnetic field.
Because the raw Hall voltage is typically in the microvolt range, modern integrated circuits embed this semiconductor element alongside a differential amplifier, a voltage regulator, and temperature compensation circuitry on a single silicon die. The amplifier boosts the signal to a usable level (millivolts per Gauss or milliTesla), while the temperature compensation minimizes drift caused by the semiconductor's inherent thermal sensitivity, allowing the IC to output a stable, calibrated signal directly to your microcontroller's GPIO or ADC pins.
Sensor Topologies and Spec-Sheet Data
The most common mistake makers make is conflating linear analog sensors with digital switches. Analog sensors give you a continuous voltage proportional to the magnetic field, while digital sensors use an internal Schmitt trigger to snap to a HIGH or LOW state at specific magnetic thresholds. Here is a data-dense comparison of four industry-standard Hall ICs you will encounter on the bench.
| IC Part Number | Output Type | Supply Range ($V_{CC}$) | Quiescent Current | Sensitivity / Trip Point |
|---|---|---|---|---|
| SS49E (Honeywell) | Linear Analog | 2.7V to 6.5V | 6.0 mA | 1.4 mV/G (ratiometric at 5V) |
| A1324 (Allegro) | Linear Analog | 4.5V to 5.5V | 8.0 mA | 5.0 mV/G (absolute at 5V) |
| DRV5055 (Texas Instruments) | Linear Analog | 2.5V to 5.5V | 4.0 mA | 33 mV/mT (bipolar, ratiometric) |
| US5881 (Melexis) | Digital Latch | 2.2V to 24V | 5.0 mA | $B_{OP}$ 3.5 mT / $B_{RP}$ -3.5 mT |
Wiring, Pinouts, and Signal Interfacing
Hall effect sensors typically use a simple 3-pin SIP or SOT-23 package. However, interfacing them with 3.3V microcontrollers like the ESP32 or Raspberry Pi Pico requires careful attention to the supply voltage and output swing.
| Pin | Function | Arduino Uno (5V Logic) | ESP32 / Pi Pico (3.3V Logic) |
|---|---|---|---|
| 1 | $V_{CC}$ (Supply) | 5V Pin | 3.3V Pin (Verify IC supports <3.3V!) |
| 2 | GND | GND | GND |
| 3 | OUT (Signal) | Analog/Digital Pin | ADC/GPIO Pin (Max 3.3V input) |
For digital sensors (like the US5881) with open-drain outputs, you must enable the microcontroller's internal pull-up resistor in software, or add an external 10kΩ pull-up to the 3.3V rail, otherwise the pin will float and read erratic noise when the magnetic field is below the trip point.
Raw ADC Math: Converting Bits to Gauss or MilliTesla
Let's calculate the physical magnetic field using a Texas Instruments DRV5055A1 (bipolar linear analog) powered at 3.3V, read by an ESP32's 12-bit ADC. Because the DRV5055 is ratiometric, we must scale the datasheet's 5V sensitivity down to our 3.3V operating point.
- Find the Zero-Field Offset ($V_{offset}$): Ratiometric linear sensors sit at exactly $V_{CC} / 2$ when no magnet is present. At 3.3V, $V_{offset} = 1.65V$ (or 1650 mV).
- Calculate True Sensitivity: The datasheet states 33 mV/mT at 5V. At 3.3V, Sensitivity = $33 \times (3.3 / 5.0) = 21.78$ mV/mT.
- Read the ADC: Use
analogReadMilliVolts(pin)on the ESP32 to bypass raw bit non-linearities and get a direct millivolt reading. Let's assume a neodymium magnet pushes the reading to 2250 mV. - Apply the Formula:
B (mT) = (V_{measured} - V_{offset}) / Sensitivity
B (mT) = (2250 - 1650) / 21.78
B (mT) = 600 / 21.78 = 27.54 mT
If you are working in Gauss (common in US datasheets like Honeywell's SS49E), remember that 1 milliTesla (mT) = 10 Gauss. Therefore, 27.54 mT equals 275.4 Gauss. For digital sensors, this math is irrelevant; you simply use digitalRead() and check for a boolean HIGH/LOW state based on the $B_{OP}$ (Operate Point) and $B_{RP}$ (Release Point) hysteresis thresholds defined in the spec sheet.
Real-World Interference and Calibration Fixes
On a noisy workbench or inside a motor controller enclosure, Hall sensors rarely behave as perfectly as the datasheet implies. Here are the three primary interference sources and how to engineer around them.
1. Thermal Drift and Self-Heating
Even with internal temperature compensation, Hall ICs exhibit a residual thermal offset drift, typically around 0.1 mV/°C to 0.5 mV/°C. If your sensor is mounted near a stepper motor driver or a linear voltage regulator, the ambient temperature swings will cause the zero-field offset to wander. Fix: Implement a software calibration routine that records the $V_{offset}$ at startup (with the magnet removed) and subtracts it dynamically, or use a digital sensor if you only need proximity detection rather than absolute field measurement.
2. Electromagnetic Interference (EMI)
Hall sensors have high-impedance internal nodes that act as tiny antennas for high-frequency $dV/dt$ noise from nearby PWM signals or switching power supplies. This manifests as a "fuzzy" or jittery ADC reading. Fix: Place a 100 nF (0.1 µF) ceramic bypass capacitor directly across the $V_{CC}$ and GND pins of the sensor, as close to the IC package as physically possible. Keep the analog output trace away from AC mains or high-current DC paths.
3. The Piezoresistive Effect (Mechanical Stress)
This is the most overlooked failure mode in embedded design. Silicon is piezoresistive—meaning its electrical resistance changes when subjected to mechanical stress. If you mount a Hall sensor on a PCB and tighten a screw directly over it, or if the PCB flexes inside an enclosure, the physical stress on the IC package alters the semiconductor's resistance, creating a false magnetic offset that looks exactly like a weak magnetic field. Fix: Never place mounting hardware or heavy components directly adjacent to the Hall IC. If potting the assembly in epoxy, use a soft, low-shrinkage silicone conformal coating rather than a rigid hard resin to prevent stress transfer to the silicon die.
For deeper dives into semiconductor physics and application circuits, refer to the All About Circuits Hall Effect tutorial or the Texas Instruments Hall Effect Sensor design guides. Always cross-reference your specific IC's datasheet for the exact ratiometric scaling factors before deploying to production.






