The Sensing Principle: Lorentz Force in Semiconductors
At the core of every hall effect sensor module is a thin piece of semiconductor material (typically gallium arsenide or indium antimonide) through which a constant bias current flows. When a magnetic field is introduced perpendicular to this current, the Lorentz force deflects the moving charge carriers (electrons) to one side of the material. This accumulation of charge creates a measurable transverse voltage difference across the semiconductor, known as the Hall voltage. The strength of this voltage is directly proportional to the magnetic flux density passing through the chip.
Because the raw Hall voltage is incredibly small (often in the microvolt range), modern integrated circuits embed an operational amplifier and a voltage regulator directly on the silicon die. This amplifies the signal to a usable level and stabilizes it against supply voltage fluctuations. For deeper physics and semiconductor doping profiles, the All About Circuits technical guide on magnetic field measurement provides an excellent breakdown of the underlying solid-state physics.
Digital vs. Analog Outputs: Choosing the Right Module
A common mistake on the bench is conflating digital and analog hall effect sensors. They serve entirely different purposes and output completely different signal types. A digital sensor (like the ubiquitous A3144) acts as a magnetic switch; its output is an open-drain digital signal that pulls to ground when a specific magnetic threshold (B_OP) is crossed. It cannot tell you how strong the magnet is, only that it is present.
A linear analog sensor (like the Honeywell SS49E or TI DRV5055) outputs a continuous analog voltage proportional to the magnetic field strength. If you are building a joystick, a current meter, or a proximity gauge, you must use a linear analog module. Below is the wiring and specification table for the two most common modules found in maker kits.
| Module IC | Type | Supply Range (VCC) | Output Type | Quiescent Output |
|---|---|---|---|---|
| A3144 | Digital Switch | 4.5V to 24V | Open-Drain (Needs Pull-up) | High (VCC) / Low (GND) |
| SS49E | Linear Analog | 2.7V to 6.5V | Analog Voltage | VCC / 2 (Ratiometric) |
| DRV5055 | Linear Analog | 2.5V to 5.5V | Analog Voltage | VCC / 2 (Ratiometric) |
Raw-to-Unit Math: Converting ADC Readings to Gauss
When interfacing a linear hall effect sensor module with a microcontroller, the ADC gives you a raw integer. To make this useful, you must convert it to Gauss (or Tesla, where 1 Tesla = 10,000 Gauss). The SS49E is a ratiometric sensor. This means its output voltage scales proportionally with its supply voltage.
At exactly 0 Gauss (no magnetic field), the output sits at exactly half of VCC. If you power it with 5.0V, the zero-point is 2.5V. If you power it with 3.3V, the zero-point is 1.65V. The sensitivity of the SS49E is nominally 1.4 mV/Gauss at a 5.0V supply. Because it is ratiometric, at a 3.3V supply, the sensitivity scales down to: 1.4 * (3.3 / 5.0) = 0.924 mV/Gauss.
Here is the exact math and C++ code for an ESP32 (12-bit ADC, 3.3V reference) reading an SS49E powered at 3.3V:
// Pin definitions
const int HALL_PIN = 34; // ADC1_CH6 on ESP32
const float VCC = 3.3;
const float ADC_RESOLUTION = 4095.0;
const float SENSITIVITY_3V3 = 0.000924; // 0.924 mV/Gauss converted to Volts
void setup() {
Serial.begin(115200);
analogReadResolution(12); // Ensure 12-bit resolution on ESP32
}
void loop() {
int rawADC = analogRead(HALL_PIN);
// Convert raw ADC to Voltage
float vOut = (rawADC / ADC_RESOLUTION) * VCC;
// Calculate Gauss (Subtract the VCC/2 zero-point offset)
float gauss = (vOut - (VCC / 2.0)) / SENSITIVITY_3V3;
// Convert to microTesla (1 Gauss = 100 microTesla)
float uT = gauss * 100.0;
Serial.print('Raw: '); Serial.print(rawADC);
Serial.print(' | Voltage: '); Serial.print(vOut, 3);
Serial.print('V | Field: '); Serial.print(gauss, 1);
Serial.println(' Gauss');
delay(100);
}
Troubleshooting Magnetic Interference and Noise
Hall effect sensors are incredibly sensitive to their environment. If your serial monitor is spitting out noisy data or drifting baselines, you are likely falling victim to one of these three interference sources:
- Ferrous Metal Proximity: The steel screws holding your breadboard to a wooden desk, or the nickel plating on cheap jumper wires, will bend ambient magnetic fields (including the Earth's magnetic field) directly into the sensor die. Keep the sensor at least 2 inches away from structural steel.
- PWM Motor Noise: If you are using this sensor to measure current near a DC motor driver, the high-frequency PWM switching and brush arcing generate massive electromagnetic interference (EMI). This induces micro-voltages in the sensor's internal op-amp. The fix: Solder a 100nF (0.1µF) X7R ceramic bypass capacitor directly across the VCC and GND pins of the sensor module, keeping the leads under 5mm long.
- Temperature Drift: The sensitivity of the semiconductor changes with temperature. The SS49E has a temperature coefficient of roughly -0.03% per °C. If your sensor is mounted near a voltage regulator dissipating heat, your zero-point will drift. For high-precision applications, look into the Texas Instruments DRV505x series, which features active temperature compensation circuitry built into the silicon.
Hall Effect Sensor Module FAQ
Why is my hall effect sensor module reading fluctuating wildly on the ESP32?
Wild fluctuations (±20 Gauss or more at rest) are almost always caused by breadboard contact resistance or a missing bypass capacitor. Breadboard contacts can introduce milliohm-level resistance variations that slightly modulate the supply voltage reaching the sensor. Because the sensor is ratiometric, any VCC ripple translates directly to output voltage ripple. Solder a 100nF ceramic capacitor across the VCC and GND pins on the module itself, and use twisted-pair wires for the analog signal and ground return to reject common-mode noise.
Can a linear hall effect sensor module measure AC mains current?
Yes, but not by simply taping it to a wire. To measure AC current, you must pass the current-carrying wire through a high-permeability toroidal magnetic core (like ferrite or silicon steel) with a small air gap. The hall effect sensor module is placed precisely in that air gap. The core concentrates the magnetic flux generated by the AC current. However, for 50/60Hz mains current measurement, it is vastly superior to use a dedicated hall-effect current monitor IC like the ACS712 or ACS724, which include the toroid, the sensor, and the amplification in a single isolated package.
What is the practical difference between a hall effect sensor and a reed switch?
A reed switch is a mechanical device consisting of two ferromagnetic metal reeds sealed in a glass tube. When a magnet approaches, the reeds physically pull together to close the circuit. A hall effect sensor is entirely solid-state with no moving parts. The reed switch draws zero current when open, but suffers from mechanical 'contact bounce' (creating multiple rapid on/off signals) and has a limited lifespan of roughly 10^6 cycles. The hall effect sensor has infinite mechanical lifespan, zero contact bounce, and can output analog proximity data, but it requires a constant power supply and draws a quiescent current of 2mA to 5mA even when idle.






