The Sensing Principle: How Unipolar Hall ICs Work

When a current-carrying semiconductor is placed in a magnetic field, the Lorentz force deflects the charge carriers to one side of the material. This charge accumulation creates a transverse voltage difference known as the Hall voltage. In modern integrated circuits like the A3144 or US5881, this microscopic millivolt signal is immediately amplified by an on-chip operational amplifier and fed into a Schmitt trigger to provide a clean, noise-immune digital output. For a deeper look at the semiconductor physics, the All About Circuits guide on Hall Effect principles provides an excellent breakdown of the underlying charge carrier deflection.

The defining characteristic of a unipolar hall effect sensor is its magnetic polarity dependence and built-in hysteresis. It triggers (pulls the output LOW) only when exposed to a specific magnetic pole—almost always the South pole—exceeding a predefined operate threshold ($B_{OP}$), typically around 30 to 50 Gauss. It will not release (return HIGH) until the magnetic field strength drops below a lower release threshold ($B_{RP}$), usually around 10 to 30 Gauss. This hysteresis gap prevents output chatter when a magnet passes near the sensor boundary.

Wiring, Pinouts, and the Open-Collector Output

The most common beginner mistake when wiring these sensors is conflating them with analog linear sensors (like the SS49E). A unipolar hall effect sensor does not output a variable voltage proportional to the magnetic field. It outputs a digital open-collector (or open-drain) signal. This means the internal transistor can pull the output pin to ground (LOW), but it cannot drive it HIGH. You must provide an external pull-up resistor to your microcontroller's logic voltage.

Callout Tip: Always use a pull-up resistor between the OUT pin and VCC. A 10kΩ resistor is standard for 3.3V and 5V logic. Without it, the GPIO pin will float, resulting in erratic interrupts and phantom triggers.
Common Unipolar Sensor Pinouts and Supply Ranges
Sensor IC Pin 1 (VCC) Pin 2 (GND) Pin 3 (OUT) Supply Range Typical Cost (2026)
A3144 / OH3144 4.5V - 24V Ground Open-Collector 4.5V to 24V $0.12 - $0.20
US5881 2.5V - 5.5V Ground Push-Pull / Open 2.5V to 5.5V $0.15 - $0.25

Note: Pinouts assume the flat face of the TO-92 package (with the text) is facing you. Always verify with the specific manufacturer datasheet, as some cheap clones invert Pin 2 and Pin 3.

Output Signal Math: From Digital Pulses to Physical Units

Because the raw reading from a unipolar sensor is a digital edge (a timestamp of a HIGH-to-LOW transition) rather than an analog voltage, the "raw-to-unit" math involves converting pulse timing into rotational speed, or calculating the physical trip distance based on magnetic flux density.

1. Converting Pulse Timing to RPM

In motor control or anemometer builds, you measure the time between consecutive LOW pulses. If your microcontroller uses a hardware interrupt to capture the period in milliseconds, the math to derive Revolutions Per Minute (RPM) is straightforward:

float period_ms = current_pulse_time - previous_pulse_time;
float pulses_per_rev = 1.0; // Adjust if using multiple magnets

// Raw to Physical Unit (RPM)
float rpm = (60000.0 / period_ms) / pulses_per_rev;

2. Calculating Trip Distance (Gap Sizing)

If you need to know exactly how far away a neodymium magnet can be and still trigger the sensor, you must map the sensor's $B_{OP}$ (Operate Point in Gauss) to the magnet's dipole field. According to Texas Instruments application notes on magnetic sensing, the magnetic field strength $B$ along the axis of a dipole magnet drops off at the cube of the distance ($r$):

$$ B \approx \frac{\mu_0}{4\pi} \cdot \frac{2m}{r^3} $$

For practical bench work, use the inverse-cube rule of thumb: if a magnet triggers the A3144 (which has a typical $B_{OP}$ of 40 Gauss) at 10mm, moving it to 20mm drops the field strength to $\frac{1}{8}$ (5 Gauss), which is well below the release threshold. Always prototype your physical gap with a caliper and a gaussmeter app on your smartphone before finalizing 3D printed mounts.

Calibration, Hysteresis, and Interference Sources

You do not calibrate a unipolar hall sensor in software via voltage scaling; you calibrate it physically via the air gap and magnet geometry. The built-in hysteresis (the difference between $B_{OP}$ and $B_{RP}$) is factory-trimmed. However, environmental factors can shift these thresholds and introduce interference.

  • Electromagnetic Interference (EMI): Routing sensor wires parallel to stepper motor coils or AC mains will induce voltage spikes. Because the A3144 output is high-impedance when HIGH, a 2V EMI spike can easily cross the ESP32's 0.8V $V_{IL}$ threshold, causing phantom interrupts. Fix: Use twisted-pair wire for the sensor run and place a 100nF ceramic bypass capacitor directly across the VCC and GND pins at the sensor head.
  • Thermal Drift: While modern Hall ICs include on-chip temperature compensation, extreme heat (above 85°C for standard TO-92 packages) shifts the operate point. If your sensor is mounted near a 3D printer hotend or a high-current motor stator, the trigger distance will shrink as the temperature rises.
  • Mechanical Chatter: If a vibrating magnet hovers exactly at the $B_{OP}$ boundary, the hysteresis band might be too narrow to prevent the output from toggling rapidly. Fix: Switch to a sensor with a wider hysteresis band, or implement a software debounce (e.g., ignore interrupts occurring within 2ms of each other).

Unipolar Hall Effect Sensor FAQ

Can a unipolar hall effect sensor measure analog magnetic field strength?

No. A unipolar sensor is strictly a digital switch. It only tells you if the magnetic field is above or below its factory-set thresholds. If your project requires measuring the exact strength of a magnetic field (e.g., for a DIY gaussmeter, current sensing, or linear displacement), you must use a linear hall effect sensor like the SS49E or DRV5053, which outputs a continuous analog voltage proportional to the flux density.

Why is my unipolar hall effect sensor output floating on a Raspberry Pi GPIO?

This happens because the sensor features an open-collector output. It can pull the GPIO pin to ground (0V) when a magnet is present, but it lacks an internal mechanism to drive the pin to 3.3V when the magnet is removed. Without an external 10kΩ pull-up resistor connected between the sensor's OUT pin and the Pi's 3.3V rail, the GPIO pin is left electrically floating and will pick up ambient noise, resulting in random HIGH/LOW readings.

How far away should the magnet be from a unipolar hall effect sensor?

For a standard N42 neodymium disc magnet (e.g., 10mm x 3mm) and an A3144 sensor, the reliable trigger distance is typically between 8mm and 15mm. However, the exact distance depends entirely on the magnet's grade, volume, and orientation. For reliable operation in a DIY encoder or limit switch, design your mechanical mount to keep the air gap at 50% to 70% of the maximum tested trigger distance to account for vibration and thermal drift.

What is the difference between a unipolar and a bipolar hall effect sensor?

A unipolar sensor (like the A3144) turns ON when the South pole approaches and turns OFF when the South pole is removed. It ignores the North pole entirely. A bipolar sensor (like the A3123) turns ON when the South pole approaches, but it will not turn OFF when the magnet is removed; it requires the North pole to approach to turn it OFF. Bipolar sensors are preferred for applications where you need to guarantee the sensor state based on magnetic polarity, such as in brushless DC (BLDC) motor commutation.