4 Electricity Fundamentals: Ohm’s Law
4.1 Learning Objectives
- Master Ohm’s Law (V = I x R) and power equations (P = V x I) to analyze voltage, current, resistance, and power in IoT circuits
- Calculate LED current-limiting resistor values, battery life estimates, fuse ratings, and voltage dividers for microcontroller interfaces
- Derive all 12 Ohm’s Wheel formulas for calculating electrical parameters from any two known values and apply the reference in circuit troubleshooting
- Apply electrical calculations to real-world IoT scenarios including motor control, smart home devices, and solar-powered systems
- Evaluate critical design factors for IoT hardware including wire gauge selection, component power ratings, and thermal management
Key Concepts
- Ohm’s Law: V = I x R: voltage equals current times resistance; rearranges to I = V/R (current) and R = V/I (resistance); the fundamental relationship governing all resistive circuits
- Power Law: P = V x I = I^2 x R = V^2 / R: power dissipated in a resistive element; used to select component power ratings and estimate battery consumption
- Series Resistance: Resistors in series add directly: Rtotal = R1 + R2 + R3; current is identical through all series components; voltage divides proportionally across each resistor
- Parallel Resistance: Resistors in parallel: 1/Rtotal = 1/R1 + 1/R2 + 1/R3; voltage is identical across all parallel branches; current divides inversely proportional to resistance
- Kirchhoff’s Voltage Law (KVL): The sum of all voltage rises and drops around any closed loop equals zero; used to verify circuit analysis and set up equations for multi-loop circuits
- Kirchhoff’s Current Law (KCL): The sum of all currents entering a node equals the sum leaving it; current is conserved — none is created or destroyed at any junction
- Voltage Divider Rule: In a series resistor chain, each resistor drops a fraction of the total voltage: V_R1 = Vtotal x R1 / (R1 + R2); used to calculate bias voltages and interface signal levels
- LED Current Limiting: An LED requires a series resistor to limit current: R = (Vsupply - Vf) / If; without this resistor, the LED draws unlimited current from the supply and burns out within milliseconds
For Beginners: Ohm’s Law
Ohm’s Law is the single most useful equation in electronics: Voltage equals Current times Resistance (V = I x R). Think of electricity like water flowing through pipes – voltage is the water pressure, current is how much water flows, and resistance is how narrow the pipe is. With this one simple formula, you can calculate things like what size resistor to use with an LED or how long a battery will last powering your IoT device.
Ohm’s Law describes the fundamental relationship between voltage, current, and resistance.
4.1.1 The Basic Equation
\[I = \frac{V}{R}\]
Where: - I = Current (Amperes) - V = Voltage (Volts) - R = Resistance (Ohms)
Interpretation:
- ⬆️ Voltage increases → ⬆️ Current increases (direct proportion)
- ⬆️ Resistance increases → ⬇️ Current decreases (inverse proportion)
4.1.2 Derived Equations
From Ohm’s Law, we can derive:
\[V = I \times R\]
\[R = \frac{V}{I}\]
4.1.3 Ohm’s Wheel
The Ohm’s Wheel is a visual tool showing all relationships between V, I, R, and P (power). Cover the unknown variable to reveal the formula:
4.1.4 🧪 Interactive Lab: Ohm’s Law Circuit Demonstration
🎯 Interactive Challenges:
Try these experiments to deepen your understanding:
- Current Measurement Challenge: Calculate the current through the LED using Ohm’s Law, then verify with the ammeter
💡 Hint
Formula: I = V / R. With 5V supply and 220Ω resistor: I = (5V - 2V LED drop) / 220Ω ≈ 13.6 mA. Check if the simulation matches! - Resistor Selection Challenge: The LED datasheet says maximum current is 20 mA. Calculate the minimum resistor value needed
💡 Hint
Rearrange Ohm’s Law: R = V / I = (5V - 2V) / 0.02A = 150Ω. So use at least 150Ω to protect the LED. - Brightness Control Challenge: Try different resistor values (100Ω, 330Ω, 1kΩ). What happens to LED brightness and why?
💡 Hint
Higher resistance = lower current = dimmer LED. Verify by calculating current for each resistor value using Ohm’s Law. - Voltage Drop Challenge: Measure the voltage across the resistor and across the LED. Do they sum to 5V? Why?
💡 Hint
This demonstrates Kirchhoff’s Voltage Law (KVL): In any closed loop, voltages must sum to zero. V_supply = V_resistor + V_LED.
📊 What’s happening:
- The 5V power supply provides electrical pressure
- The 220Ω resistor limits current flow (Ohm’s Law: I = V/R)
- The LED converts electrical energy to light (typical forward voltage ~2V)
- Without the resistor, excessive current would destroy the LED
- This is the fundamental circuit pattern for all LED indicators in IoT devices
Real-World Applications:
- Every status LED on IoT devices uses this exact circuit
- Raspberry Pi GPIO pins can only supply 16 mA safely—Ohm’s Law helps you calculate the right resistor
- Smart home light dimmers use variable resistance (or PWM) to control brightness
4.2 Electronic Components
4.2.1 Capacitors
4.2.2 Inductors
4.2.3 Component Comparison
4.3 Ohm’s Law: Complete Reference
The Ohm’s Wheel provides all 12 possible formulas for calculating voltage (V), current (I), resistance (R), and power (P) when any two values are known. This is the most comprehensive reference you’ll need for electrical calculations in IoT systems.
4.3.1 The Complete Formula Table
Try It: Ohm’s Wheel Calculator
Enter any two known values to calculate all others:
All 12 Formula Derivations:
| Known Values | Find V | Find I | Find R | Find P |
|---|---|---|---|---|
| V, I | - | - | V/I | V×I |
| V, R | - | V/R | - | V²/R |
| V, P | - | P/V | V²/P | - |
| I, R | I×R | - | - | I²×R |
| I, P | P/I | - | P/I² | - |
| R, P | √(P×R) | √(P/R) | - | - |
📖 How to Use the Ohm’s Wheel
Step 1: Identify which two values you know (e.g., voltage and resistance)
Step 2: Locate the quadrant for the value you want to find (e.g., current)
Step 3: “Cover” the unknown value on the wheel—the remaining symbols show the formula
Example: To find current (I) when you know voltage (V) and resistance (R): - Cover I in the wheel - You see V/R - Formula: I = V/R
4.3.2 Worked Examples with Real IoT Applications
4.3.3 Quick Reference: Common IoT Component Calculations
📊 Typical Values for IoT Devices
| Component | Typical Voltage | Typical Current | Power | Notes |
|---|---|---|---|---|
| ESP32 (Wi-Fi active) | 3.3V | 160-260 mA | 0.5-0.9W | Peaks at 500mA during TX |
| Arduino Uno | 5V | 50 mA (idle) | 0.25W | Excludes external peripherals |
| Raspberry Pi 4 | 5V | 600 mA (idle) - 1.2A (load) | 3-6W | Requires 3A rated supply |
| Status LED (red) | 2V (forward drop) | 10-20 mA | 0.02-0.04W | With current-limiting resistor |
| DHT22 (temp/humidity) | 3.3-5V | 1-2.5 mA | 0.003-0.0125W | During measurement |
| Servo motor (SG90) | 5V | 100-250 mA (idle) - 1A (stall) | 0.5-5W | Stall current can damage MCU pins |
| Relay module (5V) | 5V (coil) | 70-80 mA | 0.35-0.4W | Contact rating separate (10A/250VAC typical) |
| GSM module (SIM800) | 3.7-4.2V (LiPo) | 300 mA (idle) - 2A (TX burst) | 1.1-8.4W | Use dedicated power supply, not MCU |
Formula to remember:
- LED resistor calculation: R = (V_supply - V_LED) / I_LED
- Example: 5V supply, red LED (2V drop), 20mA → R = (5V - 2V) / 0.02A = 150Ω (use 220Ω for safety margin)
4.3.4 Understanding Check
🎯 Application Problem: Smart Garden Irrigation Pump
You’re designing a solar-powered smart irrigation system for a community garden IoT project.
System Specifications:
- Water pump: 12V DC, rated 40W
- Solar panel: 18V (peak), 5A (peak)
- Battery: 12V, 20Ah LiFePO4
- Charge controller: 12V, 10A PWM
Questions:
- What is the pump’s current draw at rated power?
- What is the pump motor’s resistance?
- How long can the pump run on a full battery before requiring recharge?
- The solar panel is under partial cloud cover, producing 12V at 3A. Can it run the pump AND charge the battery simultaneously?
- What fuse rating should protect the pump circuit?
💡 Solution & Analysis
1. Pump current draw:
From Ohm’s Wheel (P and V known, find I):
\[I = \frac{P}{V} = \frac{40W}{12V} = 3.33A\]
Answer: The pump draws 3.33A at rated power.
2. Pump motor resistance:
From Ohm’s Wheel (P and V known, find R):
\[R = \frac{V^2}{P} = \frac{(12V)^2}{40W} = \frac{144}{40} = 3.6Ω\]
Verification using I and V:
\[R = \frac{V}{I} = \frac{12V}{3.33A} = 3.6Ω\] ✓
Answer: Motor resistance is 3.6Ω.
3. Battery runtime:
Battery capacity: 20Ah at 12V
Runtime formula: \[t = \frac{\text{Battery Capacity (Ah)}}{\text{Current Draw (A)}} = \frac{20Ah}{3.33A} = 6.0 \text{ hours}\]
Practical adjustment: LiFePO4 batteries should not be discharged below 20% SoC for longevity.
Usable capacity: 20Ah × 0.8 = 16Ah
Practical runtime: \[t_{practical} = \frac{16Ah}{3.33A} = 4.8 \text{ hours}\]
Answer: 6 hours theoretical, 4.8 hours practical (with 20% reserve).
4. Simultaneous pump operation and charging?
Solar panel output:
- Voltage: 12V (reduced from 18V peak due to clouds)
- Current: 3A
- Power: P = V × I = 12V × 3A = 36W
Pump requirement:
- Power: 40W
- Current: 3.33A
Analysis:
- Solar provides: 36W
- Pump requires: 40W
- Deficit: 40W - 36W = 4W (must come from battery)
Answer: No, the solar panel cannot run the pump AND charge the battery. In fact, the battery must supplement the solar panel by 4W (0.33A) to keep the pump running.
Current flow:
- Solar contribution: 3A
- Battery supplement: 3.33A - 3A = 0.33A (discharging)
- Net battery current: -0.33A (negative = discharging)
System behavior: The charge controller will draw 0.33A from the battery to make up the 4W shortfall.
5. Fuse rating for pump circuit:
Fuse selection criteria:
- Protect against sustained overcurrent
- Tolerate motor inrush (3-5× running current for 100-200ms)
Running current: 3.33A
Inrush current estimate: 3.33A × 4 = 13.3A (typical for DC motors)
Fuse sizing rule: 125% of continuous current (NEC guideline)
\[I_{fuse} = 3.33A \times 1.25 = 4.16A\]
Standard fuse ratings: 1A, 2A, 3A, 5A, 7A, 10A…
Selection:
- 5A slow-blow fuse: Adequate for 3.33A continuous, tolerates 13.3A inrush ✓ Recommended
- 7A slow-blow fuse: More margin, better for aging motors ✓ Alternative
- 3A fuse: Too small, will blow on startup ✗
Answer: Use 5A slow-blow (T) fuse (minimum) or 7A slow-blow (recommended for safety margin).
System Design Recommendations:
- Solar panel sizing: For reliable operation without battery supplement:
- Required: 40W pump + 10W charging reserve = 50W minimum
- Recommended: 60-80W panel to handle efficiency losses (charge controller ~85% efficient)
- Battery protection:
- Add low-voltage disconnect (LVD) at 11V (or charge controller built-in LVD)
- Prevents over-discharge below 20% SoC
- Monitoring:
- INA219 sensor to measure solar panel voltage/current
- INA219 sensor to measure battery voltage/current
- ESP32 to log data and trigger alerts
- Energy optimization:
- Run pump only when solar produces >3.33A (sunlight sufficient)
- Schedule watering for peak sun hours (10 AM - 2 PM)
- Use soil moisture sensor to avoid unnecessary watering
4.3.5 IoT-Specific Applications and Calculations
Interactive Circuit Simulation
Practice LED current limiting with Tinkercad — no hardware needed!
Open in Tinkercad →{target=“_blank”}
What to try:
- Build: 5V power → 150Ω resistor → Red LED (Vf=2V) → ground
- Calculate expected current: \(I = \frac{5V - 2V}{150\Omega} = 20mA\)
- Use the multimeter in the simulator to measure actual current
- Try different LEDs (green, blue, white) and observe how different forward voltages affect brightness
- Replace the 150Ω resistor with 330Ω and observe the LED dims (current drops to ~9mA)
Tinkercad lets you drag-and-drop components onto a virtual breadboard and run the circuit in your browser. It’s free and requires no installation.
For Kids: Meet the Sensor Squad!
Sammy the Sensor and friends discover the secret formula of electricity!
One sunny morning, Sammy the Sensor found a mystery: “Why does Lila the LED sometimes glow bright and sometimes glow dim?” Max the Microcontroller smiled. “That’s because of a magic formula called Ohm’s Law! Let me show you.”
Max drew a big triangle on the whiteboard. “There are three best friends in every circuit: Voltage, Current, and Resistance. Voltage is like the water pressure in a hose – it pushes electricity along. Current is how much electricity actually flows, like how much water comes out. And Resistance is anything that slows the flow down, like squeezing the hose.”
“The magic formula is V equals I times R,” Max continued. “That means if you know any two of the three friends, you can figure out the third one!”
Bella the Battery jumped in. “I push with 5 volts of pressure!” Sammy pointed to the 220-ohm resistor. “And this slows things down by 220 ohms.” Max did the math on his tiny screen: “So the current flowing through Lila is 5 divided by 220, which is about 23 milliamps. That’s just right for her to glow safely!”
Lila beamed. “So Ohm’s Law keeps me safe AND tells you exactly how bright I’ll be? That IS magic!” The whole Sensor Squad agreed – Ohm’s Law was the most important formula in their whole world of electronics.
4.3.6 Key Words for Kids
| Word | What It Means |
|---|---|
| Ohm’s Law | The magic formula V = I x R that connects voltage, current, and resistance |
| Voltage | Electrical pressure that pushes electrons through a circuit (measured in Volts) |
| Current | The flow of electrons through a wire (measured in Amps) |
| Resistance | Anything that slows down electron flow (measured in Ohms) |
| Power | How much energy is used per second (measured in Watts) |
Key Takeaway
Ohm’s Law (V = I x R) and its power companion (P = V x I) are the two equations you will use most in IoT hardware design. Master them to calculate LED resistor values, battery life, fuse ratings, wire gauge requirements, and thermal dissipation for any circuit.
4.4 Concept Relationships: Ohm’s Law Applications
| Concept | Formula | Derived From | Used For |
|---|---|---|---|
| Ohm’s Law | V = I × R | Fundamental law | All resistive circuit analysis |
| Resistance Calculation | R = V / I | Ohm’s Law | Finding unknown resistor value |
| Current Calculation | I = V / R | Ohm’s Law | Determining current draw |
| Power (Voltage-Current) | P = V × I | Energy definition | Total power consumption |
| Power (Current-Resistance) | P = I² × R | P = VI, V = IR | Resistor heat dissipation |
| Power (Voltage-Resistance) | P = V² / R | P = VI, I = V/R | Power from known voltage |
| Series Resistance | R_total = R1 + R2 + … | KVL + Ohm’s Law | Multi-resistor circuits |
| Parallel Resistance | 1/R_total = 1/R1 + 1/R2 + … | KCL + Ohm’s Law | Current-dividing circuits |
| Voltage Divider | Vout = Vin × R2/(R1+R2) | Ohm’s Law + Series | Sensor level shifting |
| Current Divider | I1 = Itotal × R2/(R1+R2) | Ohm’s Law + Parallel | Current sensing |
| Battery Life | Hours = mAh / mA | Energy conservation | IoT deployment planning |
| Thermal Power | Heat = I² × R | Joule heating | Component temperature rise |
Key Insight: Every calculation starts with V = I × R. Power formulas (P = VI, P = I²R, P = V²/R) are just Ohm’s Law combined with the energy definition P = VI. For any resistive component, knowing any two quantities (V, I, R, P) allows you to calculate all others. This forms the complete toolkit for IoT circuit analysis.
4.4.1 Common Mistakes to Avoid
See Electricity Pitfalls for detailed coverage of common mistakes when working with electrical circuits.
Decision Framework: Choosing Between Linear and Switching Regulators
Context: You need to power an IoT sensor node from a battery. Should you use a linear regulator (LDO) or a switching regulator (buck converter)?
| Factor | Linear Regulator (LDO) | Switching Regulator (Buck) | Winner |
|---|---|---|---|
| Efficiency | 50-70% (Vout/Vin) | 85-95% (independent of Vin) | Switching |
| Battery Life | 12V→3.3V wastes 72% as heat | 12V→3.3V: 90% efficient | Switching |
| Noise | Ultra-clean output (<10µV ripple) | 10-100mV ripple at switching frequency | Linear |
| BOM Cost | $0.50-$2 (IC + 2 capacitors) | $3-$8 (IC + inductor + diode + capacitors) | Linear |
| PCB Space | Tiny (5mm² for SOT-23) | Large (100mm² with inductor) | Linear |
| Design Complexity | Simple (datasheet copy-paste) | Complex (PCB layout critical) | Linear |
| Quiescent Current | 1-50µA | 10-100µA (older designs) | Linear |
| Input Voltage Range | Limited (dropout: 0.3-1.5V) | Wide (4-40V typical) | Switching |
| Load Current | 100mA-1A typical | 100mA-10A+ typical | Switching |
Decision Matrix:
Choose Linear (LDO) when:
- Low-noise analog circuits (ADC reference, sensor amplifiers)
- Small voltage drop (5V → 3.3V = 1.7V, efficiency = 66%)
- Low cost and space constraints
- Simple design requirements
- Current draw <500mA
Choose Switching (Buck Converter) when:
- Large voltage drop (12V → 3.3V = 8.7V wasted)
- Battery-powered with long runtime requirements
- Current draw >500mA
- Input voltage varies widely (solar, automotive)
Hybrid Approach (BEST for IoT):
Use both in cascade: 1. Switching converter (12V → 5V at 90% efficiency) for bulk power 2. Linear regulator (5V → 3.3V at 66% efficiency) for clean analog power
Example: - Battery: 12V, 2000mAh - Load: ESP32 + sensors = 200mA @ 3.3V = 0.66W
Option A (Linear only):
- 0.66W / 0.275 efficiency (3.3V/12V) = 2.4W from battery
- 2.4W / 12V = 200mA from battery
- Runtime: 2000mAh / 200mA = 10 hours
Option B (Switching only):
- 0.66W / 0.9 efficiency = 0.73W from battery
- 0.73W / 12V = 61mA from battery
- Runtime: 2000mAh / 61mA = 32.8 hours (64% longer!)
Option C (Hybrid switching + linear):
- 0.66W / 0.66 (linear efficiency) = 1.0W @ 5V
- 1.0W / 0.9 (switching efficiency) = 1.11W @ 12V
- 1.11W / 12V = 93mA from battery
- Runtime: 2000mAh / 93mA = 21.5 hours
- Benefit: Clean 3.3V for analog, acceptable battery life
Quick Selection Guide:
| Application | Recommended Solution | Reason |
|---|---|---|
| USB-powered (5V) | LDO (5V → 3.3V) | Small drop, noise not critical |
| 12V battery | Buck converter | Large drop, efficiency critical |
| Solar (variable V) | Buck-boost converter | Handles input below/above output |
| Precision sensors | LDO always | Noise kills ADC accuracy |
| High-current actuators | Switching always | >1A requires efficiency |
Default Recommendation: For general IoT nodes, use a switching regulator (TPS62130, LM2596) unless you need ultra-low noise (<1mV ripple), in which case cascade switching + linear for best of both worlds.
Putting Numbers to It
Efficiency comparison for a real IoT weather station (ESP32 + sensors @ 200mA, 3.3V):
Power consumed by load:
\[P_{load} = V \times I = 3.3V \times 0.2A = 0.66W\]
Linear regulator (12V → 3.3V):
\[\eta_{linear} = \frac{V_{out}}{V_{in}} = \frac{3.3V}{12V} = 27.5\%\]
\[P_{input} = \frac{0.66W}{0.275} = 2.4W\]
\[P_{wasted} = 2.4W - 0.66W = 1.74W \text{ (dissipated as heat!)}\]
Switching regulator (12V → 3.3V at 90% efficiency):
\[P_{input} = \frac{0.66W}{0.90} = 0.73W\]
\[P_{wasted} = 0.73W - 0.66W = 0.07W\]
Battery life comparison (12V 2000mAh battery):
Linear: \(\frac{2000mAh}{200mA} = 10\) hours (from 12V battery: current draw = 2.4W / 12V = 200mA)
Switching: \(\frac{2000mAh}{61mA} = 32.8\) hours (from 12V battery: current draw = 0.73W / 12V = 61mA) ← 3.3× longer runtime
The switching regulator’s higher efficiency means the battery supplies only 61mA instead of 200mA, dramatically extending deployment time between recharges.
4.5 See Also
Within This Module:
- Electricity Introduction - Foundational concepts of voltage, current, and resistance
- Electricity Applications - Passive components and real-world IoT circuit design with KVL/KCL
- Common Electricity Pitfalls - Unit confusion, voltage drops, power limits to avoid
- Electronics: Doping & Diodes - Beyond Ohm’s Law: non-linear semiconductor devices
Power Management:
- Power Management Fundamentals - System-level battery optimization and energy harvesting
- Energy Efficiency - Duty cycling, sleep modes, and power profiling
- Battery Technologies - LiPo, NiMH, primary cells, and charging
Component Selection:
- Resistor Selection - Material types, tolerances, and power ratings
- Transistor Selection - Using transistors as switches with Ohm’s Law
- Actuator Control - Motor current calculations and power driver design
External Resources:
- TI Power Design Seminar - Industry reference for power system calculations
- All About Circuits - Ohm’s Law - Interactive circuit simulator
- SparkFun Power Supply Design Tutorial - Practical regulator selection guide
Common Pitfalls
1. Applying Ohm’s Law to Non-Resistive Components
Ohm’s Law V = IR applies only to purely resistive elements. Capacitors, inductors, diodes, LEDs, and transistors do NOT follow Ohm’s Law — they have nonlinear or frequency-dependent V-I relationships. Using V=IR to calculate current through an LED ignores the LED’s forward voltage drop and produces wildly incorrect results.
2. Ignoring Internal Resistance of Power Supplies
Ideal power supplies hold voltage constant regardless of load current. Real batteries and regulators have internal resistance that causes output voltage to drop under heavy load: Vout = Vnominal - I x Rinternal. A 9V alkaline battery with 15 ohm internal resistance outputs only 6.5 V when driving 167 mA. Include supply internal resistance in circuit analysis for battery-powered IoT devices.
3. Confusing Voltage Drop with Voltage Loss
Voltage drop across a resistor is not ‘lost’ — it represents power being usefully (or wastefully) consumed. In an LED circuit, the resistor voltage drop represents power converted to heat; the LED voltage drop represents power converted to light. Both must sum to the supply voltage per KVL. Students sometimes try to minimize resistor voltage to ‘save power’ but this increases current and increases LED power dissipation instead.
4. Parallel Resistance Smaller Than Smallest Branch
Students often expect parallel combinations to average the resistors, but the result is always smaller than the smallest resistor. This surprises students who expect R_parallel to be between R1 and R2. Physical intuition: adding a parallel path provides additional current route, reducing total resistance. Verify calculated parallel resistance is less than the smallest individual resistor as a sanity check.
4.6 What’s Next
| Next Chapter | What You Will Learn |
|---|---|
| Electricity Applications | Apply Ohm’s Law to real IoT circuits: passive components, power budget calculations, voltage dividers, and battery life estimation |
| Electricity Introduction | Deepen understanding of voltage, current, and resistance with additional examples and circuit analysis techniques |
| Electronics: Doping and Diodes | Move beyond Ohm’s Law into semiconductor devices, diodes, and transistors that form the building blocks of IoT circuits |