When current flows through a conductor, it generates a proportional magnetic field. A hall effect current sensor exploits the Lorentz force: as electrons move through a semiconductor inside the sensor, the external magnetic field deflects them, creating a measurable transverse voltage (the Hall voltage). This allows you to measure AC or DC current without breaking the circuit or inserting a shunt resistor in the current path, preserving the original circuit's impedance.

The primary advantage of this topology is galvanic isolation. The high-current path (IP+ to IP-) is physically and electrically separated from the low-voltage signal pins. This makes hall effect sensors ideal for measuring mains AC loads, battery bank discharge rates, or motor phase currents safely, provided the sensor's isolation rating (typically 2.1 kV RMS for standard ICs) is respected. For a deep dive into the underlying physics, All About Circuits provides an excellent breakdown of Hall effect magnetic field measurement.

Output Signal Types and Raw-to-Amps Math

Hall effect current sensors generally output either a ratiometric analog voltage or a digital signal (PWM/I2C/SPI). While digital sensors like the MLX91220 exist, the vast majority of hobbyist and industrial breakout boards use ratiometric analog outputs, such as the ubiquitous ACS712 or the newer, more precise Allegro ACS724. We will focus exclusively on analog interfacing here, as conflating the two leads to immediate hardware damage or garbage data.

A ratiometric analog sensor outputs a voltage centered at half the supply voltage (VCC/2) when current is zero. As current flows, the voltage scales linearly based on the sensor's sensitivity (mV/A). To convert the raw Analog-to-Digital Converter (ADC) reading into physical Amperes, you must apply the following math:

The Raw-to-Amps Formula:
Voltage = (ADC_Reading / ADC_Max_Resolution) * VCC
Current (Amps) = (Voltage - V_Offset) / Sensitivity
Where V_Offset = VCC / 2

Worked Example 1: Arduino Uno with ACS712-20A (5V Logic)
The ACS712-20A has a sensitivity of 100 mV/A (0.1 V/A). The Arduino Uno uses a 10-bit ADC (resolution 1024) and operates at 5V.
If the ADC reads 614:
1. Voltage = (614 / 1024) * 5.0 = 3.00V
2. V_Offset = 5.0 / 2 = 2.5V
3. Current = (3.00 - 2.5) / 0.1 = 5.0 Amps

Worked Example 2: ESP32 with ACS724-10AB (3.3V Logic)
The ESP32 features a 12-bit ADC (resolution 4096) and operates at 3.3V. The ACS724-10AB has a sensitivity of 132 mV/A (0.132 V/A) when powered at 3.3V.
If the ADC reads 2662:
1. Voltage = (2662 / 4096) * 3.3 = 2.14V
2. V_Offset = 3.3 / 2 = 1.65V
3. Current = (2.14 - 1.65) / 0.132 = 3.71 Amps

⚠️ ESP32 ADC Clipping Warning: Never power a 5V ACS712 sensor and feed its output directly to a 3.3V ESP32 GPIO. At high currents, the 5V sensor will output up to 4.5V, which will physically damage the ESP32 pin. Furthermore, the ESP32's ADC is notoriously non-linear near 0V and 3.3V. Always use a 3.3V-native sensor like the ACS724-10AB, or use a precision voltage divider, and consult the Espressif ADC Oneshot documentation for calibration routines.

Wiring Pinout and Installation Steps

Proper wiring is critical. The high-current terminals (IP+ and IP-) require thick gauge wire and secure mechanical connections to prevent resistive heating. The low-voltage signal pins must be kept physically separated from the AC mains or high-current paths to prevent capacitive coupling and magnetic interference.

Pin Function Supply Range Notes
IP+ / IP- Current Path N/A (Load dependent) Use minimum 12 AWG for >10A loads. Torque terminal screws firmly.
VCC Logic Power 4.5V - 5.5V (ACS712)
3.0V - 3.6V (ACS724)
Must match your microcontroller logic level.
GND Logic Ground 0V Connect to MCU GND. Do not connect to mains earth.
OUT Analog Signal 0V to VCC Route to ADC pin. Add 0.1µF bypass cap to GND at the MCU pin.

Installation Sequence

  1. De-energize the Circuit: If measuring mains AC, turn off the breaker and verify dead with a CAT III/IV multimeter. Lockout/tagout if in an industrial setting.
  2. Wire the Load Path: Break the hot/live wire of your load. Connect the incoming source to IP+ and the outgoing load wire to IP-. (For DC, observe polarity; for AC, polarity dictates the phase of the output waveform).
  3. Wire the Logic Side: Connect VCC and GND to your microcontroller's respective power rails. Connect OUT to an available ADC pin (e.g., A0 on Uno, GPIO34 on ESP32).
  4. Add Bypass Capacitance: Solder a 100nF (0.1µF) ceramic capacitor directly between the OUT pin and GND as close to the microcontroller pin as possible to filter high-frequency RF noise.
  5. Power and Verify: Power the microcontroller first, then the load. Read the raw ADC values with no load attached to establish your baseline zero-current offset.

Calibration, Scaling, and Interference Sources

Hall effect sensors are highly susceptible to environmental interference. Because they measure magnetic fields, any external magnetic source will skew your readings. The most common interference sources include nearby transformers, unshielded AC motors, and parallel high-current busbars. Even the Earth's magnetic field can introduce a minor offset (typically <10mA equivalent) in highly sensitive sensors.

Calibration Procedure:
Never hardcode the VCC/2 offset in your software. Component tolerances and MCU voltage regulator ripple mean your actual zero-point might be 2.48V instead of 2.50V. Instead, implement a software calibration routine at boot:

  1. Ensure the load path is completely de-energized (0 Amps flowing).
  2. Take 1,000 rapid ADC samples and average them to eliminate thermal noise and 50/60Hz mains hum.
  3. Store this averaged value as your zero_offset variable.
  4. Subtract this dynamic offset from all subsequent live readings before applying the sensitivity multiplier.
Pro-Tip: Twisted Pair Routing
When routing the analog OUT wire from the sensor breakout to the microcontroller, twist it tightly with the GND wire. This twisted-pair geometry ensures that any external magnetic interference induces equal and opposite voltages in the signal and ground loops, effectively canceling out the noise before it reaches the ADC.

Frequently Asked Questions

Can a hall effect current sensor measure both AC and DC current?

Yes, unlike current transformers (CTs) which only measure AC via electromagnetic induction, hall effect sensors measure the static magnetic field generated by DC current and the alternating magnetic field of AC current. When measuring AC, the sensor outputs a sine wave centered around the VCC/2 offset voltage. To calculate AC RMS current in software, you must sample at a high frequency (at least 10x the AC frequency, e.g., 1kHz for 50Hz mains), subtract the DC offset, square the results, calculate the mean over one full waveform cycle, and take the square root (the True RMS method).

Why is my hall effect current sensor reading noisy or drifting?

Noise and drift usually stem from three culprits: thermal drift, power supply ripple, or magnetic interference. Hall sensor ICs have internal temperature compensation, but cheap breakout boards often lack adequate copper pour for heat dissipation, causing the IC to heat up and drift. Power supply ripple on the VCC line directly modulates the ratiometric output; always use a clean, regulated power supply and a 100nF bypass capacitor. Finally, ensure the sensor is mounted at least 2 inches away from any transformers or unshielded inductors.

What is the difference between high-side and low-side current sensing with hall sensors?

Because hall effect sensors provide galvanic isolation, the concepts of 'high-side' and 'low-side' sensing are largely irrelevant compared to shunt resistors. You can place the IP+/IP- terminals anywhere in the load path—on the high-voltage mains side, the low-voltage DC positive rail, or the ground return path—without shifting the microcontroller's ground reference. However, for safety and fault-detection purposes, it is standard practice to place the sensor on the ungrounded (hot/positive) conductor so you can detect short-to-ground faults that a low-side sensor would miss.

Do I need a burden resistor for a hall effect current sensor?

No. Burden resistors are strictly required for Current Transformers (CTs) to prevent the secondary winding from generating dangerously high voltages when open-circuited, and to convert the induced current into a measurable voltage. Hall effect sensors are active semiconductor devices that output a voltage directly based on the Hall plate's deflection. They do not require a burden resistor, and adding one in series with the analog output pin will simply form an unintended low-pass filter with the MCU's ADC sampling capacitor, causing reading errors.