How Hall Effect Sensors Actually Work
When an electrical current flows through a semiconductor material and a magnetic field is applied perpendicular to that current, the Lorentz force deflects the moving charge carriers (electrons or holes) to one side of the material. This accumulation of charge creates a measurable transverse voltage difference across the conductor, known as the Hall voltage. The magnitude of this voltage is directly proportional to the strength of the perpendicular magnetic flux density.
In modern integrated circuits, this raw microvolt-level Hall voltage is practically useless on its own. Therefore, commercial hall effect sensors embed the Hall element alongside high-gain differential amplifiers, voltage regulators, and temperature-compensation circuitry on a single silicon die. This integration allows the sensor to output a robust, conditioned signal—either a continuous analog voltage or a crisp digital logic level—that a microcontroller can read directly without external op-amp staging.
Analog vs. Digital Outputs: What You Are Actually Reading
A common mistake on the bench is conflating analog and digital hall sensors. They serve entirely different purposes and output fundamentally different signals.
Analog (Linear) Sensors: These output a continuous voltage that scales linearly with the magnetic field strength. At zero magnetic field (quiescent state), they typically output half of their supply voltage (ratiometric) or a fixed reference voltage (absolute). You read these with an Analog-to-Digital Converter (ADC) to determine exact distance, position, or field strength.
Digital (Switch/Latch) Sensors: These contain an internal Schmitt trigger and output a binary HIGH or LOW. They are used for RPM counting, limit switches, or brushless motor commutation. Digital outputs are typically configured as open-drain vs push-pull. An open-drain output can only sink current to ground (pulling the line LOW); it requires an external pull-up resistor connected to VCC to pull the line HIGH when the internal MOSFET is off. A push-pull output actively drives the pin both HIGH and LOW internally, requiring no external resistor.
Wiring, Pinouts, and Power Supply Ranges
Before wiring, verify your microcontroller's logic level. Feeding a 5V analog sensor output into a 3.3V ESP32 GPIO will clip your readings and potentially damage the pin over time. Below are the pinouts and supply ranges for the most common bench variants.
| Part Number | Type | Supply Range (VCC) | Pin 1 | Pin 2 | Pin 3 | Output Stage |
|---|---|---|---|---|---|---|
| Honeywell SS49E | Analog | 2.7V – 6.5V | VCC | GND | VOUT | Push-Pull (Ratiometric) |
| TI DRV5055 | Analog | 2.5V – 5.5V | VCC | GND | OUT | Push-Pull (Absolute) |
| Melexis US5881 | Digital Latch | 2.2V – 3.6V | VDD | GND | OUT | Open-Drain (Needs Pull-up) |
| Allegro A3144 | Digital Switch | 3.8V – 24.0V | VCC | GND | OUT | Open-Drain (Needs Pull-up) |
If you are using an ESP32, avoid powering ratiometric 5V sensors (like the SS49E) and using a voltage divider on the output. Voltage dividers ruin the ratiometric cancellation of power supply noise. Instead, power the sensor directly from the ESP32's 3.3V pin and feed the output directly to the ADC.
The Math: Converting Raw ADC to Gauss and Millimeters
Let's walk through the exact math to convert a raw ADC reading into a physical unit (Gauss) using the ubiquitous Honeywell SS49E powered at 5.0V. According to the principles of magnetic field measurement, the SS49E has a quiescent (zero-field) output of VCC/2 (2.5V) and a typical sensitivity of 1.4 mV/Gauss.
Step 1: Convert Raw ADC to Voltage
Assuming a 10-bit ADC (like on an Arduino Uno) with a 5.0V reference:
Voltage = (Raw_ADC_Value * 5.0) / 1023.0
Step 2: Calculate the Delta from Quiescent
Delta_V = Voltage - 2.5
Note: A positive delta indicates a South pole facing the sensor; negative indicates a North pole.
Step 3: Convert Voltage to Gauss
Since sensitivity is 1.4 mV/G (or 0.0014 V/G):
Magnetic_Field_Gauss = Delta_V / 0.0014
Calibration and Scaling:
Ratiometric sensors drift if your VCC sags. If your USB supply drops to 4.8V, your quiescent voltage drops to 2.4V, throwing off your math. To fix this, read your VCC pin with a secondary ADC channel, or switch to an absolute sensor like the TI DRV5055, which maintains a fixed 1.25V quiescent output regardless of VCC fluctuations between 2.5V and 5.5V.
Interference, Drift, and Shielding
Hall sensors are notoriously susceptible to environmental noise. If your ADC readings are jittering by 10-20 points at rest, you are likely hitting one of three interference sources:
- AC Mains EMI: 50/60Hz alternating current in nearby wall wiring or unshielded power cables generates alternating magnetic fields. This injects a sine-wave ripple into your DC output. Fix: Route sensor wires away from AC lines and implement a software moving-average filter (window of 20-50 samples) or a hardware RC low-pass filter (e.g., 100Ω resistor + 1µF capacitor) on the output pin.
- Stray DC Fields: Neodymium magnets used elsewhere in your project, or the steel chassis of a nearby DC motor, will skew your zero-point. Fix: Map your magnetic environment and establish a software "tare" function at startup.
- Thermal Drift: The sensitivity of silicon Hall elements drops by roughly 0.1% to 0.2% per °C rise. If your sensor is mounted near a hot voltage regulator or motor driver, your Gauss readings will artificially shrink. Fix: Use sensors with integrated chopper-stabilization (like the Allegro A1324), which virtually eliminates thermal and offset drift.
Decision Tree: Which Hall Sensor to Buy
Stop guessing in the parts aisle. Use this decision path to select the exact component for your embedded project.
| Your Application Requirement | Sensor Type Needed | Concrete Part Pick | Why This Part Wins |
|---|---|---|---|
| Continuous position tracking, Z-probing, or analog throttle | Analog (Linear) | TI DRV5055OA | Wide 2.5-5.5V range, absolute 1.25V offset (immune to VCC sag), high precision. |
| Low-budget analog joystick or basic proximity on 5V Arduino | Analog (Ratiometric) | Honeywell SS49E | Ubiquitous, cheap (~$1.50), easy to source, but requires stable 5V VCC. |
| BLDC motor commutation or rotary encoding (needs direction) | Digital (Bipolar Latch) | Melexis US5881 | Latches on South, releases on North. Native 3.3V logic, perfect for ESP32 interrupts. |
| Simple limit switch, door sensor, or basic RPM counting | Digital (Unipolar Switch) | Allegro A3144 | Turns on with South pole, off when removed. Accepts up to 24V for industrial PLCs. |
If you are paralyzed by choice and just need a reliable, high-resolution position sensor for a 3.3V ESP32 or 5V Arduino project, buy the TI DRV5055OA. It eliminates the ratiometric VCC-drift headache, provides a clean 1.25V to VCC output swing that maximizes your ADC resolution, and costs about $0.85 in single quantities. Pair it with a 4x4x2mm neodymium magnet for a linear travel range of roughly 15mm before saturation.






