PCB Design
Build a sensor board: three copper decisions that matter
A sensor board puts power, a current measurement and a weak analog signal on one piece of copper, and each can spoil the others. Three layout decisions make or break it: how the rail reaches the loads, where the current-sense wires join the shunt, and where the ADC's filter capacitor sits. This guide works through all three with numbers you can check.
The board
- A 5 V rail feeding two 50 Ω loads, about 100 mA each, through 0.5 Ω traces
- A motor drawing 200 mA through a 0.05 Ω trace and a 0.1 Ω current shunt
- A 100 Hz sensor on a long wire that picks up 1 MHz switching noise, through 10 kΩ into an ADC pin
The targets: both loads at 4.9 V or more, the shunt reading exactly 20 mV, the sensor's signal arriving at 95 % or more, and the noise at 1 % or less.
1. Star the rail
Give each load its own trace from the supply. Each carries only its own current:
Chain the second load from the first one's trace instead, and that shared trace carries 200 mA and drops 0.1 V before the second load's own 50 mV: 4.85 V, a fail. The first load sags too.
2. Sense at the shunt's pads
Take the sense wires from the shunt's own two pads, a Kelvin connection. Wire them a little further out, across the 0.05 Ω trace as well, and the same 200 mA adds 10 mV: the reading is 30 mV and the firmware believes the motor draws 300 mA, 50 % too much.
3. Filter at the pin
Add 10 nF from the ADC pin to ground, beside the 10 kΩ that's already in the path. The corner, 1 ÷ (2π × 10 kΩ × 10 nF), is 1.6 kHz: the 100 Hz signal passes almost whole, and the 1 MHz noise is cut to about 0.16 %. With no capacitor the noise walks straight in; with 1 µF the corner drops to 16 Hz and the signal is cut too.
Live experiment
Make the three copper decisions
A 5 V rail feeding two 50 Ω loads, a motor's 0.1 Ω current shunt, and a 100 Hz sensor on a noisy wire into an ADC pin. Choose chain or star, where SENSE connects, and the pin's capacitor, then test it: both loads at 4.9 V or more, SENSE at 20 mV, signal in and noise out.
“Project: Sensor board” is the project that ends Solder Strait, PCB Design World 2. Free with an account. Lessons unlock in order, so you’ll do the 13 before it first.
Beyond this board
Real sensor boards add three more habits. A ground plane under the analog parts gives every return current a short, low path. Decoupling capacitors sit beside every chip's supply pins. And the motor's current returns on its own path, so it never flows through ground copper the sensor shares. Each is the same idea as the three above: decide where every current flows, and keep measurements out of its way.
Free lesson
Now build it yourself
Each lesson comes in three short parts: see the idea, try it on a live board, then build it yourself, with quick checks as you go.
“Project: Sensor board” is the project that ends Solder Strait, PCB Design World 2. Free with an account. Lessons unlock in order, so you’ll do the 13 before it first.
Or start from the very first lesson, no account neededPractice questions
Three quick questions from the lessons. Pick an answer to check it.
Show the answer
Answer: 30 mV: the shunt plus T3. T3 carries the same 200 mA and drops 10 mV. Included in the span, the reading is 30 mV and the firmware thinks 300 mA.
- Why not “10 mV”? 10 mV is T3's drop only. The span includes the shunt's 20 mV as well.
- Why not “20 mV”? 20 mV is the shunt alone. Wired outside T3, SENSE also picks up T3's 10 mV.
- Why not “0”? 200 mA flows through both parts, so there's 30 mV across the span.
Show the answer
Answer: 4.85 V, and LOAD1 drops too. LOAD1's trace now carries 200 mA, 0.1 V, and LOAD2's own trace adds 50 mV: 4.85 V. Star them.
- Why not “4.95 V”? 4.95 V is a load on its own trace. Chained, LOAD1's trace carries 200 mA and drops another 0.1 V first.
- Why not “5 V”? Both traces have resistance and carry current, so LOAD2 can't get the full rail.
- Why not “4.7 V”? 4.7 V is the end of a three-load chain. Here two loads share one segment: 5 − 0.1 − 0.05 = 4.85 V.
Show the answer
Answer: It would also take 4 % of the load's volts and 40 mW of heat. Ten times the signal, ten times the loss. Shunts are small because the thing they measure has to keep working.
- Why not “It can't be made”? 1 Ω resistors are everyday parts. The problem is what they cost the circuit they measure.
- Why not “The meter would break”? 200 mV is a tiny voltage for any meter or ADC. The cost is the voltage and heat taken from the load.
- Why not “It would read less”? Ten times the resistance gives ten times the voltage: 200 mV instead of 20.
“Project: Sensor board” is the project that ends Solder Strait, PCB Design World 2. Free with an account. Lessons unlock in order, so you’ll do the 13 before it first.
Questions people ask
How do I connect a current sense resistor on a PCB?
Run the two sense traces from the shunt's own pads, separately from the heavy current path, and route them together to the amplifier or ADC. That's a Kelvin connection: the measurement then includes the shunt alone, not the copper leading to it.
Where should the ADC filter capacitor go on the board?
Right beside the ADC pin, with a short connection to ground. Any trace between the capacitor and the pin can pick up noise that the filter never sees.
How do I keep motor current out of my sensor readings?
Give the motor its own supply and return traces, or a star from the supply, so its current never flows through copper that a sensor or reference shares. A solid ground plane under the analog parts helps further.
Related topics
- Kelvin (4-wire) sensing explainedMeasure a shunt's voltage right at its own pads, so the copper either side can't add to the reading.
- Star grounding explainedGive each load its own return to one point, so a big current never flows through a sensitive circuit's ground.
- What is a ground plane on a PCB?A whole layer of copper for ground: milliohms for steady current, about a nanohenry for fast current.
- What is a decoupling capacitor?Why every chip has a capacitor beside its power pins, how big, and why it must be close.