The Physics: How Hall Effect Sensors Actually Work

When an electrical current flows through a semiconductor and a magnetic field is applied perpendicular to that current, the Lorentz force deflects the moving electrons to one side of the material. This charge accumulation creates a measurable transverse voltage known as the Hall voltage. The strength of this voltage is directly proportional to the magnetic flux density passing through the element.

In a raw semiconductor, this Hall voltage is only a few microvolts and highly susceptible to temperature drift. Modern integrated circuit (IC) Hall sensors solve this by packaging the Hall element alongside a chopper-stabilized amplifier, voltage regulator, and temperature compensation circuitry into a single 3-pin TO-92 or SOT-23 package. This integration is what allows us to interface magnetic fields directly with microcontroller GPIOs and ADCs without external op-amp circuits.

Analog vs. Digital: Choosing the Right Hall Sensor Type

When sourcing components, the types of hall effect sensors generally fall into two distinct output categories. Conflating these on your breadboard will result in either a dead short or floating logic pins.

Analog (Linear / Ratiometric) Sensors

Analog sensors output a continuous voltage proportional to the magnetic field strength. At zero magnetic field, the output sits at a quiescent midpoint (usually VCC/2). As a South pole approaches, the voltage rises; as a North pole approaches, it falls.
Common Part Numbers: Honeywell SS49E (5V classic), TI DRV5055 (modern 3.3V/5V ratiometric).
Best For: Measuring physical displacement, current sensing (via flux concentrators), and liquid level floats.

Digital (Switch and Latch) Sensors

Digital sensors output a binary HIGH or LOW logic signal. They contain an internal Schmitt trigger to provide hysteresis, preventing output chatter when hovering near the threshold.
Unipolar Switches (e.g., Allegro A3144): Turn ON when a strong South pole is detected, and turn OFF when the field drops below a lower release threshold. They ignore North poles entirely.
Bipolar Latches (e.g., Melexis US1881): Turn ON with a South pole and stay ON until a North pole is applied.
Best For: RPM counting, limit switches, and brushless DC (BLDC) motor commutation.

Wiring and Pinout Reference for Microcontrollers

Almost all 3-pin through-hole Hall sensors share the same physical pinout when viewing the flat face with the leads pointing down: Pin 1 is VCC, Pin 2 is GND, and Pin 3 is OUT. However, supply ranges and output stages dictate how you wire them to your specific board.

Sensor Type Part Number VCC Supply Range Output Stage Microcontroller Compatibility
Analog Linear SS49E 2.7V to 6.5V Push-Pull (Voltage) Arduino Uno (5V ADC)
Analog Ratiometric DRV5055A1 2.5V to 5.5V Push-Pull (Voltage) ESP32 / Raspberry Pi Pico (3.3V ADC)
Digital Switch A3144 4.5V to 24V Open-Drain (Low-side) Arduino (Requires 10k pull-up to 5V)
Digital Latch US1881 3.5V to 24V Open-Drain (Low-side) ESP32 (Requires 10k pull-up to 3.3V)
Callout Tip: Open-Drain Outputs
Digital Hall switches like the A3144 use open-drain outputs. They can pull the signal line to GND, but they cannot drive it HIGH. You must wire a pull-up resistor (typically 10kΩ) between the OUT pin and your microcontroller's logic voltage (3.3V or 5V), or enable the microcontroller's internal pull-up in software.

Output Signal Math: Converting Raw ADC to Gauss

An analog sensor's raw ADC reading is useless without scaling. To convert the microcontroller's digital value into a physical magnetic flux density (measured in Gauss or milliTesla), you need the sensor's quiescent voltage and its sensitivity rating from the datasheet.

Let's look at a worked example using the ubiquitous Honeywell SS49E powered at 5.0V, read by a 10-bit Arduino Uno ADC (0-1023 range).

  • Quiescent Voltage (V_q): 2.5V (exactly half of VCC)
  • Sensitivity (S): 1.4 mV/Gauss (typical at 5V)
  • ADC Reference: 5.0V

Step 1: Convert Raw ADC to Voltage
Voltage = Raw_ADC * (V_ref / 1023)
If your Arduino reads 614, the voltage is: 614 * (5.0 / 1023) = 3.00V.

Step 2: Calculate the Delta Voltage
Delta_V = Voltage - V_q
Delta_V = 3.00V - 2.50V = 0.50V (or 500 mV).

Step 3: Convert to Gauss
Magnetic_Field = Delta_V (in mV) / Sensitivity
Magnetic_Field = 500 mV / 1.4 mV/G = 357 Gauss.

ESP32 ADC Calibration Warning
If you are wiring a 3.3V sensor like the DRV5055 to an ESP32, do not use the raw analogRead() function for precision math. The ESP32's internal ADC is notoriously non-linear at the 0V and 3.3V extremes. Always use analogReadMilliVolts() (available in ESP32 Arduino Core v2.x and later), which applies factory-stored eFuse calibration data to return a linear millivolt reading. See the Espressif ADC API documentation for implementation details.

Real-World Interference and Calibration Fixes

Hall effect sensors are notoriously vulnerable to environmental noise on the bench and in the field. If your readings are drifting or your digital switch is chattering, check these three interference sources:

  1. Thermal Drift and Offset Shift: While modern ICs use chopper stabilization to minimize internal thermal drift, extreme ambient temperature swings (e.g., outdoor enclosures in summer) can still shift the quiescent baseline by 1-2 mV. Fix: Implement a software auto-zero routine at startup where the microcontroller records the baseline ADC value with no magnet present, rather than hardcoding VCC/2.
  2. Electromagnetic Interference (EMI): Analog Hall sensors have high-impedance output stages. If you route the analog signal wire parallel to PWM motor phase wires or switching power supplies, capacitive coupling will inject noise into your ADC. Fix: Use twisted-pair wiring for the sensor cable, keep traces short, and solder a 100nF ceramic bypass capacitor directly across the VCC and GND pins at the sensor body.
  3. Mechanical Stress (Piezoresistive Effect): Bending the leads of a TO-92 package too close to the epoxy body induces mechanical stress on the silicon die, altering the offset voltage. Fix: Always use a pair of needle-nose pliers to grip the base of the lead when bending, never bend flush against the plastic housing.

Frequently Asked Questions

What are the different types of hall effect sensors used in brushless motors?

Brushless DC (BLDC) motors almost exclusively use bipolar digital latches (like the Melexis US1881 or Honeywell SS41). Unlike unipolar switches that turn off when the magnet moves away, a bipolar latch turns on when the rotor's South pole passes and remains on until the North pole arrives. This precise 180-degree electrical locking is required by the motor controller to accurately time the commutation of the stator windings.

Which types of hall effect sensors work best with ESP32 3.3V logic?

For 3.3V microcontrollers like the ESP32 or Raspberry Pi Pico, avoid legacy 5V-optimized parts like the SS49E, as their output swing will be clipped and their sensitivity derated. Instead, choose modern ratiometric sensors specifically designed for low-voltage operation, such as the TI DRV5055 or the Allegro A1324. For digital switching on 3.3V logic, the Diodes Incorporated AH180N operates cleanly down to 2.5V and features an internal pull-up, eliminating the need for external resistors.

How do analog and digital types of hall effect sensors differ in output signaling?

Analog (linear) sensors output a continuous voltage that scales proportionally with the magnetic field strength, requiring an ADC to interpret the exact distance or field density. Digital sensors output a binary logic level (HIGH or LOW) triggered by a specific magnetic threshold. Digital sensors also incorporate built-in hysteresis—a deliberate gap between the turn-on and turn-off thresholds—to prevent the output from rapidly oscillating (chattering) when a magnet hovers near the activation point.