7 IoT Electricity: Kirchhoff Analysis and Diagnostics
7.1 Start With the Situation
Series and parallel reductions explain many circuits, but a real IoT board still has branches and loops whose currents and voltage drops must be proven. The team now applies KCL and KVL to that evidence.
7.2 Overview
This route develops KCL and KVL reasoning, then applies it to power budgets, checks, pitfalls, and troubleshooting.
This is part 2 of 2. Review IoT Electricity: Dividers, Labs, Series, and Parallel when you need the first route.
7.3 Learning Objectives
By the end of this chapter, you will be able to:
- apply KCL and KVL to an IoT circuit
- test circuit and power-budget calculations against measured evidence
- diagnose power-budget and wiring errors with measured evidence
7.4 Chapter Roadmap
Follow the original sections below in order. They begin at the reviewed split boundary and keep every worked example, figure, check, and supporting banner with the section that owns it.
7.5 Deep dive: Kirchhoff Laws in IoT
When IoT circuits get more complex than a single loop — for example, a sensor node with an MCU, LED indicator, and pull-up resistor all sharing a power supply — you need Kirchhoff’s Laws to predict voltage and current at every point.
7.5.1 Kirchhoff’s Current Law (KCL)
The Rule: Total current entering a node equals total current leaving that node. Current cannot appear or disappear — it must flow somewhere.
Why IoT Engineers Care: KCL tells you how much current your battery must supply when multiple components share a power rail.
7.5.2 Kirchhoff’s Voltage Law (KVL)
The Rule: The sum of all voltages around any closed loop in a circuit equals zero. Every volt the battery provides must be “used up” by components in the loop.
Why IoT Engineers Care: KVL tells you the voltage at every point in the circuit, which is critical for ensuring sensors and MCUs receive the correct operating voltage.
7.5.3 ESP32 Sensor Node Power
Scenario: You are designing a battery-powered air quality sensor node with these components on a shared 3.3V rail:
- ESP32-C3 microcontroller: draws 80 mA when active
- BME280 environmental sensor (I2C with 4.7 kOhm pull-ups): draws 1 mA
- Status LED (green, V_forward = 2.1V) with current-limiting resistor: target 10 mA
- MQ-135 gas sensor heater: draws 150 mA from a separate 5V rail
The power comes from a 3.7V LiPo battery through a 3.3V LDO regulator (AMS1117-3.3).
Step 1: Apply KCL at the 3.3V Power Node
All components connect to the 3.3V rail. By KCL, the total current the regulator must supply equals the sum of all branch currents:
Calculate the pull-up resistor current. Two 4.7 kOhm pull-ups (SDA and SCL) connect from 3.3V to the I2C lines. When the line is pulled low (logic 0):
Both lines pulled low simultaneously (worst case):
Total 3.3V rail current:
Step 2: Apply KVL to the LED Loop
Trace a loop from the 3.3V rail through the current-limiting resistor, through the LED, to ground:
Now find the resistor value for 10 mA:
Use a standard 120 Ohm resistor. Verify power dissipation:
A standard 1/8 W (0.125 W) resistor is sufficient.
Step 3: Apply KVL to Check Regulator Headroom
The LDO regulator needs a minimum dropout voltage of 1.0V (AMS1117 datasheet). Apply KVL to the battery-regulator loop:
But a LiPo battery drops to 3.0V when discharged. At 3.5V battery:
Problem found by KVL: The regulator cannot maintain 3.3V output when the battery drops below 4.3V. A LiPo spends most of its discharge curve between 3.5-3.8V, so the LDO will drop out frequently.
Solution: Replace the LDO with a buck-boost regulator (e.g., TPS63000) that can maintain 3.3V output from inputs as low as 2.5V.
Vera’s Probe Points
- Measure: the regulator’s input and output while the battery discharges.
- Expect: 3.3 V out only while the input stays above 4.3 V (3.3 V plus the 1.0 V AMS1117 dropout).
- Wrong?: the LiPo itself — it spends most of its discharge between 3.5 and 3.8 V, below the dropout line.
Step 4: Total Power Budget
| Component | Voltage | Current | Power |
|---|---|---|---|
| ESP32-C3 (active) | 3.3V | 80 mA | 264 mW |
| BME280 sensor | 3.3V | 1 mA | 3.3 mW |
| Status LED | 3.3V | 10 mA | 33 mW |
| I2C pull-ups | 3.3V | 1.4 mA | 4.6 mW |
| MQ-135 heater | 5.0V | 150 mA | 750 mW |
| Total | 242.4 mA | 1,055 mW |
With a 2000 mAh LiPo at 3.7V (7.4 Wh), battery life during continuous active mode:
This confirms the MQ-135 heater dominates power consumption (71%). Duty-cycling it (heat 30s, read, sleep 270s) would reduce average heater current to 15 mA. If the rest of the 3.3V rail stayed continuously active, the same table gives roughly 19.5 hours; longer runtimes require the MCU, sensor, and indicator loads to sleep too.
KCL answered: “Can my regulator handle the total current?” (92.4 mA — yes, AMS1117 supports up to 1A).
KVL answered: “Does my LED get the right current?” (yes, 120 Ohm resistor) AND revealed a hidden problem: “Will the LDO maintain output as the battery discharges?” (no — must switch to buck-boost).
These two laws catch problems that Ohm’s Law alone cannot: KCL catches overcurrent on shared rails, and KVL catches voltage headroom failures in multi-component loops.
Checkpoint: Kirchhoff Checks
You now know:
- The shared 3.3V rail example totals 92.4 mA before the separate 5V heater load.
- The LED loop needs a 120 Ohm resistor for a 10 mA target from a 3.3V rail with a 2.1V LED drop.
- The AMS1117 dropout check needs 4.3V input, so a 3.7V LiPo cannot hold 3.3V across most of its discharge curve.
7.6 Quiz 3
Test your understanding of electricity fundamentals with these questions.
Passive components (resistors, capacitors, inductors) shape every IoT circuit: resistors limit current and create voltage dividers, capacitors filter noise and store energy, and inductors enable efficient power conversion. The power budget calculation (average current = sum of duty-cycle-weighted component currents) is the single most important analysis for battery-powered IoT deployments.
Temperature Terry and friends learn about building real circuits!
Temperature Terry was excited — today was Build Day! The Sensor Squad was going to build their very first LED circuit. “First, we need a resistor,” said the microcontroller, holding up a tiny striped cylinder. “Without it, Lila could get hurt!”
the LED looked worried. “Hurt? How?” Max explained: “If too much electricity flows through you, you’ll burn out — like eating too much candy too fast gives you a tummy ache. The resistor is like a speed bump that slows the electricity down to a safe amount.”
the battery was ready to power everything. “I have 9 volts of energy!” she announced proudly. Max did some quick math: “Lila needs about 2 volts, so the resistor needs to handle 7 volts. Using Ohm’s Law — that’s V divided by I — we need a 220 ohm resistor to keep the current at a safe 20 milliamps.”
They connected everything on the breadboard: Bella to the resistor, the resistor to Lila, and Lila back to Bella through a button switch. When Sammy pressed the button — POP — Lila lit up bright red! “I’m glowing!” Lila cheered. “And I feel perfectly safe thanks to that resistor!”
“That’s the magic of circuits,” said Max. “Every part has a job: Bella provides energy, the resistor keeps everyone safe, and the button gives us control. That’s how EVERY LED in your toys, phones, and smart home gadgets works!”
7.6.1 Key Words for Kids
| Word | What It Means |
|---|---|
| Resistor | A part that slows down electricity, like a speed bump for electrons |
| Capacitor | A tiny bucket that stores electricity and releases it quickly |
| LED | A special light that runs on very little electricity |
| Breadboard | A board with holes where you plug in parts to build circuits |
| Voltage Divider | Two resistors that share voltage, like splitting a pizza between friends |
| Battery Life | How long a battery lasts before it runs out of energy |
7.7 Electrical Concept Map
| Base Concept | Builds To | Requires Understanding Of | Applied In |
|---|---|---|---|
| Voltage (V) | Current flow, Power | Ohm’s Law | Voltage dividers, Battery selection |
| Current (I) | Power consumption, Heat | Ohm’s Law, KCL | Power budgets, Component ratings |
| Resistance (R) | Voltage drop, Power loss | Ohm’s Law | Pull-up resistors, Current limiting |
| Power (P = V × I) | Battery life, Heat dissipation | Voltage, Current | Component selection, Thermal management |
| Ohm’s Law (V=IR) | All circuit analysis | Voltage, Current, Resistance | Every IoT circuit design |
| Series Circuits | Voltage dividers | Ohm’s Law, KVL | Sensor level shifters, Multi-cell batteries |
| Parallel Circuits | Current distribution | Ohm’s Law, KCL | Redundant sensors, LED arrays |
| Capacitors | Filtering, Energy storage | Charge, Voltage | Power supply decoupling, Signal conditioning |
| Inductors | DC-DC converters | Magnetic fields, Energy | Buck/boost regulators, RF circuits |
| KVL | Loop analysis | Series circuits, Voltage | Power rail debugging, LED current limiting |
| KCL | Node analysis | Parallel circuits, Current | I2C pull-ups, Multi-load power budgets |
| Power Budgets | Battery life calculation | Power, Current, Duty cycle | IoT deployment planning |
Key Insight: Every IoT electrical design decision starts with Ohm’s Law (V=IR) and branches into power analysis (P=VI), circuit topology (series/parallel), and component selection (passive elements). Kirchhoff’s Laws (KVL and KCL) tie these concepts together for complete circuit analysis.
7.8 Op-Amp Front-End Contracts
The main chapter above stays focused on passive-component applications: LED resistors, voltage dividers, pull-ups, power budgets, and Kirchhoff checks. For the deeper design contract behind op-amp buffers, non-inverting gain, comparators, virtual-short assumptions, supply-rail limits, and gain-bandwidth trade-offs, continue to Op-Amp Sensor Front-End Contracts.
Electricity is the foundation of all IoT systems, driven by the flow of electrons through conductors. Understanding the relationship between voltage (electrical “pressure”), current (flow rate), and resistance (opposition to flow) through Ohm’s Law (V = I × R) is essential for designing and troubleshooting IoT circuits. Power consumption (P = V × I) determines battery life and energy requirements for IoT deployments.
Circuit configurations significantly impact system behavior: series circuits share current but divide voltage, while parallel circuits share voltage but divide current. Series configurations are useful for voltage division and cumulative resistance, while parallel configurations provide redundancy and current distribution. Understanding these principles enables proper component selection and circuit design.
Passive components shape circuit behavior without requiring external power: resistors limit current and create voltage dividers, capacitors store energy and filter signals, and inductors resist changes in current. Real-world circuits combine these components to condition sensor signals, filter noise, store energy, and protect sensitive electronics.
Practical application of electrical principles includes power budget calculations (ensuring battery capacity meets device requirements), voltage regulation (maintaining stable supply despite load variations), and component selection (choosing resistor wattage, capacitor voltage ratings). Safety margins (typically 2×) prevent component failure and ensure long-term reliability in IoT deployments.
7.9 Practice: Match and Order
7.10 See Also
Within This Module:
Follow these connections in order: Electricity Introduction - Foundational concepts of voltage, current, and resistance; Ohm’s Law Deep Dive - Advanced worked examples for IoT applications including heaters, motors, and complete power budgets; Common Electricity Pitfalls - Unit confusion, voltage drops, power limits, and AC vs DC mistakes.
Related Topics:
Follow these connections in order: Electronics: Doping & Diodes - Active semiconductor devices built on electrical principles; Electronics: Transistor Selection - Choosing BJT vs MOSFET for IoT switching and amplification. Power Management - System-level power architecture and battery optimization; Op-Amp Sensor Front-End Contracts - Buffer divider outputs, amplify sensor signals, and respect op-amp feedback limits; Analog-to-Digital Conversion - How electrical signals become digital data. Sensor Interfacing - Electrical considerations for connecting sensors to microcontrollers.
External Resources:
Follow these connections in order: All About Circuits - Ohm’s Law - Interactive tutorials with circuit simulators; SparkFun Learn - Voltage, Current, Resistance - Beginner-friendly explanations with visual aids; TI Power Management Fundamentals - Industry training for power circuit design.
Common Pitfalls
Many beginners size LED resistors for the maximum rated current (20 mA) because it is listed prominently in the datasheet. At 20 mA, LEDs are near their thermal limits and consume unnecessary power. Use 5-10 mA for indicator LEDs — they are still clearly visible and last orders of magnitude longer. Size the resistor for your chosen If, not the maximum rated If.
When a load (ADC input, voltmeter, next stage circuit) is connected to the voltage divider output, it appears in parallel with R2 and changes the voltage. If the load resistance is comparable to R2, the output voltage drops significantly below the calculated value. Use an operational amplifier buffer if the load impedance is too low to maintain divider accuracy.
Battery rated capacity (mAh on the label) assumes discharge to a cutoff voltage (typically 2.5-3.0 V for Li-ion, 1.0 V for alkaline). Devices with brownout reset voltages of 2.8-3.0 V stop working before the battery is fully discharged. Usable capacity is typically 80-90% of rated capacity. Apply this derating factor to battery life calculations for realistic estimates.
A series protection diode drops 0.3-0.7 V off the supply voltage. A 3.3 V system with a diode sees 2.6-3.0 V at the circuit. For 3.3 V logic that requires VCC > 2.7 V minimum, this can bring the supply dangerously close to the minimum operating voltage. Account for diode drops in power supply headroom calculations, or use a P-channel MOSFET for near-zero-drop reverse protection.
7.11 What’s Next
| Next Chapter | Why It Matters |
|---|---|
| Electronics: Doping & Diodes | Progress from passive components to active semiconductor devices — learn how doping creates diodes and transistors that enable amplification, switching, and complex IoT functionality |
| Ohm’s Law Deep Dive | Return to the foundational equations with advanced worked examples for IoT applications including heaters, motors, LED calculations, I2C pull-ups, and complete power budget analysis |
| Common Electricity Pitfalls | Avoid the most common mistakes in IoT circuit design: unit confusion, voltage drops, power limits, and AC vs DC errors |
