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

Schematic Capture Done Right

A schematic is read a hundred times more than it is drawn. Draw it for the reader who is debugging at midnight.

⏱ ~24 min read 🧠 Craft + tool semantics 🛠 KiCad ERC

🎯 By the end you'll understand

The conventions that make a schematic readable — flow, placement of power and ground, when a wire beats a label and when it does not, hierarchical sheets — and why they are correctness tools, not aesthetics. What a KiCad power symbol really is, why ERC demands a PWR_FLAG, and what each common ERC message means in circuit terms. Which defects ERC can see, which it sees but misdescribes, and which only a human review finds. And how Beacon's schematic is split into four sheets that match the domains the pre-fab review will walk.

KEY INSIGHTThe schematic is the specification the board is checked against

Two nets on a board were supposed to be one. The label on one end read VBAT. The label on the other end read VBAT followed by a space nobody could see. The board was ERC-clean, DRC-clean, and dead.

That story, or a cousin of it, exists in every hardware team. The details vary — a trailing space, a capital I that was a lowercase l, a label placed a grid unit away from the wire it was meant to name — but the mechanism is always the same. A schematic is not a drawing. It is a connectivity graph with names, and the tool builds the board from the graph, not from what the drawing looks like to you. Two labels that look identical to a human and differ to the parser are two nets. Two labels that look different to a human and are identical to the parser are one net. Everything downstream — ERC, the netlist, the ratsnest, the Gerbers — trusts the graph.

So the discipline of schematic capture has two halves. The first is making the graph correct: every pin on the net it belongs to, every net named once and consistently, every power rail sourced. The second is making the drawing reveal the graph to a tired reader, so that a wrong connection looks wrong. Readability is not a courtesy to colleagues; it is how a reviewer's eye catches what the parser cannot, which is intent.

🔑 Hold onto this

ERC checks the graph against pin electrical types: who drives, who listens, what is power. It does not know what I2C is, what a strapping pin is, or which rail a pull-up belongs on. Its errors are precise about the graph and often wrong about the cause — a "power pin not driven" error may mean "add a flag" or may mean "you have two grounds". Reading ERC well is a skill of translation, and the widget below is practice in it.

HOW IT WORKSDrawing for the reader: flow, power, labels, sheets

The conventions below are shared across the industry with small dialect differences. They exist because a reader scanning a sheet is pattern-matching, and the patterns only work if everyone draws the same way.

1

Signal flows left to right; power flows top to bottom

Inputs and connectors on the left, processing in the middle, outputs on the right. Positive rails enter from above with a power symbol pointing up; ground leaves below with a symbol pointing down. A reader who sees an arrow pointing up at the bottom of a part assumes a mistake — and is usually right. Beacon's power sheet reads USB-C → TVS → charger → protection → battery → buck → +3V3 in one left-to-right line.

2

Wires for local connections, labels for everything that would cross the page

A wire is unambiguous but a wire crossing a sheet is unreadable. Use a wire when the two pins are within a few centimetres and the connection is the point (a decoupling capacitor on a pin, a pull-up on a bus). Use a net label when the connection is topological — SDA, SCL, ACC_INT — and a reader would rather follow a name than a line. Never mix: a net that is partly wired and partly labelled is a net whose reader has to check both.

3

Local labels, global labels, hierarchical labels — know which scope you are in

In KiCad a plain local label connects only within its sheet. A global label connects across every sheet in the project — powerful and dangerous, because a reused name on another sheet is a silent short. A hierarchical label connects a sub-sheet to a sheet pin on its parent, making the interface explicit. Power symbols (+3V3, GND) are global by construction. Beacon uses hierarchical labels for signals between sheets, power symbols for rails, and global labels for nothing.

4

Hierarchical sheets by domain, not by page count

Split the design where the reviewer's expertise splits: power, MCU, sensors, USB. Each sheet should fit on a screen without scrolling and have an interface (its sheet pins) a reader can enumerate. A sub-sheet that exports forty signals is not a module; it is a page break.

5

Values, tolerances, and voltage ratings on the sheet; intent in a note

10 µF is not a specification; 10 µF 10 V X7R 0603 is, and it is the difference between a capacitor that is 10 µF and one that is 3 µF at 3.3 V bias (Lesson 1.4). Where a value was chosen — the 2 kΩ that sets the charger to 500 mA, the 2 × 1 MΩ divider — a short text note on the sheet saying why is the cheapest documentation you will ever write.

Same graph, drawn badly Same graph, drawn for the reader ESP32-C3 SHT40 +3V3 (sideways) GND from the side crossings, no labels, no pull-ups visible ESP32-C3 SDA SCL SHT40 SDA SCL +3V3 4.7k 4.7k +3V3 GND flow left→right · rail on top · ground below · bus named, pull-ups visible on the rail they belong to a reviewer can now ask "why 4.7k?" and "why +3V3?" — both are answerable at a glance
Identical connectivity, different drawings. The version on the right makes the two questions a reviewer must ask about any bus — who pulls it up, and to which rail — answerable without tracing a wire. On the left the same questions require following lines across a crossing, which is where the eye gives up.

CORE CONCEPTPower symbols and the PWR_FLAG: what ERC is really asking

A KiCad power symbol — +3V3, VBAT, GND — is a small symbol with a single pin of type power input and a special property that makes its name a global net. Place ten GND symbols and they are one net. That is all it is: a global label with an icon. It does not declare that the rail is powered by anything.

ERC's rule for power is simple and strict: every net that contains a power-input pin must also contain a power-output pin. A regulator symbol's VOUT pin is typed power output, so a +3V3 net fed by the TPS62840 is satisfied. But a battery connector's pins are typed passive — a connector does not know what is behind it — so a VBAT net that is fed only by the JST-PH has no power-output pin, and ERC reports:

ERC report (excerpt)KiCad 8 · power.kicad_sch
[pin_not_driven] Input Power pin not driven by any Output Power pins
    @(93.98 mm, 71.12 mm): Symbol #PWR012 [power_input] Pin 1 [VBAT, Power input]
; meaning: nothing on net VBAT is typed "power output".
; fix if the source is a connector or passive:  place PWR_FLAG on the net
; fix if the source is a regulator/charger:     check its output pin type
; do NOT fix if the net is a second ground you did not mean to create

PWR_FLAG is a symbol whose one pin is typed power output and connects to nothing else. Placing it on VBAT tells ERC "I assert this net is sourced". That is a legitimate assertion for a battery connector, a USB VBUS pin, or the far side of a fuse. It is a lie for a net that is sourced by nothing, and ERC cannot tell the difference. The flag is a promise you sign, and the review in Lesson 5.9 checks the signatures.

Pin electrical typeMeansERC cares because
InputListens, high impedanceMust be driven by something (output, bidirectional, passive counts)
OutputPush-pull driverTwo outputs on one net = fight; output on a power-output net = error
BidirectionalGPIO, I2C dataCompatible with almost everything — which is why an I2C swap is invisible
Tri-stateOutput that can floatAllowed to share with other tri-states
PassiveResistors, capacitors, connectorsNever drives in ERC's eyes; a rail fed only by passives needs PWR_FLAG
Open collector / open emitterWired-OR outputsMay share a net; still need a pull-up ERC cannot check for
Power inputConsumes a rail (VDD pins, power symbols)Net must contain a power output
Power outputSources a rail (regulator VOUT, PWR_FLAG)Two on one net = error (the correct alarm for shorted rails)
Unconnected (NC)Pin exists, must not be wiredAnything wired to it is an error

The matrix ERC uses to decide what is an error, a warning, or fine is editable under the project's ERC settings. Resist editing it. A team that downgrades "output to output" to a warning because one symbol was drawn with the wrong pin type has traded a five-minute symbol fix for a permanent blind spot.

CORE CONCEPTWhat ERC actually checks, message by message

Here are the messages you will meet on a board like Beacon, translated. Severities are the defaults; each is configurable per project, and the professional convention is to leave them alone and use exclusions — a per-instance "I have looked at this, here is why" — for the genuine false positives.

ERC messageWhat the graph looks likeUsually meansSometimes means
Pin not connectedA pin with no wire and no no-connect flagYou forgot a wire (SCL left dangling)The pin is genuinely unused: add an NC flag, don't wire it to ground "to be safe"
Input pin not driven by any Output pinsA net with inputs onlyThe driver is on another sheet under a different labelThe driver is a passive (a resistor divider) — fine; or the input floats — not fine
Input Power pin not driven by any Output Power pinsRail with no power outputAdd PWR_FLAG on a connector-fed railYou created a second ground (GNDA vs GND) by accident; adding the flag hides it
Pins of type Output and Output are connectedTwo push-pull drivers on one netTwo outputs really tied (INT1 and INT2 wired together)A symbol's pin type is wrong — fix the symbol, not the severity
Pins of type Power output and Power output are connectedTwo rail sources on one netTwo regulators, or a rail shorted to anotherCharger output and battery both typed as sources — legitimate; exclude with a note
Label not connected to anythingA label floating one grid unit off its wireExactly that — the trailing-space cousin—
Global label not connected anywhere elseA global label used onceTypo in one of two labels meant to matchIntentionally single use — then it should not be global
Similar labelsTwo labels differ only in case (SDA / sda)Two nets that were meant to be one—
Symbol not annotated / duplicate referenceA "?" or two U3sAnnotate before ERC; never re-annotate after layout—

Notice what is absent. There is no message for "I2C bus has no pull-up", for "pull-up is on the wrong rail", for "this GPIO is a strapping pin", for "SDA and SCL are swapped", or for "two nets share a label because you reused a name". Those defects live in the meaning of the nets, and ERC has no meaning, only types. Two of them are in the widget.

💡 Exclusions are documentation; severity changes are amnesia

KiCad lets you right-click an ERC marker and exclude it. The exclusion is stored in the project and shows in the report as excluded, with the marker still visible. Use it, and put the reason in a note on the sheet: "PWR_FLAG on VBAT: sourced by J2 battery connector." A future reviewer sees a decision. A downgraded severity leaves nothing behind but a quieter tool.

SEE ITERC error hunt

Below is a simplified sheet from Beacon — the MCU, both sensors, the battery connector, and the I2C pull-ups — seeded with six defects and two things that merely look suspicious. First, hunt as a human: click anything you would flag in a review. Then run ERC and compare. The point is not your score; it is the size of the gap between what ERC reports and what is actually wrong, and the one trap where ERC's suggested fix makes the board worse.

⚙ Interactive · ERC error hunt

Click hotspots to flag them (click again to unflag). Then Run ERC, then Reveal. Deterministic — the same six defects every time.

U1 ESP32-C3-MINI-1 GPIO9 / BOOT GPIO3 GPIO6 (SDA) GPIO7 (SCL) GPIO7 GPIO8 GND 3V3 +3V3 GND SW1 button SDA SCL U2 SHT40 SDA SCL VDD GND SDA (no wire) +3V3 C4 100n GNDA VBAT R3 4k7 R4 4k7 U3 LIS2DH12 SDA SCL INT1 INT2 VDD GND SDA SCL INT +3V3 GND INT INT (GPIO3 wake input) NC J2 JST-PH 1 2 VBAT GND
Flag what you would raise in review, then run ERC.
You flagged
0 / 6
ERC errors
—
Only a human
—

The reveal should leave you with a rule of thumb: on a sheet with six real defects, expect ERC to report about four, to describe one of those four in a way that invites the wrong fix, and to be silent on the two that would have cost the most on the bench. The pull-ups to VBAT are the expensive one — a lithium cell at 4.2 V pulling an I2C line above the ESP32-C3's 3.3 V I/O rail by more than the datasheet's absolute maximum of VDD + 0.3 V, on every board, forever. ERC sees two perfectly legal power nets.

IN PRACTICEDesignators, fields, and the notes that save the next engineer

Reference designators follow a convention old enough to be reliable: R for resistors, C capacitors, L inductors, D diodes (including TVS and LEDs, though many teams use LED), Q transistors and MOSFETs, U integrated circuits and modules, J connectors, SW switches, TP test points, FB ferrites, Y crystals. Annotate once, by sheet (power sheet gets 100-series, MCU 200-series, and so on, if you like — KiCad supports it), and then freeze. A designator is an address on the board, in the BOM, in the CPL, and in the bring-up log; renaming an address after people have used it is how the wrong resistor gets replaced.

Symbol fields are where the schematic becomes an ordering document. Beyond Reference and Value, add a manufacturer part number field and, for a fab with an assembly service, the fab's own part identifier (JLCPCB's assembly service uses LCSC part numbers). KiCad 8's built-in BOM generator (Tools → Generate Bill of Materials) exports whichever fields you choose, grouped by value and footprint, so the BOM the assembler receives is the schematic's fields, verbatim. A field left blank on one 10 µF capacitor becomes an "unmatched part" e-mail three days into the order.

🧪 Design-intent notes that earn their space

Short, placed next to the part, stating the constraint not the value:
"R7 = 2 kΩ → MCP73831 charge current 500 mA (I = 1000/R_PROG). Do not exceed 500 mA: R6 requirement + USB source limit."
"R10, R11 = 1 MΩ battery divider, switched by Q3 (PMOS) so it draws nothing in sleep; C12 100 nF holds the ADC sample. See budget in 4.3."
"SW1 on GPIO9 (BOOT strapping pin). Accepted for Rev A: firmware ignores the button for 200 ms after boot; Rev B moves it. See review finding P-3."
Each note tells a midnight reader what would break if they changed the value — which is the only thing they need to know.

✗ Wiring a pin the module does not bring out

On the ESP32-C3-MINI-1, GPIO11–GPIO17 are bonded to the in-package flash and are not available to you. The bare-chip datasheet lists them, your symbol may expose them, and ERC will not say a word — the net is electrically valid, it just has nowhere to go. A schematic that uses them cannot be built with an assembled module. Check every pin against the module pinout, not the chip's. GPIO2, GPIO8 and GPIO9 are strapping pins and carry their own conditions (see the pin map in the canon, and Lesson 3.3).

Text variables are the last piece. KiCad expands ${REV}, ${TITLE}, ${ISSUE_DATE} and any project-defined variable in title blocks and text. Set REV = A in the project once and every sheet and the board silkscreen agree about which revision they are. Rev B is a one-field change, not a hunt through eight files.

BEACONBeacon's four-sheet schematic

Beacon's schematic is the paper v0 from Lesson 2.9, captured in KiCad on the project set up in Lesson 5.1, and split into four sub-sheets under a root sheet. The split follows the domains the Lesson 5.9 review will walk, so a reviewer can be handed one sheet and the requirement it serves.

SheetContainsSheet pins (interface)Serves
powerUSB VBUS in → PRTR5V0U2X TVS → MCP73831 (R_PROG 2 kΩ → 500 mA) → DW01A + FS8205 protection → JST-PH battery → reverse-battery PMOS → TPS62840 buck (+3V3) → battery divider 2 × 1 MΩ + 100 nF behind a PMOS switchVBUS, +3V3, VBAT, VBAT_SENSE, SENSE_EN, CHG_STATR1, R6
mcuESP32-C3-MINI-1, SW1 on GPIO9, WS2812B-2020 with high-side PMOS on its 3V3, Tag-Connect TC2030 pads, four pogo pads, decouplingSDA, SCL, ACC_INT, USB_DP, USB_DM, LED_DIN, LED_EN, SENSE_EN, VBAT_SENSER4, R7, and Stage 6's jig
sensorsSHT40 (0x44) and LIS2DH12 (0x19) on I2C with 4.7 kΩ pull-ups to +3V3; LIS2DH12 INT1 → ACC_INT; 100 nF on each VDDSDA, SCL, ACC_INTR3, R4
usbUSB-C receptacle (USB 2.0 pins only), two 5.1 kΩ CC pull-downs, 22 Ω series on D+ and D−, shield to GNDVBUS, USB_DP, USB_DMR6, R7 (native USB Serial/JTAG for flashing)

Three ERC-relevant decisions are baked in. VBAT and VBUS get a PWR_FLAG each, with a note naming the connector that sources them. The charger's battery pin and the battery both look like sources to ERC, so that one "power output to power output" marker is excluded with a note rather than silenced globally. And every unused module pin carries a no-connect flag — the ESP32-C3-MINI-1 has more GPIO than Beacon uses, and a bare pin is an ERC error that hides real ones in the list.

🔑 The known defect stays in, on purpose, and is written down

The canon is explicit: Rev A's button is on GPIO9, the boot-strapping pin, and a button held at power-up confuses boot mode. The schematic does not hide that. The sheet carries a note next to SW1 naming the risk, the mitigation in firmware, and the Rev B plan. The review in Lesson 5.9 flags it, the team accepts it for the five-board run, and Stage 6 finds out what the acceptance cost. A defect with a note is a decision; a defect without one is a surprise.

WEAKNESSWhere schematic capture bites

✗ Fixing the ERC message instead of the circuit

"Input Power pin not driven" → add PWR_FLAG → ERC clean. If the net was GNDA and the rest of the board is on GND, you have just certified a floating sensor ground. The tool told you the graph was odd; you told it the graph was fine. Every ERC error deserves the question "what would make this message appear on a correct design, and is that what I have?" before any flag is placed. The widget's checkbox is that mistake, made in one click.

✗ Global labels as a convenience

Global labels connect by name across every sheet, silently. Name a net INT on the sensor sheet and INT on the MCU sheet for the button, and the accelerometer's push-pull interrupt output is now wired to a switch to ground. ERC's "global label not connected anywhere else" check catches a global label used once, which is the opposite problem. Use hierarchical labels and sheet pins for inter-sheet signals: the connection is then visible at the sheet boundary, and a reviewer can count them.

✗ Wiring unused pins "safely" to ground

It feels tidy: an unused pin gets an ERC error, so wire it to GND. On a module with a pin that is internally an output at boot — or a strapping pin that is read at reset — you have now built a boot-time short or a forced boot mode into every board. The correct treatment of an unused pin is the datasheet's recommendation (often: leave floating, or pull weakly) and a no-connect flag in the schematic, which is a statement that you looked, not that you shrugged.

KEY INSIGHTHow this connects

A clean ERC report and a readable schematic together are the input to everything else in Stage 5. Footprints, layout, and DRC all inherit the graph; if the graph is wrong, the rest of the stage builds the wrong board with great precision.

GLOSSARYKey terms introduced

Net label
A name attached to a wire that joins it to every other wire with the same name in the same scope. Local labels are sheet-scoped; global labels span the project; hierarchical labels connect a sub-sheet to a parent's sheet pin.
Power symbol
A KiCad symbol with one power-input pin whose name is a global net (+3V3, GND). It names a rail; it does not source it.
PWR_FLAG
A symbol with a single power-output pin, placed on a net to assert to ERC that the net is sourced (by a connector, battery, or other passive-typed source).
Pin electrical type
The attribute (input, output, bidirectional, passive, power input/output, open collector, tri-state, no-connect) ERC uses to decide whether two connected pins are compatible.
Hierarchical sheet
A sub-schematic placed on a parent sheet as a block with sheet pins; the mechanism for splitting a design by domain while keeping interfaces explicit.
No-connect flag
An X marker on an unused pin that tells ERC the omission is deliberate; it is a record of a decision, not a wiring instruction.
ERC exclusion
A per-marker "reviewed, acceptable" note stored in the project; the right way to handle a genuine false positive without lowering a rule's severity.

ACTIVE RECALLCheck your understanding

Answer in your own words first, then reveal.

1ERC reports "Input Power pin not driven by any Output Power pins" on a net called GNDA. List the two very different things this can mean and how you tell them apart.›

Either (a) the net is a legitimate rail sourced by something ERC types as passive — a connector, a battery, the far side of a fuse — and needs a PWR_FLAG with a note naming the source; or (b) the net should not exist as a separate net at all: someone used a GNDA symbol on a part while everything else is on GND, and the message is the only symptom of a floating ground. You tell them apart by asking what physically sources the net. Nothing sources "analog ground" on Beacon — there is one ground — so the fix is to replace the symbol, not flag it. Adding the flag makes ERC clean and the SHT40's ground open.

2Why can ERC not detect SDA and SCL swapped at a sensor, and what would?›

Both I2C pins are typed bidirectional (or open-collector) on both the module and the sensor, and bidirectional-to-bidirectional is compatible in ERC's matrix. The graph is legal either way; the mistake is in which pin carries which meaning, and ERC has no notion of meaning. It is caught by a human comparing each pin against the datasheet pinout — which is why Beacon's review checklist has "every bus pin vs datasheet" as a line — or, expensively, on the bench when address 0x44 never ACKs. Consistent naming helps the human: a net named SDA landing on a pin labelled SCL is visible at a glance if the labels are next to the pins.

3The I2C pull-ups were drawn to VBAT instead of +3V3. ERC is silent. What is the physical consequence on Beacon, and where should the value and rail be documented?›

VBAT is a lithium cell that sits at up to 4.2 V when full. A pull-up to VBAT drags SDA and SCL toward 4.2 V whenever the bus idles, which is above the ESP32-C3's I/O supply of 3.3 V by more than the datasheet's absolute-maximum margin of VDD + 0.3 V, and above the SHT40's and LIS2DH12's ratings as well. Best case, the protection diodes clamp it and the pull-up current flows into the 3.3 V rail; worst case, long-term damage on every unit. ERC sees two legal power nets. The rail choice belongs in a design-intent note next to the resistors ("pull-ups to +3V3, the I/O rail of all three devices"), so the reviewer's eye and the note agree.

4What is the difference, in KiCad, between a local label, a global label, and a hierarchical label — and which does Beacon use between sheets, and why?›

A local label connects wires with the same name within one sheet only. A global label connects by name across every sheet in the project, with no visible marker at sheet boundaries. A hierarchical label connects a wire inside a sub-sheet to a sheet pin on the sheet symbol in the parent, so the interface between sheets is an explicit, countable list of pins. Beacon uses hierarchical labels and sheet pins for signals (SDA, SCL, ACC_INT, USB_DP/DM, LED_DIN, and so on) and power symbols for rails, and no global labels — because a reused global name is a silent short across sheets, and the widget's duplicated INT label is exactly that failure.

Next: footprints — someone else's reading of a datasheet →