A unipolar hall effect sensor triggers exclusively when exposed to a magnetic field of a single polarity (typically the South pole of a neodymium magnet) that exceeds a specific threshold (BOP), and releases when the field drops below a lower release threshold (BRP). Unlike bipolar or omnipolar sensors that react to both North and South poles, the unipolar variant ignores the opposite pole entirely, making it the definitive choice for one-directional proximity detection, RPM counting, and limit switching where magnetic polarity reversal is impossible or undesirable.
Inside the silicon die, a bias current runs through a thin semiconductor plate. When a perpendicular magnetic field penetrates the plate, the Lorentz force deflects the charge carriers to one side, generating a measurable Hall voltage. An integrated Schmitt trigger or linear amplifier then conditions this microvolt-level signal into a clean, usable output. Because the unipolar architecture incorporates built-in hysteresis (the gap between BOP and BRP), it inherently rejects mechanical chatter and magnetic noise, providing a rock-solid signal without external filtering.
Output Architectures and Raw-to-Unit Math
Conflating digital and analog outputs is the most common mistake when interfacing magnetic sensors. Unipolar sensors come in two distinct output architectures, and the math required to extract physical units differs entirely between them.
Digital Output (Switch)
The output is a binary logic level driven by an internal open-collector NPN transistor. When the South pole field exceeds BOP (e.g., 3.5 mT), the output pulls to GND (LOW). When it drops below BRP (e.g., 2.5 mT), the output floats HIGH via an external pull-up resistor.
- Raw-to-Unit Math: None required. Raw reading
0= magnet present,1= magnet absent. - Calibration: None. You are measuring discrete state, not continuous field strength.
Analog Output (Linear)
The output is a continuous ratiometric voltage proportional to the magnetic flux density. This is required for applications like fluid level sensing or precise linear positioning.
Raw ADC to milliTesla (mT) Math:
Assuming a 3.3V ESP32 and a DRV5055A2 (sensitivity = 25 mV/mT, quiescent voltage = 1.65V at 3.3V VCC).
- Read raw ADC:
raw_adc = analogRead(PIN) - Convert to Voltage:
V_out = (raw_adc / 4095.0) * 3.3 - Calculate Flux Density:
B_mT = (V_out - V_quiescent) / Sensitivity
Worked Example: If raw_adc reads 2482, V_out is 2.0V. The flux density is (2.0 - 1.65) / 0.025 = 14 mT.
Wiring Pinouts and Power Supply Specifications
Below is the hardware specification table for the two most common unipolar benchmarks: the digital A3144 and the analog SS49E. Note that supply ranges dictate your logic-level interfacing strategy.
| Parameter | A3144 (Digital Switch) | SS49E (Analog Linear) |
|---|---|---|
| VCC Supply Range | 4.5V to 24.0V | 2.7V to 6.5V |
| GND Pin | Pin 2 (Center) | Pin 2 (Center) |
| Output Pin | Pin 3 (Right) | Pin 3 (Right) |
| Output Type | Open-Collector NPN | Ratiometric Analog Voltage |
| Pull-up Required? | Yes (10kΩ to logic VCC) | No |
| Max Output Current | 25 mA (sink) | 1 mA (source/sink) |
Interference Sources and Calibration Protocols
Hall sensors are notoriously susceptible to environmental noise if installed blindly. Here are the three primary interference vectors and how to defeat them.
1. Electromagnetic Interference (EMI)
Switching loads like relays, solenoids, and brushless motors induce high-frequency spikes in sensor wiring, causing phantom triggers in digital sensors or jitter in analog readings. Fix: Use twisted-pair wiring for the sensor cable and solder a 100nF ceramic decoupling capacitor directly across the sensor's VCC and GND pins at the sensor body, not at the microcontroller end.
2. Temperature Drift
Silicon Hall elements exhibit a sensitivity drift of roughly -0.1%/°C to -0.2%/°C. In an uncalibrated analog setup, a 30°C ambient swing can introduce a 5% measurement error. Fix: For precision analog work, abandon legacy SS49E parts and use modern sensors like the TI DRV5055, which feature integrated temperature compensation circuitry on the die.
3. Ferromagnetic Flux Shunting
Mounting a hall sensor directly to a steel or iron bracket will shunt the magnetic flux lines away from the sensor die, drastically reducing the effective range. Fix: Mount sensors on non-magnetic materials (plastic, brass, aluminum, or FR4). If a steel mount is unavoidable, upgrade your magnet to an N52 grade neodymium to overcome the flux leakage.
ESP32 Implementation and Edge-Case Handling
When reading analog unipolar sensors with an ESP32, you must account for the ESP32's ADC non-linearity. The standard analogRead() function becomes highly inaccurate above 2.5V due to internal DAC noise and attenuation characteristics.
Use the ESP-IDF calibrated millivolt reading function to bypass raw ADC math and get direct millivolt outputs, which you then convert to mT.
#include <Arduino.h>
const int HALL_PIN = 34; // ADC1_CH6 (GPIO 34)
const float QUIESCENT_MV = 1650.0; // 1.65V at zero field
const float SENSITIVITY_MV_MT = 25.0; // 25mV/mT for DRV5055A2
void setup() {
Serial.begin(115200);
analogReadResolution(12);
// Set 11dB attenuation for full 0-3.3V range
analogSetPinAttenuation(HALL_PIN, ADC_11db);
}
void loop() {
// Use calibrated mV read to bypass ESP32 ADC non-linearity
int v_out_mv = analogReadMilliVolts(HALL_PIN);
float b_mt = (v_out_mv - QUIESCENT_MV) / SENSITIVITY_MV_MT;
Serial.printf("Voltage: %d mV | Flux: %.2f mT\n", v_out_mv, b_mt);
delay(100);
}analogReadMilliVolts() value and update the QUIESCENT_MV constant in your code. This zero-field offset calibration eliminates VCC tolerance errors from your final calculation.Decision Tree: Selecting Your Exact Sensor Part
Stop guessing which hall sensor to buy. Use this decision matrix to select the exact part number for your embedded project based on your physical measurement requirements.
| Application Requirement | Required Output | Recommended Part Number |
|---|---|---|
| RPM counting, limit switching, door alarms | Digital (Switch) | Allegro A3144EUA-T |
| Linear position, fluid level, joystick | Analog (Linear) | TI DRV5055A2QDBZR |
| High-EMI automotive/industrial environments | Digital with Diagnostics | TI DRV5012A1QDBZR |
| Ultra-low power battery/solar IoT nodes | Digital (Nano-power) | TI DRV5032FA |
The Default Recommendation
If you are building a standard hobbyist or prototyping project—such as an e-bike speedometer, a 3D printer endstop, or a basic proximity alarm—and you need a robust, cheap limit switch, buy the Allegro A3144EUA-T.
It costs approximately $0.85 in single quantities, handles a massive 4.5V to 24V supply range (making it safe for both 5V Arduinos and 12V automotive systems), and its open-collector output easily interfaces with 3.3V ESP32 GPIOs using a simple 10kΩ pull-up. It is the undisputed workhorse of unipolar magnetic sensing, and its integrated hysteresis means you will spend zero time writing software debouncing code. For further reading on magnetic field thresholds and silicon architectures, refer to the Texas Instruments Hall Effect Sensor Guide and the SparkFun Hall Effect Tutorial.






