In this guide
Current Sensing for Student Projects: Shunt Resistors vs Hall Sensors
Most student builds measure voltage and temperature without thinking twice, then hit a wall the moment they need to know how much current a motor, a heater, or a battery charger is actually drawing. Current is the number that tells you whether a motor is stalled, a battery is charging at a sane rate, or a power supply is about to be overloaded. Measuring it well is a small skill that prevents burnt drivers, tripped supplies, and mysterious resets.
This guide covers the two methods students actually use: a low-value shunt resistor read as a small voltage drop, and a Hall-effect sensor that watches the magnetic field around a conductor. It explains how each one works, how to size and wire it, how to read it with a microcontroller, and which one to pick for a given build.
Why current, and why it is not just another voltage reading
Current cannot be read by touching one probe to one point. A voltmeter measures the difference between two points; an ammeter has to sit in the path of the current, or sense the field that current creates. That is why beginners either skip current measurement entirely or wire an ammeter in parallel and blow a fuse. The two methods in this guide both avoid that trap, but in different ways.
A shunt resistor sits in series with the load. The current flowing through it creates a small voltage drop, and Ohm's law turns that drop back into current: current equals voltage divided by resistance. A Hall sensor never touches the current path electrically. It measures the magnetic field produced by the current and converts it into a voltage, which keeps the sensing circuit isolated from the power circuit.
Three questions decide almost every choice between them: how much current, how much voltage can you afford to lose, and whether the sensing side must stay electrically separate from the power side.
How a shunt resistor measurement works
Pick a resistor value so small that it barely disturbs the circuit, typically milliohms to a few tenths of an ohm. The voltage across it is tiny — tens of millivolts at full load — so it usually needs amplification before a microcontroller ADC can read it usefully.
Step 1: Choose the shunt value from your maximum current
Start from the largest current you expect, not the typical one. A motor that draws 2 A while running can draw 8 A or more at stall, and a shunt sized only for running current will saturate your amplifier at exactly the moment you most want a reading.
Work through the numbers for a 5 A load. A 0.01 ohm shunt gives 50 mV at 5 A, and dissipates 0.25 W (power equals current squared times resistance). A 0.1 ohm shunt gives 500 mV at 5 A, which is easy to read, but dissipates 2.5 W and drops half a volt from the load supply. That trade-off — easy reading versus lost voltage and heat — is the whole shunt design problem in one example.
A good student rule: aim for 50 to 100 mV of drop at full load. That keeps the loss small while leaving a signal large enough to amplify cleanly.
Step 2: Check the power rating, then double it
Resistor power ratings assume the part can shed heat into the board and the air around it. A shunt running near its rating on a small board in a closed enclosure will drift, because resistance changes with temperature. Pick a rating at least twice your calculated dissipation, and give the part copper area and airflow where you can. If the calculated dissipation is above about 1 W, reconsider: a smaller shunt with more gain, or a Hall sensor, is usually the better answer.
Step 3: Amplify with a dedicated current-sense amplifier or an op-amp
A microcontroller ADC with a 5 V reference and 10-bit resolution resolves about 5 mV per step. A 50 mV shunt signal therefore gives only about 10 steps across the whole range — useless for anything but a rough guess. A current-sense amplifier with a fixed gain of 50 turns 50 mV into 2.5 V, which the same ADC reads in about 500 steps.
Dedicated current-sense amplifiers (for example, the INA219 family of parts, which combine amplifier and ADC on one chip) are the easiest path: they handle the small differential signal, reject the common-mode voltage of the supply rail, and report over I2C. A general-purpose op-amp in a differential configuration can do the same job, but it needs matched resistors and careful layout to reject the supply voltage that both shunt terminals share.
Step 4: Wire it in the right place — high-side or low-side
A low-side shunt sits between the load and ground. It is simple to read, because one end is near ground, but it lifts the load's ground slightly above true ground. That matters when the load also talks to the microcontroller over a shared ground: sensor readings shift, and communication can glitch.
A high-side shunt sits between the supply and the load. The load ground stays clean, but both shunt terminals sit near the supply voltage, so the amplifier must tolerate that common-mode voltage. Dedicated high-side current-sense amplifiers are built for exactly this. For a student build with a motor driver and a microcontroller sharing signals, high-side sensing is usually worth the slightly more expensive part.
Step 5: Read, average, and convert
Raw ADC readings of current are noisy, especially on a switching motor driver. Read the sensor several times, average, and only then convert to amps. A short Python-style sketch of the conversion logic:
# adc_value: averaged reading, adc_max: full-scale counts
# vref: ADC reference voltage, gain: amplifier gain, r_shunt: ohms
voltage = (adc_value / adc_max) * vref
shunt_voltage = voltage / gain
current = shunt_voltage / r_shunt
Calibrate against a known load before trusting the numbers: a resistor load or a bench supply with a current readout gives you a reference point, and a single gain correction factor fixes most small errors from resistor tolerance and amplifier offset.
How a Hall-effect sensor measurement works
A current-carrying conductor creates a magnetic field around itself. A Hall sensor is a small piece of semiconductor that produces a voltage proportional to that field when a current is passed through it. In a packaged current sensor, the conductor is routed past or through the sensor chip, the field is measured, and the chip outputs a voltage centred on half its supply: no current gives mid-rail, current in one direction pushes the output up, current in the other direction pushes it down.
That centre-at-mid-rail behaviour is the first thing to check when a Hall reading looks wrong. A sensor powered from 5 V with no current should sit near 2.5 V. If your code treats 0 V as zero current, every reading will be wrong by half the range.
The two Hall packages students meet
Closed-loop and open-loop sound complicated, but the student-relevant difference is simpler. Module-style sensors (the ACS712 family and its successors) put a copper path inside the chip package: you wire the load current through the module's terminals and read an analogue voltage out. They are easy to use, handle tens of amps, and are isolated, since the current path and the signal path are electrically separate inside the package.
Split-core or clamp-style sensors wrap around a wire without breaking the circuit. They are convenient for measuring an existing wire, but they are bulkier, costlier, and their accuracy depends on the wire sitting correctly in the core. For a student bench build, a module-style sensor is almost always the right starting point.
Sizing a Hall sensor
Hall sensors are sold by full-scale range: 5 A, 20 A, 30 A, and so on. Sensitivity falls as the range rises — a 30 A sensor resolves a 100 mA load far worse than a 5 A sensor does. Pick the smallest range that still covers your stall or fault current with margin, not the largest you can find. A sensor that saturates during a stall tells you nothing at the moment you most need a number; a sensor with ten times your range tells you everything with ten times the noise.
Watch the bandwidth too. A Hall sensor with a 20 kHz bandwidth can follow a PWM motor current's average reasonably, but it will not faithfully show the sharp edges of each switching pulse. For stall detection, average current, and battery charging, that is fine. For studying switching waveforms, use an oscilloscope probe instead.
Shunt vs Hall: the honest comparison
| Question | Shunt resistor | Hall-effect sensor |
|---|---|---|
| Cost | Very low; resistor plus amplifier | Higher; module or IC plus wiring |
| Accuracy at low current | Excellent with a good amplifier | Weaker; offset and noise dominate small signals |
| Voltage loss in the circuit | Small but real; heat to manage | Practically none in the signal path |
| Electrical isolation | None; shares ground or supply | Yes; sensing side is isolated |
| High-current handling | Heat-limited; large currents need large parts | Easy; modules handle tens of amps |
| Bidirectional current | Yes, with a bipolar amplifier supply or offset | Yes, naturally; output swings around mid-rail |
| Best student use | Battery charging, small motor loads, precise bench measurement | Mains-adjacent or high-current loads, stall detection, isolated sensing |
Neither method is better in general. A shunt wins when you need precision at modest current and can afford a small voltage drop. A Hall sensor wins when isolation matters, current is large, or you cannot afford to disturb the circuit.
Practical builds: three recipes
Recipe 1: Motor stall detection with a Hall module
Wire the module in series with the motor supply, read its analogue output, and compare a short rolling average against a threshold set above the normal running current. When the average crosses the threshold for a few hundred milliseconds, cut the drive and flag the stall. The delay matters: motors draw a brief surge at start-up, and a detector that trips on that surge will never let the motor start. Average over time, and require the over-current to persist before acting.
Recipe 2: Battery charge monitoring with a high-side shunt
For a charging circuit, precision matters more than isolation: you want to know whether the charger is delivering 0.5 A or 1 A. A high-side shunt with a dedicated current-sense amplifier gives a clean reading without disturbing the battery ground, and the same reading doubles as a charge-termination signal when the current tapers near full charge.
Recipe 3: A bench current meter from a low-side shunt
For a test rig that only measures one low-voltage circuit, a low-side shunt with an op-amp and a small display is a cheap, accurate meter. Keep the measured circuit and the meter ground shared deliberately, keep the shunt leads short and twisted, and calibrate with a known resistor load before use.
Five mistakes that ruin current readings
- Measuring a shunt with a single-ended ADC input. Both shunt terminals carry the supply voltage on a high-side circuit. A single-ended reading measures one terminal against ground, not the difference across the shunt. Use a differential amplifier or a dedicated current-sense part.
- Forgetting the mid-rail zero of a Hall sensor. Zero current is half the supply, not zero volts. Subtract the measured no-current offset in code, and measure that offset at start-up rather than assuming exactly half.
- Sizing for running current instead of stall current. The interesting events — stalls, shorts, start-up surges — are the large ones. Size the range for them, and accept coarser resolution at small currents.
- Long, looping sense wires on a shunt. The millivolt signal picks up noise from nearby switching circuits. Keep sense wires short, twisted together, and routed away from motor and switching-regulator wiring. Kelvin connections — separate sense taps right at the resistor body, not at the power terminals — matter once the shunt value drops below about 0.05 ohm.
- Trusting the first reading. Current readings need averaging, a known-load calibration check, and a sanity check against a meter. A sensor that has never been compared against a trusted reference is a guess, not a measurement.
FAQ
Can I measure AC mains current with these methods?
Only with proper isolation and only if you understand the safety rules for mains work. A Hall module or a clamp sensor provides isolation, but mains wiring itself is dangerous and must be treated as such: use enclosed, rated hardware, never breadboard mains, and get the circuit checked by someone qualified before powering it. For most student builds, measure the low-voltage DC side instead.
Why does my Hall reading drift when the sensor warms up?
Hall sensors have a temperature-dependent offset. The drift is small relative to a large signal and large relative to a small one, which is why Hall sensors suit large currents better. Re-measuring the no-current offset periodically, or measuring it at start-up when the sensor is cool, removes most of the error.
My shunt reading jumps around with the motor PWM. What is wrong?
Nothing is wrong with the sensor; you are seeing the real PWM current waveform. Average over many PWM cycles — at least ten, preferably more — before converting to amps, or add a small RC filter on the amplifier output. If you need the waveform itself, use an oscilloscope.
Is a multimeter's current range a substitute?
For a one-off check, yes, and it is the right calibration reference. For a running build, no: a multimeter in series adds its own burden voltage, its fuse limits the range, and it cannot feed a reading back to a microcontroller for stall protection or logging.
Limitations
Current sensing tells you how much current flows, not why. A rising current can mean a heavier mechanical load, a failing bearing, a shorted winding, or a supply problem, and the sensor cannot distinguish them. Treat a current reading as one input to a diagnosis, alongside voltage, temperature, and what the mechanism is doing.
Accuracy claims in this guide are design guidance, not guarantees for any particular part: real shunt tolerance, amplifier offset, and Hall sensitivity vary by part and batch. The calibration step in each recipe exists because of that variation, not in spite of it.
Quick decision checklist
- Under 5 A, precision matters, low-voltage circuit: shunt with a current-sense amplifier.
- Over 10 A, or isolation required, or stall detection on a large motor: Hall module.
- Measuring on a shared-ground bench rig: low-side shunt is acceptable; elsewhere, prefer high-side.
- Whatever you choose: size for the largest current, average the readings, and calibrate against a known load before trusting the numbers.