A current-sense signal on an ESP32-S3 motor carrier board is a millivolt measurement sitting on top of an ampere-scale motor return. The shunt drops maybe 50–100 mV at full current; the motor ground it references is bouncing with switching transients; and the S3 ADC that reads it shares its ground reference with the camera and mic inputs feeding the edge-AI inference. If the sense return shares impedance with the motor return, the ADC reading is corrupted — and on these boards the same ground noise also shows up as inference errors before it shows up as a power ripple spec. The fix is almost entirely geometric: place the shunt tight to the driver, route the sense lines as a Kelvin pair, keep the sense ground solid and separate from the motor return, and sample the ADC away from the PWM switching instant.
The routing rules checklist below gives you the placement and trace rules for each driver family, and the DFM checklist covers what to put on the BOM and fab notes. For the broader placement, stackup, and ground-split decisions that surround this sense path, the carrier board layout checklist covers the board-level zoning; the power integrity deep-dive handles regulator sizing and the digital-to-motor ground tie; and the PWM-to-RF isolation post covers the switching-node EMI that the sense path also has to survive.
Why current-sense fails on ESP32-S3 motor boards
The sense signal is small and the noise is large. A typical shunt is 10–100 mΩ, so at 1 A the sense voltage is 10–100 mV. The motor return path, by contrast, carries amps of switching current through copper that has its own inductance and resistance; any IR drop in that return shows up at the sense pin as a current error. The failure is not a blown part — it is a wrong reading that the firmware trusts. On an S3 board the problem is compounded because the ADC ground reference is the same ground the camera DVP bus and the I2S mic reference, so a noisy sense return also lifts the AI input reference and produces inference errors that look like a model bug, not a layout bug.
The root cause is almost always shared return impedance. If the sense return trace shares copper with the motor return current, the motor current develops a voltage across that shared copper, and the sense amplifier reads that voltage as part of the signal. The fix is a Kelvin connection — four wires to the shunt, two for the current path and two for the sense path — and a solid sense ground that does not carry motor return current.
Shunt placement and value selection
Place the shunt as close to the driver sense pins as the footprint allows. The shunt value is a trade between signal level and power dissipation: a larger shunt gives more voltage and easier ADC resolution but burns more power as heat; a smaller shunt wastes less power but pushes the signal toward the ADC noise floor. For a 2 A motor on an S3 ADC, 50 mΩ is a common starting point — it gives 100 mV at full current and dissipates 200 mW, which a 1206 shunt handles. For a 0.5 A gimbal motor, 100–200 mΩ gives more signal headroom. Pick the shunt package for thermal dissipation, not just current rating: a 0805 shunt at 200 mW needs copper pad area to shed heat, while a 1206 does it more comfortably.
Use a shunt with 1% tolerance or better. The sense accuracy is the shunt tolerance plus the amplifier gain error plus the ADC error; a 5% shunt alone makes the reading useless for anything beyond stall detection. Specify 1% or 0.5% on the BOM.
Kelvin connection: the 4-wire principle on a motor driver sense resistor
A Kelvin connection uses four contacts to the shunt: two for the current path (high-current in and out) and two for the sense path (small-signal voltage measurement). The sense contacts tap the shunt at the resistor element, not at the current-carrying pads, so the IR drop in the current path does not appear in the sense measurement. On a motor driver this means the sense traces leave the shunt from their own pads or from the inside edge of the shunt pads, not from the same copper that carries the motor current.
The mistake is routing the sense trace from the high-current pad — the motor current develops voltage across that pad, and the sense reads it. The fix is a separate sense pad or a Kelvin tap point on the shunt footprint, with the sense trace leaving at 90 degrees from the current flow.
Routing the Kelvin traces: width, length, layer, vias
Route the Kelvin sense traces as a differential pair: short, thin, and close together, on one layer over the GND plane. Keep them under 10 mm from shunt to amplifier input if possible — the longer the trace, the more it picks up. Use 6–8 mil width; the signal is high impedance and the current is negligible, so width is for impedance control and manufacturability, not current capacity. Do not put vias on the sense traces if you can avoid them; if you must, use a single via pair and keep the return path solid underneath. Run the two sense traces parallel and close, with a ground guard trace on either side if the board space allows, to reject common-mode noise.
Keep the sense traces off the motor VM pour and away from the PWM switching node. The sense pair is a high-impedance input and picks up capacitive coupling from any nearby copper at a switching potential. If the sense traces must cross a power pour, cross at 90 degrees and keep the crossing short.
DRV8313 external sense: independent PGND, external shunt per low-side
The DRV8313 gives you independent PGND pins per low-side, so each phase can have its own external shunt with its own Kelvin return. Place the shunt between the driver low-side source and the PGND pad, with the sense traces leaving the shunt pads directly to the amplifier input. The independent PGND per phase means the sense ground for one phase does not carry the return current of another phase, which is the cleanest sense topology on these boards. Tie the PGND copper to the motor return at the shunt, not at the driver — the shunt is the reference point.
TMC2209 internal sense: BRA/BRB pins, internal vs external resistor
The TMC2209 offers an internal sense resistor option, which saves a shunt and a Kelvin layout but limits the sense accuracy to the internal resistor tolerance. If you use the internal sense, tie the BRA and BRB pins to GND close to the driver ground pad with a short, wide trace. If you use an external shunt, place it tight to the driver sense pins and route the BRA/BRB traces as a Kelvin pair from the shunt pads. The internal-sense option is fine for stall detection and coarse current control; for torque control or anything the AI loop uses, the external shunt with a Kelvin layout is more accurate.
A4988 sense: low-side sense resistors, layout
The A4988 uses low-side sense resistors on RS1 and RS2, typically 0.1 Ω. Place the sense resistors between the driver low-side and ground, with the sense trace leaving the resistor pad directly to the RS pin. The A4988 is an older part with less sense precision than the TMC2209, so the layout discipline matters more — a sloppy sense return on an A4988 board can easily read 20% off. Keep the RS traces short and away from the logic-level pins, which are 3.3 V and sensitive to the same ground noise.
INA240 external amplifier: placement, input filter, output to S3 ADC
The INA240 is a bidirectional current-sense amplifier designed for PWM motor current sensing, with 105 dB CMRR and a 1.1 MHz bandwidth. Place it close to the shunt — within 5 mm if the board allows — so the differential input traces are short and the common-mode rejection has less trace length to work against. Add a high-speed input differential RC filter (typically 10–22 Ω series resistors with a 1–2.2 nF C0G capacitor) across the IN+ and IN- pins, tight to the amplifier, to reject switching ringing without distorting the PWM-settling slope. Avoid oversized RC values (such as 100 Ω + 0.1 µF), which choke the 1.1 MHz bandwidth down into the single-kHz range and create severe phase lag during rapid commutation. Route the output to the S3 ADC on a short, shielded trace, and set the ADC reference to the same ground the amplifier references. The INA240 has a REF pin that sets the output zero-current level; tie it to a clean reference, not to a noisy rail.
Sense ground strategy: solid common sense GND, single tie to digital GND
The sense ground must be solid and common to all sense connections, including the shunt ground and the amplifier ground. Do not let motor return current share this copper. The sense ground ties to the digital GND at one point — the same single-point tie the power-integrity post describes — so the motor return and the sense return meet only at the star point, not along a shared trace. If the sense ground shares copper with the motor return, the motor current develops voltage across that copper and the sense reads it as current error. A solid sense ground island, tied at one point, is the rule.
S3 ADC integration: which ADC, sampling timing vs PWM
The ESP32-S3 integrates two 12-bit SAR ADCs (ADC1 and ADC2), supporting continuous DMA-driven sampling up to 100 kSPS. Use ADC1 for the current-sense channel if possible — ADC2 shares internal routing and pins with Wi-Fi and is less reliable during active radio transmissions. The sampling timing matters as much as the routing: sample the ADC at a point in the PWM cycle where the motor current is fully settled, not during switching transitions. If you sample at the switching edge, the reading captures inductive ringing and is useless. Trigger the ADC sample from the MCPWM timer at the center of the PWM on-time, or use DMA to sample at a fixed offset from the PWM trigger. The firmware and layout have to agree on this — a clean sense path sampled at the wrong instant reads as badly as a noisy sense path sampled correctly.
Current-sense routing rules for ESP32-S3 motor carrier boards
Current-sense routing rules for ESP32-S3 motor carrier boards
Placement and trace rules for the shunt, Kelvin pair, amplifier, and sense ground on each common driver family.
- Shunt placement: Place the shunt within 5 mm of the driver sense pins; the shorter the sense trace, the less noise it picks up.
- Shunt value: Start at 50 mΩ for a 2 A motor (100 mV signal, 200 mW dissipation, 1206 package); scale up for lower-current motors to keep signal headroom.
- Shunt tolerance: Specify 1% or 0.5% on the BOM; a 5% shunt makes the reading useless for torque control or AI-loop current feedback.
- Kelvin connection: Use four contacts to the shunt — two for current, two for sense; tap the sense at the resistor element, not at the current-carrying pad.
- Sense trace width: 6–8 mil; the signal is high impedance and the current is negligible, so width is for manufacturability, not current.
- Sense trace length: Under 10 mm from shunt to amplifier input if possible; longer traces pick up more switching noise.
- Sense trace layer: One layer over the GND plane, no vias if avoidable; if vias are required, use a single pair with a solid return underneath.
- Sense trace pairing: Route the two sense traces as a close differential pair, with ground guard traces on either side if space allows.
- DRV8313: Use the independent PGND per low-side for an external shunt on each phase; tie the PGND copper to the motor return at the shunt, not at the driver.
- TMC2209 internal sense: Tie BRA/BRB to GND close to the driver ground pad with a short, wide trace; use external shunt with Kelvin layout for torque control or AI-loop feedback.
- A4988: Place the 0.1 Ω sense resistors between low-side and ground; keep RS traces short and away from the 3.3 V logic pins.
- INA240 placement: Within 5 mm of the shunt; add a high-speed input differential RC filter (10–22 Ω + 1–2.2 nF C0G) across IN+ and IN- close to the amplifier.
- INA240 REF pin: Tie to a clean reference, not a noisy rail; the output zero-current level depends on it.
- Sense ground: Solid common sense GND island, tied to digital GND at one point; no motor return current on this copper.
- ADC channel: Use ADC1 for current sense; ADC2 shares pins with Wi-Fi and is less reliable during radio activity.
- ADC sampling: Sample at the center of the PWM on-time, not at the switching edge; trigger from the MCPWM timer or use DMA at a fixed offset.
DFM checklist for current-sense layout
DFM checklist for current-sense layout on ESP32-S3 carrier boards
Specify these parameters in your fabrication drawing and BOM notes so current-sense accuracy survives manufacturing.
- Shunt footprint & pad symmetry: Design separate Kelvin-sense tap pads inside the shunt footprint, and balance copper heatsinking symmetrically on both power pads to prevent component tombstoning during SMT reflow.
- Flux residue prevention: Specify high-grade no-clean solder paste or post-reflow automated wash to prevent ionic flux residue from shunting high-precision mΩ resistors.
- Shunt tolerance on BOM: Specify 1% or 0.5% shunt tolerance; call out the manufacturer part number and tolerance explicitly, not just the resistance value.
- Shunt package: Size the package for thermal dissipation (1206 for 200 mW+; 0805 only with adequate heat-spreading copper pads).
- Sense trace spacing: Maintain minimum 4.5/4.5 mil trace/space if the board specifies uniform 2 oz finished outer copper for motor power.
- Sense via rules: If vias are required on the sense traces, use a single matched via pair with a solid return plane underneath; avoid via-in-pad on the shunt.
- INA240 input filter: Place 10–22 Ω series resistors and a 1–2.2 nF filter cap close to the IN+/IN− pins; specify C0G/NP0 dielectric for the filter cap to avoid DC-bias capacitance drop.
- Driver thermal pad: Place 0.3 mm thermal vias on a 1.0–1.2 mm grid under the driver exposed pad, tented or plugged from the bottom; target under 15% solder voiding under AXI.
- Finished copper weight: For motor VM/PGND carrying over 2 A, specify uniform 2 oz finished outer copper on Top and Bottom; do not request mixed copper weight on the same layer.
- Sense ground island: Clearly annotate the single-point star tie between the sense ground island and the digital GND to ensure the CAM review team does not auto-bridge the intentional plane separation.
- Panelization array rails: Instruct the CAM engineering team to align multi-up arrays in identical orientation with a minimum 15 mm panel rail, keeping sensitive sense shunts away from adjacent board motor power nodes.
- ADC channel designation: Flag in the test plan that current sense routes to ADC1, ensuring the test engineering team avoids pin contention with Wi-Fi RF validation on ADC2.
Conclusion
Current-sense layout on an ESP32-S3 motor carrier board is a geometry problem: place the shunt tight to the driver, route the sense lines as a Kelvin pair, keep the sense ground solid and separate from the motor return, and sample the ADC at the center of the PWM on-time. Get those four things right and the ADC reads current, not ground noise — and the same ground discipline keeps the AI inference inputs clean. The routing rules and DFM checklists above give you the specifics for each driver family.
Designing an ESP32-S3 motor carrier board with current-sense feedback? Start with PCB assembly or request a quote — our engineering desk will review your Kelvin routing, shunt placement, and ADC sampling timing for DFM before production.
Common Questions
Why does my ESP32-S3 ADC read the wrong motor current?
The most common cause is shared return impedance between the sense ground and the motor return. Motor current develops voltage across any shared copper, and the sense amplifier reads that voltage as part of the signal. Fix it with a Kelvin connection — four contacts to the shunt, two for current and two for sense — and a solid sense ground that does not carry motor return current.
Should I use the TMC2209 internal sense resistor or an external shunt?
Use the internal sense resistor for stall detection and coarse current limiting; use an external shunt with a Kelvin layout for torque control or any current feedback the AI loop uses. The internal resistor is convenient but its tolerance is wider, and the internal path does not give you the Kelvin isolation that an external shunt with its own sense pads does.
Where do I place the INA240 current-sense amplifier?
Place the INA240 within 5 mm of the shunt if the board allows, with a high-speed input differential RC filter (10–22 Ω + 1–2.2 nF C0G) across the IN+ and IN- pins close to the amplifier. The shorter the differential input traces, the less common-mode noise the amplifier has to reject. Route the output to the S3 ADC on a short trace, and tie the REF pin to a clean reference.
Which ESP32-S3 ADC should I use for motor current sensing?
Use ADC1. ADC2 shares pins with the Wi-Fi radio and is less reliable during radio activity, which on an S3 board is most of the time. ADC1 is the cleaner channel for current sense, and you should sample it at the center of the PWM on-time, not at the switching edge, so the reading reflects settled current, not the switching transient.
How do I keep motor current from corrupting the sense ground?
Use a solid sense ground island that ties to the digital GND at one single point — the same star ground tie the power-integrity layout uses. Do not let motor return current flow through any copper that the sense ground shares. The sense ground and the motor return meet only at the star point, so the motor current cannot develop a voltage drop across the sense ground.
