The Hall Effect: How Magnetic Fields Become Voltage

When a current-carrying semiconductor is placed in a magnetic field, the Lorentz force pushes charge carriers to one side of the material, creating a measurable transverse voltage proportional to the magnetic field strength. In modern integrated circuits like the Honeywell SS49E or Texas Instruments DRV5053, this microvolt-level Hall voltage is amplified, temperature-compensated, and buffered internally before reaching the output pin, as detailed in TI's Hall Effect Sensor overview.

Practically, what a Hall sensor does is translate invisible magnetic flux into a readable electrical signal without physical contact. This solid-state operation makes them immune to dust, moisture, and mechanical wear, which is why they remain the default choice for brushless DC (BLDC) motor commutation, RPM counting, and non-contact current sensing in modern power electronics.

Digital vs. Analog Hall Sensors: Pinouts and Wiring

A common mistake on the bench is conflating digital Hall switches with analog linear sensors. They share the same underlying physics but output entirely different signals. Digital sensors (like the ubiquitous A3144) act as magnetic triggers; they output a clean digital LOW when a south pole exceeds a specific threshold (typically 30-50 Gauss) and return HIGH when the field drops below a release point. Analog sensors (like the SS49E) output a continuous, ratiometric voltage that scales linearly with magnetic flux density, sitting at exactly VCC/2 when no magnet is present.

Spec-Sheet Comparison: Common Hall Effect ICs
Part Number Type Supply Range (VCC) Output Signal Typical Cost (2026)
A3144EUA-T Digital Switch (Unipolar) 4.5V to 24V Open-Drain (LOW on magnet) ~$0.12
Honeywell SS49E Analog Linear 2.7V to 6.5V Ratiometric Voltage (VCC/2 at 0G) ~$0.45
TI DRV5053 Analog Linear / PWM 2.5V to 5.5V Voltage or PWM (depending on variant) ~$0.85
Bench Tip: The ESP32's ADC is strictly limited to 3.3V and is notoriously non-linear near the rails. If you are using an SS49E analog sensor with an ESP32, power the sensor from the ESP32's 3.3V pin, not the 5V (VIN) pin. This keeps the quiescent output at ~1.65V, safely in the linear sweet spot of the ESP32's ADC.

Wiring the SS49E to an ESP32 (Analog)

  1. VCC: Connect to ESP32 3.3V. (Do not use 5V, or the 2.5V quiescent output will be fine, but a strong magnet pushing the output above 3.3V will damage the ESP32 GPIO).
  2. GND: Connect to ESP32 GND.
  3. OUT: Connect to ESP32 GPIO 34 (an ADC1 channel that remains functional when WiFi is active).
  4. Bypass: Solder a 100nF ceramic capacitor directly across the VCC and GND legs of the sensor to filter high-frequency switching noise.

Converting Raw ADC Readings to Magnetic Flux Density

To get useful physical units (Gauss or milliTesla) from an analog Hall sensor, you must account for the sensor's quiescent voltage offset and its specific sensitivity rating. According to All About Circuits' magnetic measurement guide, sensitivity is ratiometric to the supply voltage.

For the SS49E running at 5V, the datasheet specifies a typical sensitivity of 1.4 mV/Gauss. However, because we are running it at 3.3V to protect the ESP32, we must scale the sensitivity proportionally: 1.4 * (3.3 / 5.0) = 0.924 mV/Gauss.

The Raw-to-Unit Math

The ESP32's 12-bit ADC yields raw values from 0 to 4095. Assuming a 3.3V reference:

  1. Convert Raw to Voltage: V_measured = (ADC_Raw / 4095.0) * 3.3
  2. Find the Delta: V_delta = V_measured - V_quiescent (where V_quiescent is 1.65V at 3.3V VCC).
  3. Calculate Flux (Gauss): B = V_delta / 0.000924 (converting mV to V).
// ESP32 Arduino C++ Snippet for SS49E at 3.3V
const int HALL_PIN = 34;
const float V_REF = 3.3;
const float ADC_MAX = 4095.0;
const float V_QUIESCENT = 1.65; // VCC / 2
const float SENSITIVITY = 0.000924; // Volts per Gauss at 3.3V VCC

void setup() {
  Serial.begin(115200);
  analogReadResolution(12);
  analogSetAttenuation(ADC_11db); // Full 0-3.3V range
}

void loop() {
  int rawADC = analogRead(HALL_PIN);
  float voltage = (rawADC / ADC_MAX) * V_REF;
  float gauss = (voltage - V_QUIESCENT) / SENSITIVITY;
  
  Serial.printf("Raw: %d | Voltage: %.2fV | Flux: %.1f Gauss\n", rawADC, voltage, gauss);
  delay(100);
}

Real-World Interference and Debugging

Hall sensors are highly susceptible to environmental noise. If your readings are jittery or drifting, check these common interference sources:

  • Switching Regulator EMI: Buck converters and motor drivers generate high-frequency magnetic fields. Keep Hall sensors at least 2cm away from inductors and switching nodes, or use shielded twisted pair (STP) cable for remote sensor heads.
  • Ferrous Metal Distortion: Mounting a Hall sensor on a steel chassis or using steel breadboard plates will bend the magnetic flux lines, altering the field strength at the sensor die. Use brass, aluminum, or plastic mounts for precision applications.
  • Temperature Drift: While modern ICs have internal compensation, extreme temperature swings still cause a 0.1% to 0.2% per °C drift in sensitivity. For high-precision current sensing, implement a software offset calibration at startup.

Frequently Asked Questions

What does a Hall sensor do in a BLDC motor?

In a brushless DC motor, Hall sensors act as rotary encoders to track the permanent magnet rotor's position. Typically, three digital Hall sensors are spaced 120 electrical degrees apart inside the stator. As the rotor spins, the sensors output a 3-bit digital sequence (e.g., 101, 100, 110) that tells the motor controller exactly when to commutate—to switch the current to the next stator coil winding to keep the motor spinning smoothly.

What does a Hall effect sensor do when exposed to AC current?

When placed near a current-carrying wire, the sensor measures the concentric magnetic field generated by the AC current (Ampere's Law). Modules like the ACS712 use an internal Hall sensor and a flux concentrator to output an analog voltage proportional to the AC current. Because the AC magnetic field alternates polarity, the analog Hall sensor's voltage swings above and below its VCC/2 quiescent point, allowing the microcontroller to calculate RMS current by sampling the waveform.

What does a Hall sensor do if the magnet is too far away?

The magnetic field strength of a dipole magnet drops off according to the inverse cube law ($1/r^3$). This means if you double the distance between the magnet and the Hall sensor, the magnetic flux density drops to roughly 12.5% of its original strength. If the magnet is too far, the field will fall below the sensor's noise floor or the digital switch's operate point (BOP), resulting in a failure to trigger or highly erratic analog readings. For reliable switching, keep the air gap under 10mm for standard neodymium magnets.