3  Electricity Introduction

3.1 Learning Objectives

By the end of this section, you will be able to:

  • Explain Electrical Basics: Describe current, voltage, and resistance and their roles in IoT circuits
  • Apply Ohm’s Law: Calculate voltage, current, resistance, and power using V=IR and P=VI
  • Read Circuit Diagrams: Interpret schematic symbols and trace signal connections
  • Compare Components: Differentiate between resistors, capacitors, and inductors by function and application
  • Design Simple Circuits: Select and size components for IoT hardware using electrical principles
In 60 Seconds

Electricity flows as electrons moving through conductors from high potential (voltage) to low potential (ground). Three fundamental quantities govern all electrical circuits: voltage (V, potential difference — the ‘push’), current (I, amperes — the flow rate), and resistance (R, ohms — opposition to flow). These three relate through Ohm’s Law: V = I x R. Power dissipated is P = V x I. Master these two equations and you can analyze any resistive IoT circuit.

3.2 Prerequisites

Before diving into this chapter, you should be familiar with:

  • Basic Physics Concepts: Understanding atoms, electrons, and the concept of electric charge is helpful for grasping how electricity works at the fundamental level
  • Basic Mathematics: Familiarity with algebra and working with equations (solving for variables) is essential for applying Ohm’s Law and power calculations
  • IoT Reference Models: Basic awareness of IoT system architecture helps you understand where electrical principles apply in the hardware and device layer

3.3 For Kids: Electricity is Like Magic Water!

Imagine tiny invisible water drops flowing through wires!

3.3.1 The Magic River Inside Wires

Electricity is like a river of teeny-tiny invisible drops called electrons. They flow through wires like water flows through pipes!

Here’s a fun way to understand it:

Water World Electricity World
Water in a tank Batteries or power outlets
Water pipes Wires
Water pump pushing hard Voltage (how hard electrons push)
How much water flows Current (how many electrons flow)
A narrow part of the pipe Resistance (makes it harder to flow)

3.3.2 A Story About Light Bulb Village

Once upon a time, there was a village called Light Bulb Village. The villagers needed energy to glow! There was a magical mountain called Battery Mountain that pushed tiny glowing particles called electrons down through wire rivers to the village.

When Battery Mountain pushed really hard (high voltage), lots of electrons flowed and the light bulbs glowed super bright! When it pushed gently (low voltage), fewer electrons flowed and the bulbs were dimmer.

Some wire rivers were wide and smooth - electrons loved flowing through those! But some were narrow and bumpy (high resistance) - electrons had a harder time getting through.

3.3.3 Try This at Home!

Make a “Circuit” With Your Friends:

  1. Stand in a circle holding hands
  2. One person is the “Battery” - they squeeze the hand of the person next to them
  3. That person passes the squeeze to the next person
  4. The squeeze goes around the circle and back to the battery!

That’s how electricity works! The squeeze is like voltage, and it flows all the way around (a circle = a circuit).

3.3.4 Why Do IoT Devices Need Electricity?

Every smart device needs electricity to: - Think (the brain chip needs power) - Talk (sending messages uses energy) - Feel (sensors need a tiny bit of power) - Remember (saving information takes power)

That’s why batteries are so important for sensors that aren’t plugged in!

3.3.5 Key Words for Kids

Word What It Means
Electricity Invisible energy that flows through wires
Electron A teeny-tiny particle that carries electricity
Battery A container that stores electrical energy
Wire A path for electricity to flow through
Circuit A complete loop that electricity can flow around
Voltage How hard electricity is pushed (like water pressure)

3.3.6 Fun Fact!

Did you know? A single AA battery pushes electricity with 1.5 volts - just enough to make a small LED glow! But the outlet in your wall pushes with 120 volts (in the US) or 230 volts (in Europe) - that’s why we never touch outlets!

3.4 How It Works: Electrical Current Flow in Circuits

Understanding how electricity actually flows through a circuit is essential for debugging IoT hardware and designing reliable systems. Let’s trace the complete path.

Step 1: The Complete Circuit Loop

Electricity only flows when there is a complete path from the power source’s positive terminal, through the components, and back to the negative terminal. Break this loop anywhere and current stops instantly.

Consider a simple LED circuit:

Battery (+) → Current-limiting resistor → LED → Battery (-)

Step 2: Electron Movement (Microscopic View)

At the atomic level, free electrons in the conductor (copper wire) drift from the negative terminal toward the positive terminal. Think of it like a bicycle chain: - The battery is the pedal mechanism pushing the chain - The wire is the chain itself - Each electron pushes the one in front of it - The entire “chain” starts moving almost instantly (at nearly the speed of light)

Individual electrons move slowly (~1 mm/second), but the electrical signal propagates almost instantly because the push travels through all electrons simultaneously.

Step 3: Voltage Creates the “Push”

Voltage is the electrical potential difference that drives electron flow. A 9V battery has a chemical reaction inside that separates positive and negative charges, creating electrical “pressure”: - The negative terminal has excess electrons (like a full water tank) - The positive terminal has a deficit of electrons (like an empty tank) - When connected by a conductor, electrons flow from high to low potential (full to empty)

Higher voltage = stronger push = more current (if resistance stays constant).

Step 4: Resistance Limits the Flow

Every component in the circuit resists electron flow to some degree: - Conductors (wires): Very low resistance (~0.02Ω per meter for typical hookup wire) - electrons flow easily - Resistors: Medium resistance (1Ω to 10MΩ) - intentionally limit current - Insulators (air, plastic): Extremely high resistance (>10^12Ω) - block current almost completely

The resistor in an LED circuit acts like a narrow section of pipe: it reduces current to a safe level (typically 10-20 mA) to prevent LED burnout.

Step 5: Energy Transformation

As electrons flow through components, electrical energy converts to other forms: - Resistors: Electrical → Heat (I²R power dissipation) - LEDs: Electrical → Light + Heat - Motors: Electrical → Kinetic motion + Heat - Sensors: Electrical → Signal (measurement)

This energy transformation is why batteries drain: chemical potential energy converts to electrical energy, which then converts to useful work (light, motion, computation) plus waste heat.

Real-World IoT Example: ESP32 Boot Sequence

When you power on an ESP32 microcontroller: 1. t=0 ms: 3.3V applied to VDD pin 2. t=0-1 ms: Electrons flow through internal voltage regulators and power distribution network 3. t=1-5 ms: Decoupling capacitors charge up (stabilize voltage against current surges) 4. t=5-10 ms: Reset circuit releases, CPU clock starts 5. t=10-200 ms: CPU executes bootloader, current draw rises from 10 mA to 80 mA 6. t=200+ ms: Main program runs, current varies based on WiFi/Bluetooth activity (80-240 mA peaks)

Throughout this sequence, Ohm’s Law governs every connection: V=IR ensures that voltage drops occur across resistive elements, and Kirchhoff’s Current Law ensures that current flowing into every node equals current flowing out.

ESP32 boot current surge demonstrates why decoupling capacitors matter:

During startup, ESP32 current draw jumps from 10mA to 240mA in <1ms as the Wi-Fi radio initializes. Without a local capacitor, wires and power supply can’t respond fast enough, causing voltage to sag.

Calculate the required decoupling capacitance:

Voltage must stay above 3.0V minimum (ESP32 brownout threshold). Allow 0.2V droop:

\[\Delta V = 0.2V\]

\[\Delta I = 240mA - 10mA = 230mA = 0.23A\]

\[\Delta t = 1ms = 0.001s\]

Using \(Q = C \times \Delta V\) and \(I = \frac{Q}{\Delta t}\):

\[C = \frac{I \times \Delta t}{\Delta V} = \frac{0.23A \times 0.001s}{0.2V} = 0.00115 F = 1150 \mu F\]

Why the practical value is smaller: The 1150µF assumes the capacitor is the only current source during the transient. In reality, the power supply continues delivering current — the capacitor only supplements the shortfall during the supply’s response time (~100µs, not 1ms). A practical ESP32 design uses 100µF bulk electrolytic + 10µF ceramic + 0.1µF bypass capacitors close to the VDD pin. The ceramic capacitors handle the fast transients while the bulk cap handles slower sags.

Try it yourself — adjust the parameters:


3.5 Most Valuable Understanding (MVU)

MVU: Electricity - The Foundation of All IoT

Core Concept: Electricity is the controlled flow of electrons through conductors. The relationship V = I x R (Ohm’s Law) and P = V x I (Power Law) govern every electrical circuit in IoT devices.

Why It Matters: Every IoT device - from the smallest sensor to the most powerful edge gateway - runs on electricity. Without understanding voltage, current, resistance, and power, you cannot: - Select appropriate power supplies (batteries, solar, mains) - Size current-limiting resistors for LEDs and GPIO protection - Calculate battery life for field-deployed sensors - Debug why your circuit draws too much current or gets hot

Key Takeaway: Master V = IR (Ohm’s Law) and P = VI (Power Law). With just these two equations, you can analyze any resistive circuit, calculate component values, estimate power consumption, and determine battery life.

3.6 Getting Started (For Beginners)

New to Electricity? Start Here!

If terms like “voltage,” “current,” or “Ohm’s Law” sound intimidating, this section will make them crystal clear with everyday analogies.

3.6.1 Understanding Electricity: The Water Analogy

The easiest way to understand electricity is to think of it like water flowing through pipes:

Electrical circuit diagram showing water system analogy with water tank representing voltage (pressure), pipe representing conductor, and narrow pipe section representing resistance, illustrating how voltage, current, and resistance relationships work similarly to water flow in pipes

Water-electricity analogy diagram comparing water pressure to voltage, water flow to current, and pipe restriction to resistance
Figure 3.1

This decision tree variant helps you calculate and manage power consumption for battery-powered IoT devices - a critical practical application of electrical concepts.

Decision tree for IoT power budget showing how Power P equals V times I determines battery life, with key insight that sleep current in microamp range and duty cycle matter more than peak current, demonstrating that an ESP32 drawing 80mA continuously lasts only 12 hours but sleeping 99 percent of the time extends battery life to years

Practical application of Ohm’s Law for IoT power budgeting
Figure 3.2

Hierarchical diagram showing voltage as the CAUSE that pushes electrons, resistance OPPOSES the flow, current is the EFFECT representing actual electron movement, and power is the RESULT showing energy consumed, helping troubleshoot circuits by checking voltage source first then resistance path

Cause-and-effect view of electrical units hierarchy
Figure 3.3
Water Concept Electrical Equivalent Unit What It Means
Water pressure Voltage (V) Volts How hard electrons are “pushed”
Water flow rate Current (I) Amps How many electrons flow per second
Pipe narrowness Resistance (R) Ohms How much the flow is restricted

3.6.2 The Three Key Relationships

1. Higher pressure → More flow (Higher voltage → More current)

Low Voltage (3.3V)     High Voltage (12V)
    ─ ─ ─ → →           ═══════════→ → →
    Dim LED              Bright LED

2. Narrower pipe → Less flow (Higher resistance → Less current)

Low Resistance (100Ω)    High Resistance (10kΩ)
    ══════════→ → →        ─ ─ ─ →
    Bright LED             Dim LED

3. Ohm’s Law: V = I × R (The fundamental equation!)

Ohm's Law triangle diagram showing V for Voltage in Volts at the top, with I for Current in Amps and R for Resistance in Ohms at the bottom, displaying the three formulas V equals I times R, I equals V divided by R, and R equals V divided by I for understanding sensor power requirements and circuit fundamentals in IoT applications

Ohm’s Law triangle showing the relationship between Voltage, Current, and Resistance
Figure 3.4

3.6.3 Real-World IoT Example: LED Circuit

You want to light an LED with an Arduino (5V output). LEDs typically need 2V and 20mA.

LED circuit diagram showing 5V Arduino Pin output connected to a 150 ohm resistor then to an LED with 2V forward voltage drop, demonstrating practical application of Ohm's Law to calculate the resistor value needed to limit current to 20mA for safe LED operation

LED circuit diagram showing Arduino output with current-limiting resistor
Figure 3.5

3.6.4 Self-Check: Understanding the Basics

Before continuing, make sure you can answer:

  1. If voltage increases, what happens to current? → Current increases (assuming resistance stays same)
  2. What does resistance do? → Limits/reduces current flow
  3. How do you calculate power? → P = V × I (Watts = Volts × Amps)
  4. Why do we need resistors with LEDs? → To limit current and prevent burning out the LED
Why Electricity Matters for IoT

Every IoT device runs on electricity. Sensors, microcontrollers, communication modules, actuators - all require electrical power and understanding electrical principles. Without electricity, there is no IoT.

🔗 Cross-Hub Connections

Explore Related Learning Resources:

  • Simulations Hub: Try the interactive circuit simulators (TinkerCAD, Wokwi) to visualize current flow, test Ohm’s Law, and experiment with component values without physical hardware
  • Videos Hub: Watch curated video tutorials on electrical fundamentals, including SparkFun’s “Voltage, Current, Resistance” and ElectroBOOM’s entertaining electricity explanations
  • Quizzes Hub: Test your understanding of Ohm’s Law, power calculations, and circuit analysis with interactive quiz banks organized by difficulty level
  • Knowledge Gaps Hub: Address common misconceptions about current flow direction, voltage vs current confusion, and parallel vs series resistance calculations

Why These Connections Matter: Electricity is the foundation of all IoT systems. Interactive simulations help visualize abstract concepts like electron flow, while video tutorials provide alternative explanations for difficult topics. Regular quiz practice reinforces calculation skills essential for circuit design.

⚠️ Common Misconception: “Higher Voltage Always Means More Danger”

The Misconception: Many beginners believe that voltage alone determines electrical danger, leading to fear of any high-voltage circuit.

The Reality: Current through the body causes harm, not voltage alone. A 10,000V static shock (0.001 mA, <1 µJ) causes discomfort but no injury, while 120V AC mains (100 mA through the heart) can be fatal.

Real-World Impact: In a 2019 incident, an IoT developer working with a 12V/30A power supply for LED strips received severe burns when a short circuit sent 25A through a screwdriver, which heated to 800°C in 0.5 seconds. The “low voltage” system delivered 360W of power (P = 12V × 30A), enough to weld metal. Meanwhile, the developer safely handled 5,000V piezoelectric igniters (used in IoT gas sensors) because they deliver only 0.001 mA.

Key Formula: Danger = Current × Duration. Human threshold: 1 mA (tingling), 10 mA (cannot let go), 100 mA (ventricular fibrillation). Even 5V USB can deliver 3A (enough to start fires in shorted cables).

Takeaway: Respect amperage ratings and power calculations (P = V × I), not just voltage numbers. A 5V/20A power supply is far more dangerous than a 100V/10 mA source.

Key Concepts
  • Current (I): Flow of electric charge measured in Amperes (A); the rate at which electrons move through a conductor
  • Voltage (V): Electric potential difference measured in Volts (V); the “pressure” that pushes electrons through a circuit
  • Resistance (R): Opposition to current flow measured in Ohms (Ω); determines how much current flows for a given voltage
  • Ohm’s Law: Fundamental relationship V = I × R relating voltage, current, and resistance in electrical circuits
  • Power (P): Rate of energy consumption measured in Watts (W); calculated as P = V × I
  • Series vs Parallel: Circuit configurations affecting total resistance and voltage/current distribution
Key Takeaway

In one sentence: V = IR and P = VI are the two equations that govern every electrical circuit–master them and you can design any IoT power system.

Remember this rule: Current kills, not voltage alone–always calculate both voltage AND current capacity when assessing circuit safety and component ratings.


3.7 What is Electricity?

⏱️ ~8 min | ⭐ Foundational | 📋 P06.C04.U01

Electricity is a form of energy - specifically, the energy associated with the movement of electrons between atoms.

3.7.1 Types of Energy

Before diving into electricity, let’s understand the broader context. Energy can be classified into six types:

Type Examples IoT Relevance
Mechanical Windmills, gears, motors Actuators, moving parts
Chemical Batteries, fuel cells Power sources
Electrical Circuits, sensors, microcontrollers Core of all IoT devices
Radiant Solar panels, LEDs, lasers Energy harvesting, displays
Nuclear Not typically used in IoT -
Sound Acoustic sensors, speakers Audio IoT applications

Key Principle: Energy cannot be created or destroyed, only transformed. IoT devices constantly transform energy from one form to another (chemical → electrical → light/motion/data).

3.7.2 IoT Energy Transformation Chain

This diagram shows how energy flows through a typical IoT system, transforming from one form to another at each stage.

Energy transformation chain in a typical IoT system showing chemical energy from batteries, radiant energy from solar panels, or AC mains power converting through regulators to DC electricity that powers processing, sensing, communication, and actuation subsystems.
Figure 3.6: Energy transformation chain in an IoT system showing how chemical, radiant, or AC power converts to regulated DC electricity that powers processing, sensing, communication, and actuation.

3.8 Atoms and Electrons

⏱️ ~10 min | ⭐ Foundational | 📋 P06.C04.U02

Understanding electricity requires understanding atomic structure.

Atomic structure diagram showing the nucleus at center containing positive protons and neutral neutrons, surrounded by electron shells with orbiting negative electrons, illustrating the fundamental structure that enables electrical conduction when outer electrons move between atoms

Atomic structure diagram showing nucleus and electron shells
Figure 3.7

Key Components:

  • Protons (+): Positively charged particles in the nucleus
  • Neutrons (neutral): Neutral particles in the nucleus
  • Electrons (-): Negatively charged particles orbiting the nucleus

The electron cloud occupies a volume 10,000× larger than the nucleus!

Detailed cross-section diagram of atomic structure showing central nucleus containing protons and neutrons, surrounded by multiple electron orbital shells at increasing distances, with electrons depicted as small particles orbiting the nucleus
Figure 3.8: The structure of an atom showing nucleus and electron shells

3.8.1 How Electricity Works

Electricity occurs when electrons jump from one atom to another.

Electron flow diagram showing electrons jumping from Atom 1 with excess electrons to Atom 2 to Atom 3, demonstrating how electric current flows through a conductor as electrons move from atom to atom, from areas of excess negative charge toward areas of positive charge

Electron flow diagram showing movement through a conductor
Figure 3.9

Electrical Charge:

  • Negative (-): Material with excess electrons
  • Positive (+): Material with deficit of electrons
Schematic illustration of electron flow in a complete electrical circuit, showing electrons moving from negative terminal through conductor to positive terminal, with arrows indicating direction of electron movement and conventional current flow
Figure 3.10: Electron flow in an electrical circuit
  • Electrical Potential: The difference in charge between two points

Nature seeks equilibrium: Electrons flow from negative to positive, balancing the charge difference.

Important Convention

Physically: Electrons flow from negative (-) to positive (+) By Convention: We analyze circuits as if current flows from positive (+) to negative (-)

This historical convention is used in all circuit analysis and design.


3.9 The Big Three: Current, Voltage, Resistance

⏱️ ~12 min | ⭐⭐ Intermediate | 📋 P06.C04.U03

3.9.1 Electric Current (I)

Definition: The flow of electrons between atoms, measured in Amperes (A).

  • 1 Ampere = 1 Coulomb of charge flowing per second
  • 1 Coulomb = 6.24 × 1018 electrons (6.24 quintillion!)

Water Analogy: Think of current like water flowing through a pipe - the amount of water flowing per second.

3.9.2 Voltage (V)

Definition: The difference in electric charge between two points, measured in Volts (V).

  • Greater voltage = greater “pressure” pushing electrons
  • Creates the “force” that drives current flow

Water Analogy: Think of voltage like water pressure - the higher the pressure difference, the more water flows.

3.9.3 Resistance (R)

Definition: The opposition to current flow in a material, measured in Ohms (Ω).

  • Good conductors (copper, gold): Low resistance
  • Insulators (rubber, plastic): High resistance
  • Resistors: Components specifically designed to provide resistance

Water Analogy: Think of resistance like pipe diameter - narrow pipes resist flow more than wide pipes.

3.9.4 The Fundamental Equations

These two equations are the foundation of all electrical circuit analysis:

Key electrical equations reference showing Ohms law, power formula, and Kirchhoffs laws
Figure 3.11: The two fundamental equations (V=IR and P=VI) and their derived forms, with practical IoT calculation examples.

3.9.5 Series vs Parallel Circuits

Understanding series and parallel configurations is essential for IoT circuit design:

Comparison of series and parallel circuit configurations showing that series circuits share the same current with voltages adding up, while parallel circuits share the same voltage with currents adding up, including formulas for total resistance in each configuration.
Figure 3.12: Series vs parallel circuit configurations showing how resistance, voltage, and current behave differently in each topology.

3.10 Worked Example: Designing Power for a LoRa Weather Station

Scenario: You are building a battery-powered LoRa weather station that reads temperature, humidity, and barometric pressure every 10 minutes and transmits the data. The station runs from a 3.7V LiPo battery charged by a small solar panel.

Step 1: Identify the current draw of each component

Component Active Current Sleep Current Active Duration
ESP32 (processing) 80 mA 10 uA 500 ms
BME280 sensor (reading) 0.35 mA 0.1 uA 50 ms
SX1276 LoRa TX (14 dBm) 120 mA 0.2 uA 200 ms
Voltage regulator quiescent 5 uA 5 uA Always

Step 2: Calculate energy per measurement cycle (10 min = 600 s)

Active phase (sequential worst case):
  ESP32 wakes:    80 mA × 0.5 s = 40 mAs
  Sensor reads:   0.35 mA × 0.05 s = 0.018 mAs
  LoRa transmits: 120 mA × 0.2 s = 24 mAs
  Active total:   64.02 mAs ≈ 64 mAs

Sleep phase (remaining 599.25 s):
  ESP32 deep sleep: 10 uA × 599.25 s = 5.99 mAs
  BME280 standby:   0.1 uA × 599.25 s = 0.06 mAs
  SX1276 sleep:     0.2 uA × 599.25 s = 0.12 mAs
  Regulator:        5 uA × 599.25 s = 3.00 mAs
  Sleep total:      9.17 mAs

Total per cycle: 64 + 9.17 = 73.17 mAs
Average current: 73.17 mAs / 600 s = 0.122 mA = 122 uA

Step 3: Calculate battery life

Battery: 2000 mAh LiPo (3.7V nominal)
Usable capacity at 80% DoD: 1600 mAh
Battery life = 1600 mAh / 0.122 mA = 13,115 hours = 547 days ≈ 18 months

Step 4: Verify the voltage regulator

The ESP32 requires 3.3V. Using a low-dropout (LDO) regulator:

LiPo voltage range: 4.2V (full) to 3.0V (empty)
LDO dropout voltage: 0.3V (typical for MCP1700)
Minimum input: 3.3V + 0.3V = 3.6V

Problem: LiPo drops below 3.6V at ~20% charge remaining.
Solution: Use a buck-boost converter (TPS63001) that works
from 1.8V-5.5V input, or accept 80% DoD (battery cutoff at 3.6V).

Step 5: Calculate the current-limiting resistor for a status LED

You want a green LED (Vf = 2.1V, 5 mA brightness) powered from the 3.3V rail:

R = (V_supply - V_forward) / I_LED
R = (3.3V - 2.1V) / 5 mA
R = 1.2V / 0.005A = 240 ohms

Nearest standard value: 220 ohm (gives 5.5 mA — safe)
Power dissipated by resistor: P = I² × R = (0.0055)² × 220 = 6.6 mW (negligible)

Key insight: The LoRa transmission (120 mA for 200 ms) consumes 33% of each cycle’s energy budget despite lasting only 0.03% of the time. This is the “million-to-one rule” in action – wireless transmission dominates energy consumption in IoT devices.

Estimate how long your battery-powered IoT device will last:

Connection: Electricity Fundamentals Meet Energy-Aware Design

The power calculations in this example (P = V x I, battery life = capacity / average current) are the same formulas used in professional IoT energy budgeting. See the Energy-Aware Design chapter series for deeper coverage of duty cycling, energy harvesting, and power profiling techniques.


3.11 Knowledge Checks

Test your understanding of electricity fundamentals with these interactive questions.

3.11.1 Match the Electrical Concept

Match each electrical concept to its correct definition:

3.11.2 Order the Circuit Analysis Steps

Place these steps for analyzing an IoT circuit power budget in the correct order:


3.12 Resistors

⏱️ ~10 min | ⭐ Foundational | 📋 P06.C04.U04

Resistors are passive components that control current flow in circuits.

Practical Ohm's Law applications diagram for IoT circuits showing four common scenarios: LED current limiting resistor calculation (Vsupply - Vforward) / I_desired, voltage divider for sensor level shifting with R1 and R2 formula Vout = Vin x R2/(R1+R2), pull-up resistor sizing for I2C bus with typical values 4.7k-10k ohms, and power dissipation calculation P = I squared times R with heat sink considerations. Each scenario includes circuit schematic, component values, and step-by-step calculation example.

Ohm’s Law applications in IoT circuits
Figure 3.13: AI-generated Ohm’s Law practical applications for IoT circuit design

Understanding Ohm’s Law (V = I x R) is fundamental to designing every IoT circuit. From calculating LED resistor values to sizing pull-ups for I2C buses, these calculations determine whether your circuits work reliably or fail in the field.

Common Resistor Types:

Type Application Range
Carbon Film General purpose 1Ω - 10MΩ
Metal Film Precision circuits 0.1Ω - 1MΩ
Wire Wound High power 0.01Ω - 100kΩ
Surface Mount (SMD) Compact PCBs 0.1Ω - 10MΩ
Variable (Potentiometer) Adjustable resistance 100Ω - 1MΩ

Circuit Symbols:

Collection of various resistor types including carbon film resistors with color bands, metal film precision resistors, large wire-wound power resistors, small surface-mount SMD resistors, and adjustable potentiometers showing different sizes and form factors
Figure 3.14: Different kinds of resistors
Standard electrical schematic symbols for resistors showing American zigzag style symbol and international rectangular box symbol, plus variable resistor arrow notation and photoresistor light-sensitive symbol
Figure 3.15: Common symbols for resistors in circuit diagrams
Collection of basic electrical circuit schematic diagrams showing series and parallel configurations with batteries, resistors, switches, and loads, using standard electrical symbols and connection lines
Figure 3.16: Electric circuit diagrams and schematics

Comprehensive resistor types comparison diagram showing fixed resistors including carbon film and metal film for general purpose and precision applications, variable resistors like potentiometers and trimmers for adjustable settings, and specialized resistors such as thermistors and photoresistors for sensing applications, with typical resistance ranges and IoT use cases

Resistor types comparison showing fixed, variable, and specialized resistors
Figure 3.17

Diagram showing four main resistor purposes in IoT circuits: PROTECTION for current limiting LEDs and GPIO pins, SENSING using variable resistance sensors for temperature light and force measurements, SIGNAL CONDITIONING with voltage dividers and pull-up resistors for logic level conversion, and CALIBRATION using trimmers for one-time adjustments during manufacturing

IoT application view of resistor purposes
Figure 3.18

3.13 Circuit Diagrams

⏱️ ~8 min | ⭐ Foundational | 📋 P06.C04.U05

Circuit diagrams (schematics) are visual representations of electrical circuits using standardized symbols.

3.13.1 Basic Circuit Example: Light Switch

Simple light switch circuit diagram showing a battery providing voltage, a switch that can be open or closed, and a lamp as the load, demonstrating that when the switch is open no current flows and the lamp is OFF, but when the switch is closed the circuit is complete and current flows lighting the lamp

Simple light switch circuit diagram
Figure 3.19

How it works:

  • Switch Open: No path for electrons → Lamp OFF
  • Switch Closed: Complete circuit → Current flows → Lamp ON

SparkFun Tutorial: How to Read a Schematic

Learn to interpret circuit diagrams, component symbols, and connections.

(See the Ohm’s Law figures in the Resistors section above for the V=IR triangle and practical applications.)


3.14 Summary

In this chapter, we covered the essential foundations of electricity that underpin all IoT systems:

Mind map of electricity fundamentals for IoT showing voltage, current, resistance, and power concepts with their units, formulas, water analogies, and practical IoT applications including battery life calculation and GPIO current limits.
Figure 3.20: Summary mindmap of electricity fundamentals covered in this chapter, showing core concepts, laws, circuit configurations, and IoT applications.

3.14.1 Key Takeaways

  1. Voltage (V) is the electrical “pressure” that pushes electrons through a circuit, measured in Volts
  2. Current (I) is the rate of electron flow, measured in Amperes (Amps)
  3. Resistance (R) opposes current flow, measured in Ohms (Ω)
  4. Ohm’s Law (V = IR) relates these three quantities and is essential for circuit analysis
  5. Power (P = VI) tells you how much energy is consumed, critical for battery life calculations
  6. Series circuits have the same current through all components; voltages add
  7. Parallel circuits have the same voltage across all components; currents add
  8. Every IoT device depends on these principles for proper operation
Remember

The two most important equations in electronics:

  • V = I × R (Ohm’s Law) - Use this to calculate any unknown when you know the other two
  • P = V × I (Power Law) - Use this to calculate energy consumption and battery life

Master these, and you can analyze any resistive circuit!

3.14.2 Quick Verification: Applying the Power Budget Method

The LoRa Weather Station worked example above demonstrated the complete power budget method. Here’s the core formula you should remember:

Average current = (I_active × t_active + I_sleep × t_sleep) / t_cycle
Battery life    = Capacity / Average current

Rule of thumb: If duty cycle < 1%, sleep current is negligible — wireless transmission dominates the energy budget.

3.14.3 Worked Example: Motor Inrush Current

Why Your IoT Device Resets When the Motor Starts

Problem: An ESP32 controlling a 12V DC pump motor through a relay resets every time the motor turns on. The motor draws 500 mA steady-state. The power supply is rated for 2A. Why does the ESP32 reset?

Answer: Inrush current

DC motors draw 5-8x their rated current at startup (stall current) for 50-200 ms:

Steady-state current:  500 mA
Inrush current:        500 mA x 6 = 3,000 mA (3A) for ~100 ms
Power supply rating:   2A maximum

During motor start: 3A demand > 2A supply
Voltage drops:     12V -> ~6V (brownout)
ESP32 minimum:     3.0V on 3.3V rail
Result:            ESP32 triggers brownout reset

Solutions (from cheapest to most robust):

Solution Cost Effectiveness
Add 1000 uF capacitor across motor USD 0.20 Absorbs brief inrush spike
Use soft-start circuit (NTC thermistor) USD 0.50 Limits inrush to 2x rated
Separate power rails (motor vs logic) USD 3.00 Isolates ESP32 completely
Use motor driver IC (L298N) USD 5.00 PWM soft-start + current limit

Rule of thumb: Never share a power supply between motors/solenoids and microcontrollers without isolation or decoupling. Even “small” motors create transients that crash sensitive digital circuits.

3.14.4 Real-World Comparison: Power Sources for IoT

Power Source Voltage Capacity Best For Cost Lifetime
CR2032 coin cell 3.0V 220 mAh BLE beacons, < 1 mA avg USD 0.50 1-3 years
2x AA alkaline 3.0V 2,800 mAh Moderate sensors, < 5 mA avg USD 1.00 6-18 months
18650 Li-ion 3.7V 2,600 mAh ESP32 projects, moderate power USD 3.00 3-12 months
LiPo 1000 mAh 3.7V 1,000 mAh Wearables, compact devices USD 5.00 1-6 months
USB 5V (mains) 5.0V Unlimited Gateways, always-on devices USD 2.00 Indefinite
Solar + 500 mAh LiPo 3.7V Renewable Outdoor, < 2 mA avg USD 15.00 3-5 years

3.15 Concept Relationships: How Electrical Concepts Build On Each Other

Base Concept Builds To Requires Understanding Of Applied In
Electric Charge Current flow Electrons, Protons All electrical phenomena
Voltage (V) Energy transfer, Current Potential difference, Electric field Power supplies, Batteries
Current (I) Power, Magnetic fields Charge flow rate All circuits, Actuators
Resistance (R) Voltage drop, Heat Material properties, Geometry Resistors, Conductors, Sensors
Ohm’s Law (V=IR) Circuit analysis Voltage, Current, Resistance Every circuit design
Power (P=VI) Energy consumption Voltage, Current Battery life, Thermal design
Series Circuits Voltage division Ohm’s Law, KVL Voltage dividers, Battery stacks
Parallel Circuits Current division Ohm’s Law, KCL Redundancy, Load sharing
Kirchhoff’s Voltage Law (KVL) Loop analysis Series circuits, Voltage Multi-component circuits
Kirchhoff’s Current Law (KCL) Node analysis Parallel circuits, Current Power distribution, Sensors
Circuit Topology System design Series, Parallel, Components PCB layout, Schematics
Power Budget Battery life Power, Duty cycle, Capacity IoT deployment planning

Key Insight: Everything starts with Ohm’s Law (V=IR). From this foundation, you can derive series/parallel relationships, apply Kirchhoff’s Laws for complex circuits, calculate power consumption (P=VI), and ultimately design complete IoT power systems with accurate battery life predictions. Each concept builds on the previous one like a ladder: master each step before climbing to the next.


3.16 See Also

Within This Module:

Related Physical World Topics:

Connectivity & Protocols:

  • GPIO and Digital I/O - Voltage levels, current sourcing/sinking
  • I2C Protocol - Pull-up resistor calculations
  • SPI Protocol - High-speed digital communication electrical characteristics

External Resources:


3.17 What’s Next

Now that you have a solid foundation in electricity, you are ready to dive deeper into practical applications:

Next Chapter What You’ll Learn Link
Ohm’s Law Deep Dive Advanced calculations, real-world examples, and troubleshooting techniques Electricity: Ohm’s Law
Practical Applications Voltage dividers, pull-up/pull-down resistors, sensor interfaces Electricity Applications
Common Pitfalls Mistakes to avoid when designing IoT power circuits Electricity Pitfalls
Electronics Introduction Transition from electrical theory to semiconductor devices and active components Electronics Introduction
Sensor Fundamentals How sensors convert physical phenomena to electrical signals Sensor Fundamentals
Energy-Aware Design Duty cycling, energy harvesting, and power profiling for IoT deployments Energy-Aware Introduction
Practice Suggestions

Before moving on, try these exercises to reinforce your understanding:

  1. Calculate LED resistor values for 3.3V, 5V, and 12V supplies (assuming 2V LED drop, 20mA current)
  2. Estimate battery life for an IoT sensor drawing 10mA from a 3000mAh battery
  3. Draw a circuit diagram showing how you would connect two LEDs in series vs. parallel
  4. Use the interactive simulators below to build and test circuits
Try It: ESP32 LED Circuit Simulation

Test Ohm’s Law hands-on with the Wokwi ESP32 simulator:

Challenge: Build an LED circuit that demonstrates Ohm’s Law

Steps:

  1. Add an LED from the parts panel
  2. Connect LED anode (long leg) to GPIO25
  3. Add a 220Ω resistor between the LED and ground
  4. Calculate expected current: With 3.3V GPIO, red LED (Vf=2V): \(I = \frac{3.3V - 2V}{220\Omega} = 5.9mA\)
  5. Verify the LED lights when you upload the code

What to observe: The LED brightness is safe at ~6mA. Without the resistor, current would exceed 40mA and damage the GPIO pin!


3.18 References and Further Reading

3.18.2 Simulation Tools

  • TinkerCAD Circuits: Browser-based circuit simulator
  • Wokwi: Arduino/ESP32 simulator with component library
  • Falstad Circuit Simulator: Real-time circuit visualization
  • EveryCircuit: Mobile-friendly interactive circuits