ProjekinAja. Embedded Systems Stage 5 · PCB Design Lesson 5.5
● Stage 5 · Lesson 5.5

Placement: The Decision That Determines Everything

Route a good placement and the traces draw themselves. Route a bad one and no amount of skill saves it.

⏱ ~27 min read 🧠 Geometry as electrical design 🛠 KiCad pcbnew, before any track

🎯 By the end you'll understand

Why the order in which you place parts matters more than where any single part ends up, and what that order is. How to price a placement decision in physical units instead of taste: nanohenries for a decoupling capacitor moved five millimetres, square millimetres of hot loop for a buck converter, decibels of link margin for an antenna, and degrees Celsius — with the humidity error that follows from them — for a sensor sitting downstream of a charger. Why the accelerometer's position changes the latency of a motion report. And Beacon's 35 × 25 mm floorplan solved in the order that makes each later decision easier rather than harder.

KEY INSIGHTPlacement is the electrical design; routing is bookkeeping

The temperature readings were perfect on the bench and five degrees high in the field. It took two weeks to notice that the field units were the ones plugged into a charger.

There is a moment in every layout, about twenty minutes in, when the parts are roughly arranged and the ratsnest looks like a bird's nest, and the temptation is to start routing and tidy the placement later. Do not. Almost everything electrical about a board is decided by geometry that exists before the first track: the area enclosed by a switching loop, the distance from a decoupling capacitor to the pin it serves, the copper under an antenna, the thermal path from a hot part to a sensor that is trying to measure room temperature. Routing does not fix any of those. Routing implements them.

The practical version of this claim is that a good placement can be routed by a competent person in an afternoon, and a bad placement cannot be routed well by anyone. When you find yourself fighting to squeeze a trace between two pads, or running a supply the long way round the board, or crossing a plane split because there is no other way through — that is not a routing problem you are having. That is a placement problem, arriving late and disguised.

🔑 Hold onto this

Place in priority order, not in schematic order. Things that cannot move go first; things whose position has an electrical price go next; things that merely need to exist go last. Every time you place a part out of order you are implicitly deciding that its position matters more than everything you have not placed yet — and you are almost always wrong.

HOW IT WORKSPlacement in priority order

The order below is not a style preference. Each step constrains the next, and doing them out of sequence means backing up. Work through it once with the ratsnest visible and the 3D viewer open on a second monitor.

1

The board outline and everything mechanical

Outline, mounting holes, keep-outs from the enclosure, the height of the tallest part, the position where a cable must exit. These come from the enclosure and they do not negotiate. On Beacon: 35 × 25 mm from R8, one mounting boss, an optional IP54 shell from R9, and a USB-C receptacle that must line up with a hole in that shell.

2

Connectors, at the edges where the user meets them

A connector in the middle of a board is a cable routed across everything else. USB-C on one edge, the JST-PH battery lead on another, the Tag-Connect pattern somewhere a probe can physically reach with the enclosure open. Connectors also carry mechanical load, so they want board area under them and, for the USB-C, through-hole shell anchors.

3

The RF module, at the edge, with its antenna clear

The radio has the least freedom of anything on the board: the module's certification assumes a particular relationship between antenna, ground and nearby metal (Lesson 5.7). Place it third, before anything competes for the same corner, and draw its keep-out immediately as a rule area on every layer so no later decision can quietly violate it.

4

The switching regulator and its hot loop, tight and far from the radio

The buck's input capacitor, high-side and low-side switches form a loop that carries a discontinuous current — the noisiest structure on the board. Place the input capacitor against the IC first, then the inductor, then the output capacitor, and treat the resulting cluster as one immovable block. Then move that block away from the antenna and away from anything analogue.

5

Decoupling capacitors, against their pins

Before any other passive. A decoupling capacitor placed 6 mm from its pin is not a decoupling capacitor, it is a small bulk capacitor with an inductor in series. Place them, then place the vias that connect them, then check with the ratsnest that nothing has pushed them away.

6

Sensors where they can sense

A sensor is a transducer with an opinion about its surroundings. The temperature and humidity sensor goes as far as possible from every heat source and gets thermally isolated on purpose. The accelerometer goes near the mounting point, where the board is rigid and moves with the asset rather than resonating on its own.

7

Test points, debug, indicators, and everything else

Whatever is left. Test pads want to be reachable from one side with a pogo jig (Lesson 6.3), the LED wants to be visible through whatever the enclosure does, and the button wants to be pressable without flexing the board into the battery.

💡 The two-minute check that catches most placement errors

With placement done and nothing routed, turn off all layers except the ratsnest and look at the picture. Long ratsnest lines that cross the board are supplies or buses going the wrong way. Bundles that cross each other are two parts in swapped positions. A dense knot in one region is a part that needs to move outward. You are reading the routing problem before you have created it, and swapping two parts now costs seconds.

CORE CONCEPTDecoupling: why the answer is always "millimetres"

Everyone knows decoupling capacitors go "close to the pin". Here is what close buys, in numbers you can defend.

A decoupling capacitor's job is to supply the current a chip demands faster than the supply can. Its ability to do that is limited not by capacitance but by the inductance of the whole loop: capacitor → its pad → via → plane → via → chip pad → chip, and back. That loop inductance has three contributors — the capacitor's own equivalent series inductance (roughly 0.6 to 1 nH for an 0402, package-dependent), the vias (around 1.3 nH each for a through via on a 1.6 mm board, less when a return via sits right beside it), and the trace between them (roughly 0.5 to 1 nH per millimetre for a narrow trace over a nearby plane).

🧪 Worked: what five millimetres costs

Capacitor 1 mm from the pin, vias immediately adjacent: L ≈ 0.7 nH (ESL) + 1.5 nH (mounting loop) ≈ 2.2 nH.
Self-resonance with 100 nF: f = 1 / (2π√(LC)) = 1 / (2π√(2.2 × 10⁻⁹ × 10⁻⁷)) ≈ 10.7 MHz.
Impedance at 100 MHz (well above resonance, so inductive): Z ≈ 2πfL = 1.38 Ω.

Same capacitor 6 mm away, adding ~3 nH of route: L ≈ 5.2 nH.
Self-resonance drops to 7.0 MHz; impedance at 100 MHz rises to 3.27 Ω.

So five millimetres of copper multiplies the supply impedance at 100 MHz by 2.4× and costs a third of the useful bandwidth. Above resonance the capacitor is an inductor, and no amount of extra capacitance helps — this is why the fix for high-frequency noise is shorter loops, and why adding a second 100 nF next to the first one works mainly because two parallel loops have half the inductance.

The corollary is worth stating plainly because it contradicts a lot of forum advice: the value on the capacitor matters far less than where you put it. A 100 nF placed badly is worse than a 10 nF placed well, at every frequency where decoupling is difficult. Choose the value the datasheet asks for, then spend all your effort on the loop.

CORE CONCEPTThe switching regulator's hot loop

A buck converter has two current loops and only one of them is dangerous. Knowing which is the difference between a placement that works and a placement that radiates.

In a synchronous buck the inductor current is continuous: it ramps up and down but never stops. So the output loop — inductor, output capacitor, load — carries a smooth current and is electrically quiet. The input loop is the opposite. Each cycle, when the high-side switch turns on, the input capacitor must deliver the full inductor current within nanoseconds; when it turns off, that current transfers to the low-side switch. The loop formed by input capacitor → VIN pin → high-side switch → SW node → low-side switch → GND → back to the input capacitor therefore carries a current that steps from nearly zero to the peak inductor current and back, every cycle. That is the hot loop.

Which loop is hot, and what its area costs The two loops HS / LS switches Cin HOT: di/dt L1 Cout quiet: continuous current Tight: Cin against the pins loop ≈ 2 mm² · ΔV ≈ 0.2 V Loose: Cin 6 mm away loop ≈ 12 mm² · ~6× the field The hot loop is a placement decision made before any track is drawn: Cin's pads, the IC's VIN and GND pads, and the return path between them define the area.
Loop areas are illustrative of the geometry, not measurements of a specific board. What is not illustrative is the mechanism: the input loop carries the discontinuous current, so its enclosed area sets both the ringing on VIN and the broadband field the board radiates.

The electrical price of loop area is ordinary inductance. Voltage across an inductance is V = L · di/dt, and a small buck transitioning half an amp in a few nanoseconds has a di/dt on the order of 10⁸ A/s. With about 2 nH of loop inductance that is 0.2 V of ringing on the input node every switching edge; double the loop and you double the spike. Those edges have energy far above the switching frequency — the ringing frequency is set by the loop inductance and the switch capacitance, typically in the tens to hundreds of megahertz — which is precisely the range that couples into everything else and, in Beacon's case, raises the noise floor of a receiver trying to hear −97 dBm.

⚠ Receiver desense is not detuning

Two different failures get confused. Detuning is copper or metal near the antenna changing its resonance — a geometry problem, fixed by keep-outs. Desense is the board's own switching noise raising the receiver's noise floor so that a signal which used to be readable is now buried — a noise problem, fixed by smaller loops, more distance, and better filtering. A board can have a perfectly tuned antenna and still lose 6 dB of effective sensitivity because a buck converter is 4 mm away. Beacon separates the two by keeping the regulator cluster at the opposite end of the board from the module.

SEE ITPlacement scorer

Beacon's 35 × 25 mm outline, opened in the arrangement a first-time layout usually produces: parts placed in schematic order down the left side, module in the middle. Drag the parts. The consequences update in the units the requirements are written in — decibels of link margin against R2, degrees and humidity points against R3.

⚙ Interactive · Placement scorer · drag the parts

Simplified grid model: parts are rectangles snapped to 0.5 mm, and the RF and thermal penalties are deterministic teaching functions calibrated to make the mechanisms visible — not measurements of a specific board. The relationships are real; the exact decibels and degrees come from a range test and a thermal camera on the first article.

Fade margin @ 10 m
—
Est. usable range
—
SHT40 temp error
—
Verdict
—

Two things are worth doing deliberately. Drag the module into the middle of the board and watch the link margin fall while the range figure stays comfortably above ten metres — that is the honest shape of RF failure. A bad antenna placement rarely fails the requirement on paper; it eats the margin that was absorbing multipath nulls, body shadowing and the inside of a metal tool cart, and then the pilot shows up as "some units miss some reports sometimes". Second, put the humidity sensor next to the charger and switch to sampling while charging. The temperature error is bad; the humidity error is four times worse, for reasons that are pure physics and are worth understanding before you design any sensor board.

IN PRACTICESensors where they can sense

Why a warm humidity sensor lies about the room

Relative humidity is the ratio of the actual water-vapour pressure to the saturation pressure at the sensor's temperature: RH = pv / ps(T). The air's water content does not change when the board warms up, but ps(T) rises steeply — near room temperature by about 6.3% per degree. So a sensor that is warmer than the air it is supposed to characterise reports a humidity that is too low, and it is not malfunctioning. It is correctly reporting the humidity of its own little microclimate.

🧪 Worked: five degrees of self-heating at 50% RH

Saturation vapour pressure is 2.339 kPa at 20 °C and 3.169 kPa at 25 °C. A sensor sitting at 25 °C in 20 °C air with a true 50% RH reports:

RHread = 50% × 2.339 / 3.169 = 36.9%

A 13-point error, against R3's ±3%. The temperature reading is separately 5 °C wrong against a ±0.3 °C requirement. One placement mistake destroys both sensor specifications at once, and it does so only when the unit is charging — which is why it survives the bench and appears in the field.

Defending the SHT40, in order of effectiveness

The accelerometer has a mechanical placement problem, not a thermal one

The LIS2DH12's job under R4 is to detect that the asset moved and wake the MCU within a latency budget that ends in a report inside two seconds. Where it sits changes what it hears. Near the mounting boss the board is stiff and moves with the asset. At the far corner of a board held by one boss, the PCB behaves like a small cantilever with its own resonance; a knock on the asset excites that resonance and the accelerometer sees a decaying oscillation superimposed on the real motion. The practical consequence is that you have to raise the wake threshold to avoid false wakes — and a higher threshold means gentle movements are missed, or detected late, which spends the R4 budget on nothing.

Its INT1 output goes to GPIO3, which matters for a reason that is not electrical placement at all: only GPIO0–GPIO5 are in the ESP32-C3's RTC domain, and only an RTC-domain pin can wake the chip from deep sleep. A motion interrupt on any other pin is an interrupt nobody is awake to hear.

Two more rules for that part: keep it out of the antenna keep-out, and fix its orientation deliberately, because the "moved" flag in Beacon's 14-byte payload is derived from axes whose meaning depends on how the board sits in the enclosure.

Test points and the Tag-Connect

The TC2030 pattern is six pads plus two locating holes, and it only works if a plunger can physically arrive: keep tall parts out of its footprint, leave a few millimetres of clear top side around it, and put it where a hand can hold the probe against the board with the enclosure open. Beacon's four pogo pads for the production jig (Lesson 6.3) go on the bottom side in a rectangle that a fixture can find, away from the battery connector so the jig does not fight the cable.

BEACONBeacon's 35 × 25 mm floorplan, solved in order

Here is the placement the review approves, and the order it was produced in. Read it as a sequence of constraints being spent, not as a picture.

Beacon Rev A — top view, 35 × 25 mm (10 px = 1 mm) ANTENNA KEEP-OUT no copper · any layer U1 ESP32-C3-MINI-1 13.2 × 16.6 mm U2 buck + L1 + Cin U3 charger J2 battery J1 USB-C U4 SHT40 · moat U5 mounting boss accelerometer within the rigid zone 3.3 V, short 19.5 mm from the charger — the whole diagonal 0,0 25 mm 35 mm →
The floorplan is the argument. Module hard against the top edge with the antenna region cleared on all four layers; the noisy and hot cluster (buck, charger, battery) in the opposite corner; the humidity sensor at the maximum available distance from both, with a moat; the accelerometer inside the rigid zone around the mounting boss; USB-C on the edge the enclosure opens.
StepPlacedConstraint spentWhat it forced next
1Outline, mounting bossR8: 35 × 25 mm, and the enclosure's single bossA rigid zone in one corner, and a cantilever at the far one
2J1 USB-C, bottom edgeEnclosure opening; through-hole shell anchorsThe charger must be near this edge — 500 mA has to get from here to the battery
3U1 module, top edgeR2 and the module's integration rules: antenna at the edge, no copper on any layerHalf the board's top area is now spoken for; nothing else may enter the keep-out
4U2 buck clusterHot loop tight; far from U1The regulator lands mid-right, roughly 9 mm from the antenna region
5U3 charger, J2 batteryShort, fat VBAT path; connector at an edge for the cableThe hot corner is now defined: charger, battery, buck all together
6U4 SHT40Maximum distance from the hot corner; moat and slotLower-left corner — the only place left that is 19.5 mm from the charger
7U5 accelerometerRigid zone near the boss; outside the keep-outUpper right, beside the boss
8Decoupling, TC2030, LED, button, pogo padsWhatever is left, in that order of importanceNothing — this is the step that must never constrain the earlier ones

One placement in that list is a compromise and the review records it as such. The button sits on GPIO9, which is a boot-strapping pin, and the canon's Rev A defect is that holding it at power-up puts the module into download mode. That is a schematic problem, not a placement problem — but the placement makes it worse, because the button ends up where a thumb naturally lands when a user picks the unit up by the charging edge. Lesson 5.9 flags it, the team accepts it for Rev A with a documented workaround, and Rev B moves the button.

WEAKNESSWhere placement bites

✗ Placing in schematic order because that is the order the parts appear

When you update the PCB from the schematic, KiCad drops the new footprints in a heap, often grouped by sheet. It is enormously tempting to walk that heap and place parts one by one. Doing so places the least constrained parts first — the passives, the pull-ups, the LED — and by the time you reach the module and the regulator the good positions are taken. Placement order and schematic order have nothing to do with each other. Move the whole heap off the board first, then place from the constraint list.

✗ Optimising the picture instead of the physics

Neat rows of aligned passives look professional and are frequently wrong. Alignment is a tidiness property; loop area, thermal distance and antenna clearance are electrical properties, and they conflict with tidiness more often than not. A decoupling capacitor rotated 45° and jammed against a pin is better engineering than one squared up 3 mm away. Aesthetic layout is worth real money for reviewability and rework, so spend it on the parts whose position is electrically free — and never on the parts whose position is the design.

✗ Treating "it fits" as "it is placed"

On a board this small the strongest pressure is area, and it produces a specific failure: everything is inside the outline, nothing overlaps, DRC is silent, and the placement is still wrong because the constraints that mattered were never checked. Nothing in KiCad will tell you the humidity sensor is 1 mm from the charger, or that the antenna sits over the battery, or that the accelerometer is on the flexible corner. Those checks are yours to run, which is exactly why Lesson 5.9's review has a placement section with named distances in it rather than a general question about whether the layout looks reasonable.

KEY INSIGHTHow this connects

Placement decided where the current has to go. Routing decides how wide the copper is when it gets there, and whether the return path can follow.

GLOSSARYKey terms introduced

Hot loop
In a switching converter, the loop carrying discontinuous current — for a buck: input capacitor, high-side switch, low-side switch, ground. Its enclosed area sets the switching-edge ringing and the radiated field.
Mounting inductance
The inductance of a capacitor's connection — pads, vias, and trace — as distinct from the capacitor's own ESL. Usually the larger of the two, and entirely a placement and routing choice.
Self-resonant frequency
1/(2π√(LC)) for a capacitor plus its mounting inductance; above it the capacitor behaves as an inductor and extra capacitance stops helping.
Desense
Loss of effective receiver sensitivity caused by the board's own noise raising the noise floor. Distinct from detuning, which is a change in antenna resonance caused by nearby copper or metal.
Fade margin
The decibels between the received signal level and the receiver's sensitivity at the required distance; the reserve that absorbs multipath nulls, shadowing and orientation.
Thermal moat
A deliberate break in copper — no plane connection, thin traces, sometimes a milled slot — used to stop board heat reaching a temperature or humidity sensor.
Rigid zone
The region of a board near a mounting point that moves with the assembly rather than flexing; where inertial sensors belong.
Courtyard collision
Two footprints' exclusion outlines overlapping — the one placement error DRC does catch, and only if both footprints have courtyards.

ACTIVE RECALLCheck your understanding

Answer in your own words first, then reveal.

1A humidity sensor sits 2 mm from a charger and reads 5 °C high while charging. Quantify the humidity error at a true 50% RH, and explain why the sensor is not faulty.›

Relative humidity is pv/ps(T). Warming the sensor does not change the air's water content but raises the saturation pressure at the sensor: 2.339 kPa at 20 °C versus 3.169 kPa at 25 °C. So the reported value is 50% × 2.339/3.169 = 36.9% — about 13 points low, against R3's ±3%. The sensor is behaving perfectly; it is reporting the humidity of the air touching it, which really is drier because it is warmer. That is why the fix is thermal, not calibration: distance, a copper moat and a slot, a vent in the enclosure, and a firmware rule about when to sample. And it is why the fault appears only in the field: on the bench nobody leaves the charger plugged in while reading the sensor.

2Why does the input capacitor of a buck converter get placed before the inductor, and what is the physical quantity you are optimising?›

Because the input capacitor, the high-side switch and the low-side switch form the loop that carries discontinuous current — it steps from near zero to the peak inductor current every switching cycle. The inductor's current is continuous, so the output loop is quiet and its geometry matters far less. The quantity being optimised is the enclosed area of that input loop, which sets its inductance: V = L·di/dt, and with roughly 10⁸ A/s of di/dt, about 2 nH of loop gives 0.2 V of ringing on VIN. Halving the loop halves the spike and cuts the radiated field roughly in proportion to the area. Place Cin against the VIN and GND pads first, then the inductor, then Cout, and move the finished cluster as one block.

3Moving Beacon's antenna into the middle of the board costs several decibels but the range estimate still exceeds the 10 m requirement. Why is that not a reason to do it?›

Because the nominal range figure assumes one clean path, and real indoor links do not have one. The number that predicts field behaviour is the fade margin at the required distance: the decibels held in reserve to absorb multipath nulls (which can be 10–20 dB deep), the asset's orientation, a human body between tag and gateway, and the metal of whatever the tag is attached to. A placement that keeps 20 dB of margin at 10 m tolerates all of that; one that keeps 3 dB does not, and the symptom is not a clean failure but intermittent missed reports scattered across the pilot — the most expensive kind of defect to diagnose because it is not reproducible on a bench.

4You inherit a layout where every part is inside the outline, nothing overlaps, and DRC is clean. Name three placement defects that state is fully compatible with.›

Any of: the antenna sitting over ground copper or over the battery, which no rule checks unless someone drew a keep-out rule area; a temperature or humidity sensor within a couple of millimetres of the charger or regulator, which is a thermal relationship DRC has no model of; decoupling capacitors several millimetres from their pins, which is legal and quadruples the mounting inductance; an inertial sensor on the flexible corner of a board held by one boss; a buck's input capacitor placed on the far side of the IC so the hot loop wraps around it; a connector positioned so the cable must cross the board. DRC checks clearances and connectivity. Every constraint in this lesson is a distance you have to assert, which is why the pre-fab review in Lesson 5.9 lists them by name and by millimetre rather than asking whether the layout looks sensible.

Next: copper as a resistor and a loop antenna →