LEAK-4 Divider or pull through a normally closed switch¶
| Severity | Status | Implementation |
|---|---|---|
| warning | planned | mid, depends on NET-5, NET-7 |
Looks at. Switch contact type (NC / NO), the power structure.
What it catches. A pull-up or divider whose current path closes through a normally closed contact (switch, button, reed sensor, interlock), so current flows in the rest state.
Why it matters. A pull-up against a normally open button costs nothing until someone presses it. Against a normally closed one it costs V / R all the time the device sits there, which is nearly always. The mistake comes from picking an NC contact for "fail-safe" detection without moving the sense resistor.
Example. A lid interlock (NC reed switch, closed while the lid is shut) to GND with a 10 kΩ pull-up to 3.3 V: 330 µA for as long as the lid is closed, about 8 mAh a day, in a product meant to sleep for a year on a 2000 mAh cell (it lasts eight months instead).
How to check. Resistors from a rail whose chain to ground passes a switch with an NC contact (part data or pin names NC/COM).
Fix. Use the NO contact and invert the logic, raise the pull-up to 1 MΩ class, or sample the switch with a switched pull-up.
References. AN4899 §5.1.3 "GPIO current consumption" (static current is mainly pull-ups on pins held low).