The Hall Effect Sensing Principle
When an electrical current flows through a semiconductor and a magnetic field is applied perpendicular to that current, the Lorentz force deflects the charge carriers to one side of the material. This accumulation of charge creates a measurable transverse voltage difference known as the Hall voltage. In raw semiconductor materials, this voltage is typically in the microvolt range and highly temperature-dependent.
To make this usable in embedded systems, modern linear Hall sensor ICs integrate a voltage regulator, a precision differential amplifier, and temperature compensation circuitry onto a single silicon die. Instead of outputting microvolts, the IC outputs a scaled, stable voltage that varies linearly with the magnetic flux density (measured in Gauss or milliTesla) passing through the package. This allows a microcontroller's ADC to directly measure magnetic field strength, position, or current without external amplification.
Analog vs. Digital: What the Output Actually Is
A common and costly mistake in embedded design is conflating linear (analog) Hall sensors with switch (digital) Hall sensors. They share the same underlying physics but output completely different signals.
Linear (Analog) Sensors: Output a continuous voltage proportional to the magnetic field. With zero magnetic field present, the output sits at a quiescent midpoint (usually Vcc/2). As a north pole approaches, the voltage increases; as a south pole approaches, it decreases. You use these to measure how much magnetic field is present.
Digital (Switch/Latch) Sensors: Contain an internal Schmitt trigger. They output a binary logic level (HIGH or LOW). They switch ON at a specific operate point (Bop) and switch OFF at a release point (Brp), providing built-in hysteresis to prevent contact bounce. You use these for RPM counting, limit switches, or door alarms. This guide focuses strictly on linear analog circuits for continuous measurement.
Wiring and Pinout Table for Common Linear Hall ICs
Linear Hall ICs typically come in a 3-pin SIP or SOT-23 package. Below is a specification table for the three most common parts used in maker and industrial prototyping. Always verify the pinout on the specific datasheet, as SOT-23 surface-mount variants often swap the VCC and OUT pins compared to through-hole SIP packages.
| Part Number | Supply Range (Vcc) | Quiescent Output (0 Gauss) | Sensitivity | Best Application |
|---|---|---|---|---|
| Honeywell SS49E | 2.7V to 6.5V | Vcc / 2 (Ratiometric) | 1.4 mV/Gauss | General purpose, 5V Arduino |
| Allegro A1302 | 4.5V to 5.5V | Vcc / 2 (Ratiometric) | 1.3 mV/Gauss | Current sensing, 5V systems |
| TI DRV5055 | 2.5V to 5.5V | Vcc / 2 (Ratiometric) | Selectable (e.g., 10 mV/mT) | 3.3V ESP32, high precision |
Most linear Hall sensors are ratiometric. This means if your 5V supply sags to 4.8V, the zero-Gauss quiescent output drops from 2.5V to 2.4V, and the sensitivity scales down proportionally. If you are using a microcontroller with a fixed internal ADC reference (like the ESP32's 3.3V internal reference), a sagging Vcc will introduce measurement errors. For high-precision 3.3V systems, use a dedicated LDO to power the sensor, or switch to an absolute-output sensor.
The Math: Converting Raw ADC Readings to Gauss
To translate the microcontroller's raw ADC integer into a physical magnetic flux density, you must map the ADC steps to voltage, and then map the voltage to Gauss using the sensor's sensitivity rating.
Let's use the Honeywell SS49E powered at exactly 5.00V, read by a standard 10-bit Arduino Uno ADC (0-1023 range).
Step 1: ADC to Voltage
The Arduino's 5V reference maps to 1024 steps. Each step is worth 4.88 mV.
V_out = ADC_Raw * (5.0 / 1024.0)
Step 2: Voltage to Gauss
The SS49E has a nominal sensitivity of 1.4 mV/Gauss (0.0014 V/G). The zero-Gauss baseline is at 2.5V. We subtract the baseline and divide by the sensitivity.
Gauss = (V_out - 2.5) / 0.0014
Combined C++ Implementation
// Pin definitions
const int HALL_PIN = A0;
const float VCC = 5.0; // Measure with multimeter and hardcode!
const float SENSITIVITY = 0.0014; // 1.4 mV/Gauss for SS49E
const float ZERO_GAUSS = VCC / 2.0;
void setup() {
Serial.begin(115200);
analogReference(DEFAULT); // 5V on Uno
}
void loop() {
int raw_adc = analogRead(HALL_PIN);
// Convert raw ADC to voltage
float voltage = raw_adc * (VCC / 1024.0);
// Convert voltage to Gauss
float gauss = (voltage - ZERO_GAUSS) / SENSITIVITY;
Serial.print("Raw: "); Serial.print(raw_adc);
Serial.print(" | Voltage: "); Serial.print(voltage, 3);
Serial.print("V | Field: "); Serial.print(gauss, 1);
Serial.println(" Gauss");
delay(100);
}
analogReadMilliVolts() function rather than raw 0-4095 mapping, and keep your sensor's output swing strictly between 0.2V and 3.0V. For precision current sensing on ESP32, bypass the internal ADC entirely and use an I2C 16-bit ADC like the ADS1115.
Calibration, Scaling, and Interference Mitigation
A raw mathematical conversion assumes a perfect world. In reality, bench power supplies drift, and magnetic fields are easily corrupted by environmental noise. Here is how you harden your hall sensor circuit.
1. VCC Calibration
Never assume your USB rail or breadboard power supply is exactly 5.000V or 3.300V. A 5% sag in VCC on a ratiometric sensor translates directly to a 5% error in your Gauss reading. Before finalizing your firmware, measure the VCC pin at the sensor leg with a calibrated multimeter and hardcode that exact float value into your code.
2. Common Interference Sources
- AC Mains and Switching Supplies: 50/60Hz transformers and high-frequency buck converters generate alternating magnetic fields that induce ripple on the Hall output.
- Ferrous Chassis Shunting: Mounting a Hall sensor directly against a steel breadboard or metal enclosure will 'shunt' (redirect) the magnetic flux lines away from the sensor die, artificially lowering your sensitivity.
- Thermal Drift: While modern ICs have internal compensation, extreme temperature gradients (e.g., mounting near a hot power resistor) can shift the zero-Gauss baseline.
3. The Hardware Fix: RC Low-Pass Filter
To kill high-frequency switching noise without taxing the microcontroller's CPU with software filtering, add a simple first-order RC low-pass filter directly at the sensor's output pin before it reaches the ADC. A 1 kΩ series resistor followed by a 100 nF ceramic capacitor to ground yields a cutoff frequency of roughly 1.6 kHz. This effectively shorts high-frequency EMI to ground while letting the DC and low-frequency magnetic signals pass untouched.
Decision Tree: Picking the Right Hall Sensor IC
Use this decision path to select the correct IC for your specific physical measurement requirement. Do not default to the cheapest part on Amazon; choose based on your system voltage and measurement topology.
| If your application requires... | Then you need... | Concrete Part Recommendation |
|---|---|---|
| Bidirectional DC current measurement or analog throttle position | Linear (Analog) Hall Sensor, 5V tolerant | Honeywell SS49E |
| High-precision 3.3V position sensing on an ESP32 or Raspberry Pi Pico | Linear (Analog) Hall Sensor, 3.3V optimized, high sensitivity | TI DRV5055A1 (10 mV/mT) |
| Counting gear teeth, RPM, or acting as a non-contact limit switch | Digital Switch Hall Sensor (Open-Drain) | Allegro A3144 or Melexis US1881 (Latch) |
| Measuring high AC/DC currents (>20A) without thermal issues | Isolated Hall Current Sensor IC | Allegro ACS712 (20A/30A variants) |
The Default Pick
If you are building a general-purpose DIY project—such as a magnetic levitation rig, a DIY dynamometer, or a basic proximity gauge—and you need a linear analog output, buy the Honeywell SS49E. It costs roughly $1.50 to $2.00 in single quantities, operates safely off a standard Arduino 5V rail, features a wide linear range of ±1300 Gauss (enough to handle strong neodymium magnets without saturating), and its ratiometric output perfectly cancels out minor ADC reference noise when paired with the Arduino's default analogReference(DEFAULT) setting. For 3.3V logic systems, pair it with an external ADS1115 ADC to bypass the ESP32's internal ADC limitations.
For further reading on magnetic field measurement topologies, refer to the Texas Instruments Hall Effect Sensor overview and the Honeywell Linear Sensor IC documentation. Always consult the specific datasheet for your exact package variant before soldering.






