The Sensing Principle
Often mistyped in search engines as a half effect sensor, the Hall effect sensor is a solid-state transducer that varies its output voltage in response to an external magnetic field. When a bias current flows through a thin semiconductor element (typically gallium arsenide or indium antimonide), an applied perpendicular magnetic field exerts a Lorentz force on the moving charge carriers. This force deflects the electrons to one side of the material, creating a measurable transverse voltage differential known as the Hall voltage.
In practical linear sensors, this raw microvolt-level Hall voltage is fed into an internal differential amplifier and voltage regulator. The result is a robust, ratiometric analog output that scales linearly with magnetic flux density. Unlike digital Hall switches (which snap on/off via an internal Schmitt trigger), linear analog sensors provide a continuous voltage proportional to the field strength, making them ideal for proximity sensing, current measurement, and joystick position tracking.
Hardware Specs & Wiring Pinout
Before wiring anything to your microcontroller, you must identify your specific sensor variant. Linear Hall sensors are broadly categorized by their sensitivity and supply voltage requirements. Below is a data-dense comparison of the most common analog Hall effect sensors found on the hobbyist bench in 2026.
| Part Number | Supply Range (VCC) | Sensitivity (Typical) | Quiescent Offset (Zero Field) | Output Type |
|---|---|---|---|---|
| Honeywell SS49E | 2.7V to 6.5V | 1.4 mV/Gauss (at 5V) | 0.5 × VCC | Analog Ratiometric |
| TI DRV5055A1 | 2.5V to 5.5V | 100 mV/mT (~10 mV/G) | 0.5 × VCC | Analog Ratiometric |
| Allegro A1302 | 3.0V to 5.5V | 2.5 mV/Gauss (at 5V) | 0.5 × VCC | Analog Ratiometric |
| Melexis MLX90215 | 4.5V to 5.5V | Programmable | Programmable | Analog Ratiometric |
For a deeper dive into the underlying physics and application circuits, the All About Circuits Hall Effect guide provides excellent schematic references.
Standard 3-Pin Wiring Table
Most through-hole linear Hall sensors (like the SS49E and A1302) share a standard 3-pin SIP package. When reading the flat face of the sensor with the pins pointing down, the pinout is as follows:
| Pin | Function | Connection Details |
|---|---|---|
| 1 | VCC (Supply) | Connect to 3.3V or 5V (verify sensor spec). Must be clean DC. |
| 2 | GND (Ground) | Connect to microcontroller common ground. |
| 3 | VOUT (Signal) | Connect to MCU ADC pin. Add 100nF decoupling cap between Pin 1 & 2. |
Output Signal Math: Raw ADC to Gauss
The output of a linear Hall sensor is an analog voltage that is ratiometric to the supply voltage (VCC). This means both the zero-field offset and the sensitivity scale proportionally if VCC fluctuates. To convert a raw microcontroller ADC reading into a physical magnetic flux density unit (Gauss or milliTesla), you must apply a two-step mathematical transformation.
Step 1: Raw ADC to Voltage
Assuming you are using an ESP32 DevKit (12-bit ADC, 0-4095 range, 3.3V reference) and powering the SS49E sensor at 3.3V:
- Voltage (V) = (Raw_ADC / 4095.0) × 3.3
Note on ESP32 ADC Non-Linearity: The ESP32's internal ADC is notoriously non-linear near the 0V and 3.3V rails. For precision measurements, use the analogReadMilliVolts() function in the Arduino core, which applies factory-stored eFuse calibration data, or use an external I2C ADC like the ADS1115. See the Espressif ESP32 ADC Documentation for hardware calibration details.
Step 2: Voltage to Magnetic Flux Density (Gauss)
Because the SS49E is ratiometric, powering it at 3.3V instead of the datasheet's 5V reference changes its behavior:
- Quiescent Offset (Zero Field): 3.3V / 2 = 1.65V
- Scaled Sensitivity: 1.4 mV/G × (3.3V / 5.0V) = 0.924 mV/G (or 0.000924 V/G)
The formula to calculate the magnetic field (B) in Gauss is:
B (Gauss) = (V_out - V_offset) / Scaled_Sensitivity
Worked Numeric Example
You place a neodymium magnet near your 3.3V-powered SS49E. The ESP32 reads an ADC value of 2650.
- Calculate Voltage: (2650 / 4095.0) × 3.3V = 2.135V
- Subtract Offset: 2.135V - 1.65V = 0.485V
- Divide by Sensitivity: 0.485V / 0.000924 V/G = 524.8 Gauss
The positive value indicates a South magnetic pole facing the branded side of the sensor. A negative result would indicate a North pole.
Calibration, Interference, and Edge Cases
Getting reliable data from a Hall sensor on a messy workbench requires managing environmental interference and performing basic software calibration.
Common Interference Sources
- AC Mains EMI: Running a 120V/240V AC cable near your sensor induces a 50/60Hz alternating magnetic field. This appears as a 1-3 Gauss jitter in your readings. Fix: Implement a software moving-average filter (window of 20-50 samples) or a hardware low-pass RC filter (e.g., 1kΩ resistor + 1µF capacitor on the VOUT line).
- Ferromagnetic Distortion: The Earth's magnetic field is roughly 0.5 Gauss, but nearby steel bench legs, screwdrivers, or breadboard plates can distort local flux lines, shifting your zero-point offset. Fix: Keep the sensor at least 6 inches away from large ferrous masses.
- Temperature Drift: Standard silicon Hall sensors exhibit an offset drift of roughly 0.5 mV/°C. For the SS49E at 3.3V, this translates to an error of about 0.54 Gauss per degree Celsius change. For high-precision environments, use chopper-stabilized sensors like the TI DRV5055 (review the Texas Instruments DRV5055 Datasheet for thermal curves).
Software Calibration Routine
Never hardcode the 1.65V offset assumption into your final production code. Component tolerances mean your actual zero-field offset might be 1.62V or 1.68V. Use this startup calibration sequence:
dynamic_offset. Subtract this dynamic offset from all subsequent readings before applying the sensitivity multiplier.
Digital vs. Analog Conflation
A frequent mistake among beginners is buying an A3144 (a digital Hall switch) and attempting to read it with an ADC pin expecting a linear voltage gradient. Digital switches only output a hard 0V or VCC based on an internal hysteresis threshold. If your project requires measuring distance or field strength, you must explicitly purchase a linear analog Hall sensor (like the SS49E or DRV5055). If you only need to detect if a door is open or closed, a digital switch is cheaper and immune to ADC noise.






