6 Electricity in Real IoT Circuits
electronics
electricity
6.1 Start Simple
Imagine a door sensor, an LED, and a relay sharing the same board. Each part needs the right voltage, a limited current path, and protection from the ways real wiring can be wrong. Start by naming the source, load, signal, and failure you are designing against before adding more components.
6.2 Learning Objectives
- Calculate LED current limiting resistor values using Ohm’s Law to prevent component damage in IoT circuits
- Design voltage dividers to interface 5V sensors with 3.3V microcontrollers using resistor ratio calculations
- Analyze power budget for battery-powered IoT devices by calculating duty cycles and average current consumption
- Build series and parallel resistor networks and measure voltage/current distribution using multimeters
- Select and configure passive components (resistors, capacitors, inductors) for real-world IoT applications including sensor pull-up resistors, signal filtering, and DC-DC converters
Key Concepts
- LED Current Limiting Resistor: Calculated as R = (Vsupply - Vf) / If; the LED forward voltage Vf is typically 1.8-2.0 V (red), 2.1-2.5 V (green/yellow), 3.0-3.5 V (blue/white); use If = 5-20 mA for standard indicator LEDs
- Voltage Divider for Sensor Interface: Two resistors in series produce an intermediate voltage: Vout = Vin x R2 / (R1 + R2); used to read resistive sensors (thermistors, LDRs) as voltage changes, and to drop 5 V sensor outputs to 3.3 V for MCU ADC inputs
- Pull-Up Resistor for Digital Inputs: A resistor from VCC to a digital input ensures the pin reads HIGH when no device is driving it; typical values: 4.7-10 kohm for I2C, 10-47 kohm for button inputs; prevents floating inputs from reading random values
- Battery Life Calculation: Runtime = Battery_capacity_mAh / Average_current_mA; for duty-cycled IoT devices: Iavg = Iactive x duty_fraction + Isleep x (1 - duty_fraction); essential for sizing batteries in wireless IoT sensor nodes
- Power Supply Decoupling: 100 nF ceramic capacitor in parallel with 10 uF electrolytic placed close to each IC’s power supply pins; ceramic absorbs high-frequency transients, electrolytic provides bulk charge for slow current demands; prevents supply noise from affecting circuit performance
- Fuse Protection: A fuse in series with the power supply that opens (breaks) when current exceeds its rated value; prevents fire and board damage from short circuits and overcurrent conditions; fuse current rating should be 20-50% above maximum normal operating current
- Circuit Protection Diode: A series diode protecting against reverse-polarity power supply connections; simple but effective for field-deployed devices where connectors may be accidentally reversed; adds one diode forward voltage drop (0.3-0.7 V) to the supply path
- Current Measurement with Shunt Resistor: A small value resistor (0.01-1 ohm) in series with the power supply enables current measurement via voltage sensing: I = V_shunt / R_shunt; allows monitoring of battery current without expensive current sensor ICs in low-cost IoT applications
For Beginners: Passive Components
Resistors, capacitors, and inductors are the three basic building blocks found in almost every electronic circuit. A resistor is like a narrow section of pipe that limits water flow (limits electrical current). A capacitor is like a small tank that stores and releases water (stores and releases electrical charge). An inductor is like a heavy flywheel that resists changes in flow. Together, they shape how electricity behaves in your IoT circuits.
Time: ~12 min | Level: Intermediate | Unit: P06.C04.U09
6.3 Why This Chapter Matters
- This is the chapter where electricity stops being abstract and starts turning into wiring decisions you will actually make on a board.
- If you build IoT devices, you will repeatedly size LED resistors, create voltage dividers, estimate battery life, and choose decoupling parts. These are not edge cases; they are routine design tasks.
- A student who understands this chapter can move from “I know the formula” to “I can choose a safe part value for a real circuit.”
6.4 How To Use This Chapter
- Read the LED resistor, voltage divider, and power-budget parts in order on a first pass. Those three topics cover most beginner IoT hardware decisions.
- When a formula appears, pause and substitute one set of numbers from your own project instead of only following the book’s numbers.
- Treat the component tables as design aids, not memorization targets. The goal is to know what each part is for and when to look it up.
Chapter Roadmap
This chapter turns electricity formulas into board-level decisions:
- First you identify passive parts and why resistors, capacitors, and inductors appear in nearly every IoT circuit.
- Then you use voltage dividers to make a 5V signal safe for a 3.3V microcontroller.
- Next you apply the same ideas to LED current limiting, pull-ups, labs, and battery runtime.
- Finally you use Kirchhoff checks and practice questions to catch shared-rail, loop-voltage, and component-rating mistakes.
Checkpoints recap the decisions you have just made, and anything titled “Deep dive” is optional on a first read.
Voltage Vera
“Before you blame the code, follow the current — most ‘bugs’ are a loose ground or a wrong resistor.”
Through this chapter’s circuits and labs, Vera’s habit is predict-then-probe: compute the value, put the meter on the node, and compare.
First stop: name the passive parts before calculating with them. A resistor, capacitor, and inductor each changes circuit behavior in a different way, so the table below is a parts map for the design choices that follow.
Passive components don’t require external power and don’t generate power.
6.4.1 Comparison Table
| Component | Property | Unit | Symbol | Function | IoT Application |
|---|---|---|---|---|---|
| Resistor | Resistance | Ohm (Ω) | Limits current | LED current limiting, pull-up/down | |
| Capacitor | Capacitance | Farad (F) | Stores charge | Power smoothing, filtering | |
| Inductor | Inductance | Henry (H) | Stores magnetic energy | DC-DC converters, RF circuits |
6.4.2 Capacitors
Function: Store electrical energy as electric charge (like tiny, fast-charging batteries)
Typical Values:
- µF (microfarad): 10-6 F - Power supply decoupling
- nF (nanofarad): 10-9 F - Signal filtering
- pF (picofarad): 10-12 F - High-frequency circuits
IoT Applications:
- Smoothing power supply voltage for microcontrollers
- Filtering noise from sensor signals
- Energy storage for low-power devices
6.4.3 Inductors
Function: Store energy as magnetic fields when current flows
Typical Values:
- mH (millihenry): 10-3 H - Power inductors
- µH (microhenry): 10-6 H - RF circuits
IoT Applications:
- DC-DC converters (boost/buck regulators)
- EMI filtering
- Wireless charging coils
6.5 IoT Voltage Dividers
A voltage divider is one of the most fundamental circuits in IoT systems, allowing you to interface sensors operating at different voltages with microcontrollers. When you connect two resistors in series between a voltage source and ground, the voltage divides proportionally based on the resistor values.
Step 1: Identify the Basic Principle
Consider a 5V sensor connected to a 3.3V microcontroller. Connecting them directly would damage the microcontroller’s input pin. A voltage divider solves this:
- Signal path: 5V source, then R1 (1kΩ), then V_out, then R2 (2.2kΩ), then ground.
Step 2: Calculate the Output Voltage
The voltage divider equation determines V_out:
\[ \begin{aligned} V_{out} &= V_{in} \times \frac{R_2}{R_1 + R_2} \end{aligned} \]
For our example: \[ \begin{aligned} V_{out} &= 5V \times \frac{2.2k\Omega}{1k\Omega + 2.2k\Omega} \\ &= 5V \times \frac{2.2}{3.2} \\ &= 3.44V \end{aligned} \]
This is still slightly high for a 3.3V MCU (exceeds absolute maximum rating). Adjust R1 to 1.5kΩ:
\[ \begin{aligned} V_{out} &= 5V \times \frac{2.2k\Omega}{1.5k\Omega + 2.2k\Omega} \\ &= 5V \times \frac{2.2}{3.7} \\ &= 2.97V \end{aligned} \]
Now the signal is safely within the 0-3.3V range.
Step 3: Consider Current Draw
Voltage dividers constantly draw current (wasted power). Total resistance should be high enough to minimize current:
\[ \begin{aligned} I_{divider} &= \frac{V_{in}}{R_1 + R_2} \\ &= \frac{5V}{3.7k\Omega} \\ &= 1.35 \text{ mA} \end{aligned} \]
For battery-powered devices, increase resistor values proportionally (15kΩ + 22kΩ) to reduce current to 135 µA while maintaining the same voltage ratio.
Step 4: Account for Loading Effects
The MCU input pin has input impedance (typically >100kΩ for GPIO, ~1MΩ for ADC). If the divider resistance is too high, the input impedance creates a parallel path that affects the output voltage. General rule: keep total divider resistance below 1/10 of the input impedance.
Real-World Application Example
The DHT22 temperature/humidity sensor outputs 5V logic levels. To interface with an ESP32 (3.3V GPIO): - Use 1.8kΩ for R1 and 3.3kΩ for R2 - Output voltage: V_out = 5V x (3.3 / 5.1) = 3.24V - Divider current: 5V / 5.1kΩ = 0.98 mA - Power loss: 5V x 0.98mA = 4.9 mW
This simple two-resistor circuit protects expensive microcontrollers from overvoltage damage in mixed-voltage IoT systems.
Vera’s Probe Points
- Measure: V_out at the DHT22 divider midpoint feeding the ESP32 pin.
- Expect: 3.24 V from 5 V through 1.8 kΩ and 3.3 kΩ; 0.98 mA divider current.
- Wrong?: loading — divider resistance above about 1/10 of the pin’s input impedance drags the node off the calculated value.
Voltage Divider Value Trials
Checkpoint: Voltage Dividers
You now know:
- A 5V sensor needs level shifting before it reaches a 3.3V GPIO pin.
- The 1kΩ plus 2.2kΩ trial still gives 3.44V, while 1.5kΩ plus 2.2kΩ gives 2.97V.
- Scaling the same ratio from 1.35 mA divider current down to 135 µA matters for battery-powered devices.
6.6 Real-World Applications in IoT
Time: ~15 min | Level: Intermediate | Unit: P06.C04.U10
The divider example protected one input pin. The next question is how the same current, voltage, and resistance checks show up in ordinary IoT outputs and buses.
6.6.1 Application 1: Fan Speed Control
Concept: Adjust resistance to control motor current
6.6.2 Application 2: LED Current Limiting
Problem: LEDs will burn out if connected directly to power supply
Solution: Add a resistor to limit current
Example Calculation:
- Power supply: 5V
- LED forward voltage: 2V (typical red LED)
- Desired current: 20mA (0.02A)
\[ \begin{aligned} R &= \frac{V_{supply} - V_{LED}}{I} \\ &= \frac{5V - 2V}{0.02A} \\ &= 150\Omega \end{aligned} \]
Use a 150Ω or 220Ω resistor (standard value)
6.6.3 Application 3: Sensor Pull-up Resistors
Why needed: Many IoT sensors have open-drain outputs that need pull-up resistors
Typical values: 4.7kΩ or 10kΩ
Application: I2C communication (covered in Chapter 4)
Checkpoint: Everyday Applications
You now know:
- A red LED on a 5V supply with a 2V forward drop and 20 mA target current needs about 150Ω.
- A 150Ω or 220Ω standard resistor is the practical choice in the LED example.
- I2C and button inputs use pull-ups such as 4.7kΩ or 10kΩ so idle lines do not float.
6.7 Hands-On Labs
Time: ~30 min | Level: Advanced | Unit: P06.C04.U11
You have seen the calculations; now the chapter asks you to measure them. The labs keep the same pattern: predict first, wire carefully, then compare the meter reading with the expected value.
6.7.1 Lab 1: Build Your First LED Circuit
Objective: Build a basic LED circuit with current limiting resistor.
Materials Needed (or use TinkerCAD simulator):
- 1× LED (any color)
- 1× 220Ω resistor
- 1× Push button switch
- 1× 9V battery (or 5V USB power)
- Breadboard and jumper wires
Circuit Diagram:
Instructions:
- Connect resistor to positive battery terminal
- Connect LED positive (long leg) to other end of resistor
- Connect LED negative (short leg) to one terminal of button
- Connect other button terminal to battery negative
- Press button → LED lights up!
Measurements to Record:
- Measure voltage across the LED using multimeter
- Measure current through the circuit
- Calculate and verify resistance using Ohm’s Law
Expected Learning:
- Current only flows when circuit is complete
- Resistor limits current to safe level for LED
- Practice reading circuit diagrams
- Verify Ohm’s Law with real measurements
6.7.2 Sensor Voltage Divider Lab
Objective: Create a voltage divider to scale down 5V to 3.3V for microcontroller ADC input.
Materials Needed:
- 1× 1kΩ resistor (R1)
- 1× 2kΩ resistor (R2)
- 1× 5V power supply (or USB)
- Multimeter
- Breadboard and jumper wires
Circuit Diagram:
Instructions:
- Connect R1 (1kΩ) from 5V to middle point
- Connect R2 (2kΩ) from middle point to ground
- Measure output voltage at middle point
- Calculate expected voltage: \(V_{out} = 5V \times \frac{2kΩ}{1kΩ + 2kΩ} = 3.33V\)
- Compare calculated vs measured values
Expected Learning:
- Voltage dividers reduce voltage proportionally
- Essential for interfacing 5V sensors with 3.3V microcontrollers
- Predict output voltage from resistor ratio values
Extension:
- Try different resistor values (4.7kΩ and 10kΩ)
- Calculate current through the divider
- Determine power dissipation
6.7.3 IoT Power Budget Lab
Objective: Calculate total power consumption and estimate battery life for a battery-powered IoT sensor.
Scenario: Environmental sensor with these components: - ESP32 microcontroller: 160mA active, 10µA deep sleep - DHT22 sensor: 1.5mA when reading - LoRa radio: 120mA transmit, 15mA receive, 1µA sleep - Status LED: 20mA when on
Operating cycle (every 5 minutes):
- Wake from sleep (0.1s)
- Read sensor (2s)
- Transmit data (0.5s)
- Return to sleep (297.4s)
Instructions:
- Calculate duty cycles:
- Active time: 2.6s per 300s = 0.87%
- Sleep time: 297.4s per 300s = 99.13%
- Calculate average current for each component:
- ESP32: (160mA × 0.0087) + (0.01mA × 0.9913) = 1.40mA
- DHT22: 1.5mA × (2/300) = 0.01mA
- LoRa: (120mA × 0.5/300) + (0.001mA × 299.5/300) = 0.20mA
- LED: 20mA × (0.5/300) = 0.03mA
- Total average: 1.64mA
- Calculate battery life:
- Battery: 2000mAh Li-ion (3.7V)
- Battery life: 2000mAh / 1.64mA ≈ 1220 hours ≈ 51 days
- Use Python PowerBudget calculator to verify
Expected Learning:
- Duty cycle dramatically affects battery life
- Sleep modes are critical for IoT devices
- Power budget analysis guides component selection
Vera’s Probe Points
- Measure: the node’s supply current across one full 5-minute cycle.
- Expect: 1.64 mA average, so the 2000 mAh battery gives about 1220 hours — 51 days.
- Wrong?: a sleep mode not engaging — the ESP32 at 160 mA active versus 10 µA asleep is the whole budget.
Checkpoint: Lab Evidence
You now know:
- The voltage-divider lab predicts 3.33V from 5V using 1kΩ and 2kΩ resistors.
- The power-budget lab turns a 5 minute cycle into 1.64 mA average current.
- A 2000 mAh battery at that average current is about 1220 hours, or about 51 days.
6.7.4 Series vs Parallel Lab
Interactive Challenges:
Try these experiments:
- Series Resistance Challenge: Set all three resistors to 1kΩ. Confirm that the series total becomes 3kΩ and the source current drops to about 1.67mA at 5V.
Hint
For series: R_total = R1 + R2 + R3 = 1kΩ + 1kΩ + 1kΩ = 3kΩ. Resistances simply add up in series. - Parallel Resistance Challenge: Keep all three resistors at 1kΩ and compare the parallel total. Is it higher or lower than one resistor by itself?
Hint
For equal resistors in parallel: R_total = R / n = 1kΩ / 3 ≈ 333Ω. Parallel resistance is always LOWER than any individual resistor. - Current Distribution Challenge: Change only R3 to 2.2kΩ. Watch what happens to current in series versus current in each parallel branch. What pattern do you see?
Hint
Series: Current is the SAME everywhere (Kirchhoff’s Current Law). Parallel: Current DIVIDES among branches, but sum equals total current. - Voltage Division Challenge: Make R1 = 470Ω, R2 = 1kΩ, and R3 = 2.2kΩ. Compare the voltage across each resistor in series, then compare that with the parallel case.
Hint
Series: total resistance is 470Ω + 1kΩ + 2.2kΩ = 3.67kΩ, so current is about 1.36mA. Voltage drops are proportional to resistance: about 0.64V, 1.36V, and 3.00V. Parallel: each resistor still has the full 5V across it, but branch currents differ.
Part A: Series Configuration
Instructions:
- Connect three 1kΩ resistors in series
- Measure total resistance: Expected = 3kΩ
- Calculate current: I = 5V / 3kΩ = 1.67mA
- Measure voltage across each resistor (should be ~1.67V each)
Part B: Parallel Configuration
Instructions:
- Connect three 1kΩ resistors in parallel
- Measure total resistance: Expected = 333Ω (1kΩ/3)
- Calculate total current: I = 5V / 333Ω = 15mA
- Measure current through each resistor (should be ~5mA each)
Comparison Table:
| Configuration | Total Resistance | Total Current | Voltage per Resistor | Current per Resistor |
|---|---|---|---|---|
| Series | 3kΩ | 1.67mA | 1.67V | 1.67mA |
| Parallel | 333Ω | 15mA | 5V | 5mA |
Expected Learning:
- Series: Resistance adds, current stays same
- Parallel: Resistance decreases, current divides
- Determine when to use each configuration in IoT circuits
The series and parallel lab showed how current and voltage split in small networks. The next layer is to use Kirchhoff’s Laws when several real loads share the same supply.
6.8 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.
6.8.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.
6.8.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.
6.8.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:
\[ \begin{aligned} I_{total} &= I_{ESP32} + I_{BME280} \\ &\quad + I_{LED} + I_{pullups} \end{aligned} \]
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):
\[ \begin{aligned} I_{pullup} &= \frac{V}{R} \\ &= \frac{3.3V}{4.7\text{k}\Omega} \\ &= 0.70 \text{ mA per line} \end{aligned} \]
Both lines pulled low simultaneously (worst case):
\[ \begin{aligned} I_{pullups} &= 2 \times 0.70 \\ &= 1.4 \text{ mA} \end{aligned} \]
Total 3.3V rail current:
\[ \begin{aligned} I_{total} &= 80 + 1 + 10 + 1.4 \\ &= 92.4 \text{ mA} \end{aligned} \]
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:
\[ \begin{aligned} V_{supply} - V_{resistor} - V_{LED} &= 0 \end{aligned} \]
\[ \begin{aligned} 3.3V - V_{resistor} - 2.1V &= 0 \end{aligned} \]
\[ \begin{aligned} V_{resistor} &= 3.3V - 2.1V \\ &= 1.2V \end{aligned} \]
Now find the resistor value for 10 mA:
\[ \begin{aligned} R &= \frac{V_{resistor}}{I_{LED}} \\ &= \frac{1.2V}{0.01A} \\ &= 120\Omega \end{aligned} \]
Use a standard 120 Ohm resistor. Verify power dissipation:
\[ \begin{aligned} P_{resistor} &= I^2 \times R \\ &= (0.01)^2 \times 120 \\ &= 0.012 \text{ W} \end{aligned} \]
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:
\[ \begin{aligned} V_{battery} - V_{dropout} - V_{output} &= 0 \end{aligned} \]
\[ \begin{aligned} V_{battery(min)} &= V_{dropout} + V_{output} \\ &= 1.0V + 3.3V \\ &= 4.3V \end{aligned} \]
But a LiPo battery drops to 3.0V when discharged. At 3.5V battery:
\[ \begin{aligned} V_{available} &= 3.5V - 3.3V \\ &= 0.2V < 1.0V \text{ dropout} \end{aligned} \]
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:
\[ \begin{aligned} \text{Battery life} &= \frac{7.4 \text{ Wh}}{1.055 \text{ W}} \\ &\approx 7 \text{ hours} \end{aligned} \]
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.
Key Takeaway from Kirchhoff’s Laws
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.
6.9 Quiz 3
Test your understanding of electricity fundamentals with these questions.
Key Takeaway
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.
For Kids: Meet the Sensor Squad!
Sammy the Sensor and friends learn about building real circuits!
Sammy the Sensor was excited – today was Build Day! The Sensor Squad was going to build their very first LED circuit. “First, we need a resistor,” said Max the Microcontroller, holding up a tiny striped cylinder. “Without it, Lila could get hurt!”
Lila 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.”
Bella 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!”
6.9.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 |
6.10 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.
6.11 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.
Chapter Summary
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.
6.12 Practice: Match and Order
6.13 See Also
Within This Module:
- 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:
- 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:
- 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 reference for power circuit design
Common Pitfalls
LED Resistor Current Error
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.
2. Voltage Divider Loading Error
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 vs Usable Capacity
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.
Reverse Diode Voltage Drop
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.
6.14 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 |
