Normalize an ACS724 Reading, Then Measure What Still Changes
A Hall-effect current sensor turns the magnetic field around its internal conductor into a voltage. Change its supply while the same direct current (DC) passes through that conductor: both the zero-current output and the volts-per-ampere scale can move. Dividing output voltage by supply voltage helps, but it does not establish a perfectly constant current scale.
Use an Allegro ACS724LLCTR-05AB-S, the bidirectional ±5 ampere variant in the eight-pin small-outline integrated circuit (SOIC8) package. An integrated circuit (IC) contains the sensing electronics in one component. Here it sits on an inspected passive printed circuit board (PCB), with accessible numbered pads and no regulator or amplifier added. This is a low-voltage measurement exercise, with no microcontroller or firmware.
Verification: the supplied Python analyzer has host behavior tests and clearly constructed example readings. The circuit, voltages and plots are an authored design and calculations. No hardware measurements, sensor calibration, target execution or built instrument performance is claimed.
Separate the current from the sensor’s supply
Ratiometric means a quantity changes in relation to a supply or reference. For this experiment, VCC is the sensor’s positive supply measured relative to its signal return, G0. VIOUT is its current-dependent voltage output. A digital multimeter (DMM) measures each voltage; three separate battery-powered meters keep the primary current loop separate from G0. The diagram calls the primary power supply PS I and the sensor supply PS S. CH1 and CH2 mean channel 1 and channel 2 of the bench supply named below. VΩ marks a meter’s voltage/resistance input, and COM its common return socket. VOUT in the worksheet and equations is the measured VIOUT voltage at pin 7.
The reference quantity is current through the sensor; the deliberately changed variable is VCC. A reference resistor, also called a shunt, turns that current into a measured voltage drop. Its known resistance and that voltage establish the reference current. A supply’s programmed current limit only restricts a fault; it does not tell us the actual current. Leave the physical load and sensor position fixed while changing only the sensor supply.
This differs from moving an INA180 current shunt: that experiment changes load-return voltage. Here the reference shunt stays in place and the Hall sensor has its own independently varied supply. A supply-powered divider on an UNO illustrates ratio cancellation; this lesson measures a sensor whose normalized gain need not be flat.

Build one fixed, low-current fixture
- Use the exact ACS724LLCTR-05AB-S on a soldered passive board. Check the package’s pin-1 mark and pad continuity before applying power. Join both pins 1 and 2 to J+, and both pins 3 and 4 to IP_OUT. These are duplicated current terminals; do not leave a lead carrying the experiment’s current through a thin signal jumper or an unidentified module trace.
- Connect IP_OUT through a Vishay AC10 axial 10 Ω, ±5%, 10 W load, then through a Vishay PR03 Cu-lead axial 1 Ω, ±1%, 3 W reference, to J−. Use the actual independently determined reference resistance in the analysis. Ω, the ohm, is the unit of resistance; A, the ampere, is the unit of current.
- Feed pin 8, VCC, from a separate adjustable DC source. Pin 5 is G0. Fit a 100 nF ceramic capacitor, rated at least 25 V, directly between pins 8 and 5. A nanofarad (nF) is one billionth of a farad; this local bypass capacitor supplies short disturbances at the chip.
- Connect 4.7 nF C0G ceramic, rated at least 25 V, between FILTER pin 6 and G0. C0G names a stable ceramic dielectric. Keep this filter unchanged. Pin 6 is an analog filter connection, not the ACS723’s bandwidth-select input. Add no output capacitor for this fixture.
- Connect pin 7, VIOUT, to meter O’s VΩ input; its COM return goes to G0. Meter S measures pin 8 against G0. Use Fluke 87V MAX, normal-resolution 6.000 V DC range for both. Meter I uses the 600.0 mV DC range, red VΩ lead at SH+ and black COM at SH−. A millivolt (mV) is one thousandth of a volt. Keep every lead out of the current-input sockets.
Use a SIGLENT SPD3303X, channel 1 (CH1) for PS S and channel 2 (CH2) for PS I, in independent mode with series and parallel tracking off. Its primary quick-start guide documents independent CH1/CH2 operation insulated from ground; its product documentation identifies three isolated outputs. Leave CH3 unused, remove any straps to the green ground terminal, and leave communication cables disconnected. “Floating” here means the output has no intentional connection to protective earth or the other circuit’s return. Limit the primary source to less than 6 V and 0.55 A; set the sensor source’s current-limit setting to 25 milliamperes (mA), where a milliampere is one thousandth of an ampere. These are source settings, not calibrated current measurements; keep checking the actual rail and shunt voltage. Do not attach an oscilloscope ground, computer communication lead or other return that joins the loops. This arrangement makes no claim about a board’s certified isolation, and uses no mains voltage.
If a source unexpectedly enters current limiting, the sensor becomes warm, or readings are unstable or near a rail, stop. Turn both outputs off and inspect the pin mapping, current path, supply polarity and meter sockets before continuing. The analyzer cannot observe a warning on the supply before you capture data.
Positive current enters J+, then pins 1/2, and leaves pins 3/4. To obtain negative current, turn the primary source OFF, swap its two cables at J+/J−, then turn it on and recheck the magnitude. The reference meter then reads a negative voltage with its leads unmoved. Turn both sources off before changing component connections.
Know the reference resistance and its limits
A Kelvin connection uses separate voltage-sense wires at the reference resistor’s marked terminals, inside the connections carrying load current. Measure resistance at those same marks. With the resistor disconnected from both sources and all three handheld meters, use a warmed-up Keysight 34461A in four-wire resistance, 100 Ω range. Keep its current and sense pairs separate until they reach the marked terminals. Reverse both pairs together and average the two orientations to reduce a steady thermoelectric offset. Remove all bench-meter leads before energizing the fixture.
Do not assign a tiny resistance uncertainty merely because the display has many digits. The 34461A’s one-year 100 Ω-range term is ±(0.010% of reading + 0.004% of range). At 1.000 Ω, that is ±0.0041 Ω, before local temperature, reconnection and thermal-offset effects. Follow the specified calibration/temperature and 90-minute warm-up conditions; use 10 power-line cycles of integration, which average over ten periods of the local mains frequency. This is an integration setting, not a connection to mains. The 34461A does not have the 34465A/70A offset-compensation feature.
The PR03’s specified temperature coefficient is ±250 parts per million per kelvin: a 30 K change can contribute 0.75%, or 0.0075 Ω at 1 Ω. The worked analysis reserves 0.015 Ω total: 0.0041 Ω for the meter term, 0.0075 Ω as a declared thermal budget and 0.0034 Ω for reconnection/recheck effects. This is a chosen engineering allowance, not a certified uncertainty. Check that repeated reversed-pair readings and cold/warm rechecks fit it; if the temperature history or recheck cannot support that budget, increase the bound or stop. A two-wire handheld reading rounded to 0.1 Ω is not an adequate replacement.
At 0.5 A, the nominal load dissipates I²R = 2.5 W, and the shunt dissipates 0.25 W. The sensor’s typical 1.2 milliohm (mΩ) conductor, where one milliohm is one thousandth of an ohm, contributes about 0.3 mW. The load can warm nearby parts despite its power rating: mount it away from the reference and sensor. Warm the same load for several minutes before taking formal readings, keep the on/off timing consistent, and repeat the resistance check after the sequence. Rating margin is not proof of unchanged resistance.
Capture zero, both directions and restoration
Use four phases: base 5.00 V, low 4.60 V, high 5.40 V, restore 5.00 V, measured at the chip. These setpoints leave margin inside the specified 4.5–5.5 V supply range. The analyzer also requires the rail plus its meter allowance to remain inside that range. No 6 V absolute-maximum value is used as an operating setpoint.
- At each phase, switch the primary source off. After settling, record three
zero_beforerows, including the actual reference voltage rather than typing an assumed zero. Read supply and output on their separate meters. - Set positive current near 0.500 A using the measured shunt drop and known resistance. Wait until all readings settle, then record three
positiverows. Keep the same reading order and wait at least five seconds between complete sets; this spacing is a procedure choice, not a statistical independence guarantee. - Turn the primary output off, reverse its cables, and repeat for
negative. Adjust only enough to match the earlier measured magnitude. Do not assume the positive and negative currents are exactly symmetric. - Turn the primary output off again and record three
zero_afterrows. Continue to the next sensor-supply phase with the same filter, orientation, meters and geometry. The final 5.00 V phase repeats the entire sequence, not just one zero reading.
The blank worksheet has 48 rows. CSV means comma-separated values, a plain text table. Keep its exact header and the supplied phase/state/repeat labels. Fill each row with the actual VCC, VOUT and signed shunt voltage in volts. Its kind=measured label is a declaration by the person recording data; the program cannot establish physical provenance. The separate constructed example is labelled constructed throughout.
The selected screening limits require each nonzero current to be between 0.48 and 0.52 A, and each phase’s positive and negative means to match the corresponding baseline within 5 mA. Source-off current, including its allowance, must stay within 2 mA. A changed current is a failed comparison to fix and recapture, not evidence of sensor supply dependence.
Fit two transfers using the measured current
Ordinary least squares (OLS) fits a straight line by minimizing the sum of squared vertical residuals, the differences between readings and that line. For each phase, the program fits all twelve points, including both zero controls:
VOUT = a + bI
VOUT/VCC = q + kI
The fitted intercepts a and q describe the local zero; b is raw sensitivity in V/A, and k is output-ratio change per ampere, written 1/A. The actual signed current comes from VSHUNT/RREF. The displayed current includes a tiny nominal parallel-meter correction. With approximately 10 megohms (MΩ) of input resistance, meaning ten million ohms, a 0.5 V reference drop draws only about 50 nanoamperes (nA) through the meter, compared with 0.5 A in the shunt. The sensor-output meter draws about 0.3 microamperes (µA), or millionths of an ampere, at 3 V, far lighter than the sensor’s specified 4.7 kΩ minimum resistive load.
The Fluke manual calls 10 MΩ nominal, not a calibrated exact resistance. For interval calculations, the code brackets zero-to-nominal input conductance and adds a separately chosen ±1 µA loading-model allowance. This is an engineering assumption, not a manufacturer-certified lower input-resistance limit. It is small beside the entered resistance and voltage allowances; expand the model if an additional load is connected.
| VCC | b, V/A | k, 1/A |
|---|---|---|
| 4.60 V | 0.3584 | 0.077913 |
| 5.00 V | 0.4000 | 0.080000 |
| 5.40 V | 0.4416 | 0.081778 |
Allegro’s current datasheet gives a typical sensitivity ratiometry coefficient of 1.3 and defines b(VCC) = b(5 V) × [1 + 1.3 × (VCC − 5 V)/5 V]. Its typical zero coefficient is 1. These are a model to compare with, not required results. The low-to-high endpoint change is bHIGH/bLOW − 1: 23.2143% raw and 4.9603% normalized for this model. The different 20.8% raw span uses the 5 V slope as denominator and is not the program’s endpoint metric.
Keep unresolved results visible
On the normal 6.000 V range, retain ±(0.05% of reading + 1 mV); on 600.0 mV, retain ±(0.1% + 0.1 mV). These specifications apply under the manual’s calibration and 18–28°C conditions. More displayed digits or repeated samples do not remove those systematic terms. In particular, selecting high-resolution mode does not automatically improve absolute accuracy.
The fit describes the observations. Separately, the program makes conservative positive-to-negative secant intervals: a secant slope is the output difference divided by the actual current difference between those two groups. It retains each group’s repeat spread, meter limits, entered reference-resistance bound and chosen loading allowance. These bounds are not an OLS confidence interval and give no probability of coverage. A single stable reference scale partly cancels in a slope ratio; the code deliberately keeps full independent resistance bounds instead of assuming that warming and drift cancel.
normalization_reduction_resolved is true only when the upper normalized relative-change bound lies below the lower raw-change bound. nonzero_normalized_change_resolved separately asks whether the normalized interval excludes zero change. False can mean unresolved, not that normalization failed or the true residual is zero. With the worked 0.015 Ω allowance, the constructed example resolves the reduction but does not resolve a nonzero residual. Better reference evidence may narrow the intervals; changing a number only to make a result pass does not.
The program stops on incomplete data, ambiguous or duplicate headers, nonfinite readings, wrong current direction, near-rail output, mismatched currents or excessive drift. It also rejects more than 12 mV of within-phase supply movement, before/after zero movement above 12 mV, raw fit residuals above 12 mV, or restoration changes above 0.0024 in normalized zero and 2.5% in normalized slope. These are chosen experiment screens, not new sensor specifications. Fix the cause, settle the fixture and recapture the full affected sequence.
Run the complete analyzer
Use Python 3 with its standard library; no packages or firmware are required. Download the complete experiment and tests ZIP, or save the entire program below as hall_ratio.py. Keep the worksheet and reference evidence together.
python3 hall_ratio.py constructed-readings.csv --shunt-ohm 1.0 --shunt-error-ohm 0.015 python3 -m unittest -v test_hall_ratio
For physical records, replace the filename and both reference arguments with your supported values. A successful exit code 0 means a valid report with completed controls; its resolution flags can still be false. An input/control failure exits 2, explains the problem on standard error and produces no partial success report. Input is limited to 65,536 bytes and 48 data rows, with exact, unique ordered column names.
#!/usr/bin/env python3
"""Analyze an ACS724 manual worksheet; only the declared CSV provenance is known."""
import argparse
import csv
import json
import io
import math
import statistics
import sys
PHASES = {'base':5.00, 'low':4.60, 'high':5.40, 'restore':5.00}
STATES = ('zero_before','positive','negative','zero_after')
FIELDS = ('kind','phase','state','repeat','vcc_v','vout_v','vshunt_v')
METER_OHM = 10_000_000.0 # Nominal input, not a certified minimum.
LOADING_ALLOWANCE_A = 0.000001 # Chosen engineering allowance, not a maker specification.
def finite(value, name):
try:
number = float(value)
except (TypeError, ValueError):
raise ValueError(name + ': enter a finite number') from None
if not math.isfinite(number):
raise ValueError(name + ': enter a finite number')
return number
def fit_line(points):
"""Ordinary least squares using the actual signed current, not state labels."""
xbar = statistics.mean(x for x,y in points)
ybar = statistics.mean(y for x,y in points)
denom = sum((x-xbar)**2 for x,y in points)
if denom <= 0:
raise ValueError('No current span for a fit')
slope = sum((x-xbar)*(y-ybar) for x,y in points)/denom
intercept = ybar-slope*xbar
residual = max(abs(y-intercept-slope*x) for x,y in points)
return dict(intercept=intercept, slope=slope, max_abs_residual=residual)
def envelope(rows, field, lower_field, upper_field):
"""Keep observed repeat spread AND each reading's systematic allowance."""
return (min(row[lower_field] for row in rows),
max(row[upper_field] for row in rows))
def quotient_interval(numer, denom):
if denom[0] <= 0:
raise ValueError('Uncertain current span includes zero')
values = [n/d for n in numer for d in denom]
return [min(values), max(values)]
def relative_change_bounds(low, high):
"""Bounds on |high/low - 1|; overlapping intervals include zero change."""
ratio = quotient_interval(high,low)
least = 0.0 if ratio[0] <= 1 <= ratio[1] else min(abs(ratio[0]-1),abs(ratio[1]-1))
return [least,max(abs(ratio[0]-1),abs(ratio[1]-1))]
def analyze_rows(rows, shunt_ohm, shunt_error_ohm):
resistance = finite(shunt_ohm,'reference resistance')
r_error = finite(shunt_error_ohm,'reference resistance bound')
if not 0.9 <= resistance <= 1.1 or not 0 < r_error <= 0.05*resistance:
raise ValueError('Use a known near-1 ohm reference and a positive bound no larger than 5%')
groups = {(p,s):[] for p in PHASES for s in STATES}
seen = set()
kinds = set()
for line,raw in enumerate(rows,2):
if set(raw) != set(FIELDS):
raise ValueError('CSV columns must be exactly: ' + ','.join(FIELDS))
phase,state = raw['phase'],raw['state']
if (phase,state) not in groups:
raise ValueError('line %d: unknown phase/state'%line)
repeat = str(raw['repeat']).strip()
if repeat not in ('1','2','3') or (phase,state,repeat) in seen:
raise ValueError('Each phase/state requires unique repeats 1,2,3')
seen.add((phase,state,repeat))
kind = raw['kind']
if kind not in ('constructed','measured'):
raise ValueError('kind must be constructed or measured; it is a declaration, not verification')
kinds.add(kind)
vcc = finite(raw['vcc_v'],'line %d Vcc'%line)
vout = finite(raw['vout_v'],'line %d Vout'%line)
vs = finite(raw['vshunt_v'],'line %d shunt voltage'%line)
# Normal-resolution Fluke 87V MAX DC specifications, fixed ranges.
ucc = 0.0005*abs(vcc)+0.001
uout = 0.0005*abs(vout)+0.001
us = 0.001*abs(vs)+0.0001
if not 4.5 <= vcc-ucc <= vcc+ucc <= 5.5 or abs(vcc-PHASES[phase]) > 0.03:
raise ValueError('Measured sensor supply and meter allowance must stay inside 4.5 to 5.5 V and its phase window')
if not 0.3 < vout-uout <= vout+uout < vcc-0.3:
raise ValueError('Output is too near a rail for this small-current experiment')
if abs(vs)+us >= 0.600:
raise ValueError('Shunt voltage exceeds the fixed 600.0 mV range')
# The shunt meter is in parallel with the reference resistor.
current = vs*(1/resistance+1/METER_OHM)
candidates = [(vs+e)*(1/r+g)
for e in (-us,us) for r in (resistance-r_error,resistance+r_error)
for g in (0.0,1/METER_OHM)]
ilo,ihi = min(candidates)-LOADING_ALLOWANCE_A,max(candidates)+LOADING_ALLOWANCE_A
if state.startswith('zero'):
if max(abs(ilo),abs(ihi)) > 0.002:
raise ValueError('Current-source OFF zero exceeds the 2 mA screening limit')
elif not 0.48 <= abs(current) <= 0.52 or (state=='positive') != (current>0):
raise ValueError('Use the measured signed near-0.500 A current for the named state')
groups[(phase,state)].append(dict(vcc=vcc,vout=vout,current=current,
current_lo=ilo,current_hi=ihi,raw_lo=vout-uout,raw_hi=vout+uout,
normalized=vout/vcc,norm_lo=(vout-uout)/(vcc+ucc),norm_hi=(vout+uout)/(vcc-ucc)))
if len(kinds) != 1 or any(len(g)!=3 for g in groups.values()):
raise ValueError('Supply all 48 readings with one consistent declared data kind')
output = {}
for phase in PHASES:
data = [row for state in STATES for row in groups[(phase,state)]]
if max(r['vcc'] for r in data)-min(r['vcc'] for r in data) > 0.012:
raise ValueError(phase+': supply wandered by more than 12 mV')
before,after = (groups[(phase,s)] for s in ('zero_before','zero_after'))
zero_shift = abs(statistics.mean(r['vout'] for r in before)-statistics.mean(r['vout'] for r in after))
if zero_shift > 0.012:
raise ValueError(phase+': before/after zero moved by more than 12 mV')
rawfit = fit_line([(r['current'],r['vout']) for r in data])
normfit = fit_line([(r['current'],r['normalized']) for r in data])
if rawfit['slope'] <= 0 or rawfit['max_abs_residual'] > 0.012:
raise ValueError(phase+': fit is reversed or its residual exceeds 12 mV')
pos,neg = groups[(phase,'positive')],groups[(phase,'negative')]
current_span = (min(r['current_lo'] for r in pos)-max(r['current_hi'] for r in neg),
max(r['current_hi'] for r in pos)-min(r['current_lo'] for r in neg))
intervals = {}
for label,field,lo,hi in (('raw','vout','raw_lo','raw_hi'),('normalized','normalized','norm_lo','norm_hi')):
positive,negative = envelope(pos,field,lo,hi),envelope(neg,field,lo,hi)
intervals[label] = quotient_interval((positive[0]-negative[1],positive[1]-negative[0]),current_span)
if any(b[0] <= 0 for b in intervals.values()):
raise ValueError(phase+': slope sign is unresolved')
output[phase] = dict(mean_vcc_v=statistics.mean(r['vcc'] for r in data),
mean_positive_current_a=statistics.mean(r['current'] for r in pos),
mean_negative_current_a=statistics.mean(r['current'] for r in neg),
raw_fit=rawfit, normalized_fit=normfit,
raw_secant_interval=intervals['raw'],normalized_secant_interval=intervals['normalized'],
zero_before_after_shift_v=zero_shift)
for phase in PHASES:
for state in ('positive','negative'):
value = output[phase]['mean_'+state+'_current_a']
if abs(value-output['base']['mean_'+state+'_current_a']) > 0.005:
raise ValueError(phase+': measured current differs from baseline by more than 5 mA')
base,restore = output['base'],output['restore']
if abs(base['normalized_fit']['intercept']-restore['normalized_fit']['intercept']) > 0.0024:
raise ValueError('Restored normalized zero moved by more than 0.0024')
if abs(restore['normalized_fit']['slope']/base['normalized_fit']['slope']-1) > 0.025:
raise ValueError('Restored normalized slope moved by more than 2.5%')
raw_change = relative_change_bounds(output['low']['raw_secant_interval'],output['high']['raw_secant_interval'])
norm_change = relative_change_bounds(output['low']['normalized_secant_interval'],output['high']['normalized_secant_interval'])
return dict(declared_data_kind=next(iter(kinds)),readings=48,
reference_resistance_ohm=resistance,reference_bound_ohm=r_error,
chosen_loading_model_allowance_a=LOADING_ALLOWANCE_A,
phases=output,raw_endpoint_relative_change_interval=raw_change,
normalized_endpoint_relative_change_interval=norm_change,
normalization_reduction_resolved=norm_change[1] < raw_change[0],
nonzero_normalized_change_resolved=norm_change[0] > 0,
interpretation='Fits describe these readings. Endpoint intervals retain meter limits, repeat spread, independent full reference bounds and a chosen loading-model allowance; they are not confidence intervals or calibration certificates. Overlap means unresolved, not zero change.')
def read_worksheet(path):
"""Validate the original header before DictReader can discard duplicates."""
with open(path,'rb') as source:
raw = source.read(65537)
if len(raw) > 65536:
raise ValueError('Manual worksheet exceeds 65536 bytes')
reader = csv.DictReader(io.StringIO(raw.decode('utf-8-sig'),newline=''),strict=True)
if tuple(reader.fieldnames or ()) != FIELDS:
raise ValueError('CSV header must contain each exact column once, in the documented order')
rows = []
for row in reader:
if len(rows) == 48:
raise ValueError('Manual worksheet contains more than 48 data rows')
rows.append(row)
return rows
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('csv_file')
parser.add_argument('--shunt-ohm',type=float,required=True)
parser.add_argument('--shunt-error-ohm',type=float,required=True)
args = parser.parse_args(argv)
try:
report = analyze_rows(read_worksheet(args.csv_file),args.shunt_ohm,args.shunt_error_ohm)
except (OSError,ValueError,csv.Error) as error:
print('error: '+str(error),file=sys.stderr)
return 2
print(json.dumps(report,indent=2,allow_nan=False))
return 0
if __name__ == '__main__':
raise SystemExit(main())
Challenge
Suppose a perfectly proportional sensor has b(5 V) = 0.4 V/A and coefficient 1, while its zero stays at half the supply. What raw and normalized slopes would you expect at 4.6 and 5.4 V? Would an unresolved normalized contrast prove that this ideal model describes your real device?
Show the answer
The raw slopes would be 0.368 and 0.432 V/A. Dividing each by its supply gives 0.080 1/A in both cases. An unresolved contrast does not prove this ideal model: it only says the present readings and declared allowances cannot distinguish the alternatives. A changed zero, current, temperature or reference must still pass the controls.
Primary references and further reading
- Allegro ACS724 datasheet, Rev. 25, March 31, 2026: exact -S/-T selection on page 2, pins on page 4, operating/loading conditions on page 5, 05AB characteristics on page 8 and ratiometry equations on page 23. Current manufacturer family page. The -S option uses tin/silver bump construction; -T uses lead-containing bumps. No stock or certified board-isolation claim follows from this lesson.
- Fluke 87V MAX Users Manual, Rev. 1: voltage input sockets, normal-resolution DC limits, high-resolution caveat and nominal input impedance.
- Keysight Truevolt data sheet and Operating and Service Guide: exact 34461A resistance-range terms and four-wire operation.
- SIGLENT SPD3303X Quick Start EN_02A, CH1/CH2 independent output section, and manufacturer model page: independent channels and isolated outputs.
- Vishay PR01/02/03 data sheet: reference-resistor rating, lead construction, resistance marks and temperature coefficient. Vishay AC-series data sheet: load rating and assembly conditions.