590  Electricity Fundamentals: Ohm’s Law

⏱️ ~15 min | ⭐⭐ Intermediate | 📋 P06.C04.U06

Ohm’s Law describes the fundamental relationship between voltage, current, and resistance.

590.0.1 The Basic Equation

\[I = \frac{V}{R}\]

Circular Ohm's Wheel reference chart divided into four quadrants for Voltage, Current, Resistance, and Power, showing all 12 possible calculation formulas by covering the unknown variable to reveal the equation using the other two known values
Figure 590.1: Ohm Wheel for voltage, current, resistance relationships

Complete Ohm's Wheel circular reference chart showing all 12 formulas for calculating Voltage (V), Current (I), Resistance (R), and Power (P) from any two known quantities, with color-coded quadrants for easy reference during circuit design and troubleshooting

Ohm’s Wheel from CP IoT System Design Guide

Source: CP IoT System Design Guide, Chapter 3 - Sensing and Actuation

Artistic circular diagram of Ohm's Wheel divided into four color-coded quadrants for Power (P), Voltage (V), Current (I), and Resistance (R), with 12 formulas arranged around the wheel showing: P=VI, P=I^2R, P=V^2/R for power; V=IR, V=P/I, V=sqrt(PR) for voltage; I=V/R, I=P/V, I=sqrt(P/R) for current; and R=V/I, R=P/I^2, R=V^2/P for resistance calculations.

Ohm’s Wheel Artistic Visualization

Ohm’s Wheel: Cover any variable to find multiple calculation formulas using known quantities.

Where: - I = Current (Amperes) - V = Voltage (Volts) - R = Resistance (Ohms)

Interpretation: - ⬆️ Voltage increases → ⬆️ Current increases (direct proportion) - ⬆️ Resistance increases → ⬇️ Current decreases (inverse proportion)

590.0.2 Derived Equations

From Ohm’s Law, we can derive:

\[V = I \times R\]

\[R = \frac{V}{I}\]

590.0.3 Ohm’s Wheel

The Ohm’s Wheel is a visual tool showing all relationships between V, I, R, and P (power):

%% fig-alt: "Ohm's Wheel circular diagram showing all formulas relating Voltage (V), Current (I), Resistance (R), and Power (P) with 12 different calculation methods"
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#E67E22', 'secondaryColor': '#16A085', 'tertiaryColor': '#f4f4f4', 'fontSize': '14px'}}}%%
graph TB
    Center["Ohm's Wheel<br/>Cover unknown<br/>to find formula"]

    Center --> V["V (Volts)"]
    Center --> I["I (Amps)"]
    Center --> R["R (Ohms)"]
    Center --> P["P (Watts)"]

    V --> V1["V = I × R"]
    V --> V2["V = P / I"]
    V --> V3["V = √(P × R)"]

    I --> I1["I = V / R"]
    I --> I2["I = P / V"]
    I --> I3["I = √(P / R)"]

    R --> R1["R = V / I"]
    R --> R2["R = V² / P"]
    R --> R3["R = P / I²"]

    P --> P1["P = V × I"]
    P --> P2["P = V² / R"]
    P --> P3["P = I² × R"]

    style Center fill:#16A085,stroke:#2C3E50,stroke-width:3px,color:#fff
    style V fill:#E67E22,stroke:#2C3E50,stroke-width:2px,color:#fff
    style I fill:#E67E22,stroke:#2C3E50,stroke-width:2px,color:#fff
    style R fill:#E67E22,stroke:#2C3E50,stroke-width:2px,color:#fff
    style P fill:#E67E22,stroke:#2C3E50,stroke-width:2px,color:#fff
    style V1 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style V2 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style V3 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style I1 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style I2 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style I3 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style R1 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style R2 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style R3 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style P1 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style P2 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px
    style P3 fill:#f4f4f4,stroke:#2C3E50,stroke-width:1px

Figure 590.2: Ohm’s Wheel circular diagram showing all formulas relating Voltage (V), Current (I), Resistance (R), and Power (P) with 12 different calculation me…

{fig-alt=“Electrical circuit diagram showing”Ohm’s Wheel Cover unknown to find formula”, “V (Volts)”, “I (Amps)” including voltage, current, resistance relationships, component connections, and signal flow for understanding sensor power requirements and circuit fundamentals in IoT applications.”}

Question 1: An IoT weather station’s heating element (4Ω resistance) prevents condensation on the sensor housing. Connected to a 12V power supply, the element draws unexpected current, causing the 5A fuse to blow repeatedly. Using Ohm’s Law, what is the actual current draw, and why does the fuse fail?

  • 3A (heater is fine; need to check for short circuits elsewhere drawing additional 2A+)
  • 48A (calculation error; voltage and resistance were multiplied instead of divided)
  • 8A (heater draws excessive current; need 10A fuse or higher resistance element)
  • 16A (severe overcurrent; heater element has failed short)

💡 Explanation: Ohm’s Law calculation: I = V / R = 12V / 4Ω = 3A. The heating element itself is operating correctly within specifications. Why fuse blows (rated 5A, triggers at ~6A): Heater draws 3A, leaving only 2A margin. Root cause analysis: Another component on the same 12V rail is drawing >2A during startup or operation. Common culprits in weather stations: (1) Wi-Fi radio TX burst: 200-400mA (transient, shouldn’t blow fuse). (2) Motor/fan startup: Inrush current 3-5× running current. If fan is 1A running, startup could be 3-5A → Total = 3A heater + 5A inrush = 8A → Fuse blows! (3) Relay coil: 50-100mA (minimal). (4) Short circuit: Wire insulation damaged, direct 12V→GND path → Infinite current (limited by wire resistance) → Fuse blows immediately. Solution options: (1) Use 10A slow-blow fuse (tolerates motor inrush). (2) Add soft-start circuit for motor. (3) Separate 12V rails for heater vs motor with individual fusing. (4) Check for shorts: disconnect components one-by-one, measure current. Verification: Heater alone: I = 12V/4Ω = 3A. Power = V × I = 12V × 3A = 36W. Verify heater wattage rating ≥ 36W (typically 40-50W rated). Wire gauge: 3A continuous requires 22 AWG minimum (rated 7A). At 10A (with fuse), use 18 AWG (rated 16A).

590.0.4 🧪 Interactive Lab: Ohm’s Law Circuit Demonstration

Note🎮 Try It Yourself: Experiment with Ohm’s Law

What you’ll do: Build a simple LED circuit and see how changing voltage and resistance affects current and brightness.

What you’ll learn: - How voltage, current, and resistance interact in real circuits - Why resistors are needed to protect LEDs - How to calculate proper resistor values using Ohm’s Law

Estimated time: 10 minutes

🎯 Interactive Challenges:

Try these experiments to deepen your understanding:

  1. 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!
  2. 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.
  3. 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.
  4. 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

590.1 Electronic Components

590.1.1 Capacitors

Variety of capacitor types including large electrolytic cylindrical capacitors with polarity markings, ceramic disc capacitors, small tantalum capacitors, film capacitors, and surface-mount capacitors showing different sizes and voltage ratings
Figure 590.3: Capacitors and their types

590.1.2 Inductors

Different inductor types including toroidal inductors with wire windings, axial inductors with color bands, surface-mount chip inductors, power inductors with ferrite cores, and variable inductors showing physical construction and pin configurations
Figure 590.4: Inductors and their applications

590.1.3 Component Comparison

Comprehensive comparison table showing resistors, capacitors, and inductors side-by-side with their electrical properties, units of measurement, schematic symbols, typical applications, and characteristic behaviors in DC and AC circuits
Figure 590.5: Comparison table of capacitors, inductors, and resistors

590.2 Ohm’s Law: Complete Reference

⏱️ ~20 min | ⭐⭐⭐ Advanced | 📋 P06.C04.OHMS-REF

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.

590.2.1 The Complete Formula Table

Ohm's Wheel circular reference chart divided into four quadrants for Voltage (V), Current (I), Resistance (R), and Power (P), showing all 12 possible calculation formulas by covering the unknown variable to reveal the equation using the other two known values
Figure 590.6: Ohm’s Wheel: Cover the unknown variable to reveal the formula using the two known values.

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) - -

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

590.2.2 Worked Examples with Real IoT Applications

Note🔌 Example 1: Electric Heater (Finding Current and Resistance)

Scenario: You’re designing a heated enclosure for an outdoor IoT sensor. The heating element needs to produce 1440W to maintain temperature in freezing conditions.

Given: - Supply voltage: V = 120V AC - Required power: P = 1440W

Find: Current draw and required resistance

Solution:

Step 1: Find current using P and V

From the Ohm’s Wheel: When you know P and V, to find I:

\[I = \frac{P}{V} = \frac{1440W}{120V} = 12A\]

Step 2: Find resistance using V and P

From the Ohm’s Wheel: When you know V and P, to find R:

\[R = \frac{V^2}{P} = \frac{(120V)^2}{1440W} = \frac{14400}{1440} = 10Ω\]

Step 3: Verify using V and I

Double-check using Ohm’s basic law:

\[R = \frac{V}{I} = \frac{120V}{12A} = 10Ω\]

Practical Implications: - Wire gauge: 12A continuous requires 14 AWG minimum (rated 15A) - Circuit protection: Use 15A circuit breaker with 20% safety margin - Power rating: Heating element must be rated ≥1440W (use 1500W or 2000W rated element) - Energy cost: At $0.12/kWh, running 24/7 = 1.44 kW × 24 h × $0.12 = $4.15/day

IoT System Design: - Add temperature sensor (DS18B20) to enable smart control - Implement duty cycling: ON 15 min, OFF 45 min → Reduce energy cost by 75% - Use SSR (Solid State Relay) rated ≥15A for switching

Note⚡ Example 2: DC Motor (Finding Power and Resistance)

Scenario: You’re selecting a DC motor for an automated pet feeder IoT device. The motor needs to operate from a 12V battery pack.

Given: - Supply voltage: V = 12V DC - Current draw at full load: I = 10A

Find: Power consumption and motor resistance

Solution:

Step 1: Find power using V and I

From the Ohm’s Wheel: When you know V and I, to find P:

\[P = V \times I = 12V \times 10A = 120W\]

Step 2: Find resistance using V and I

From the Ohm’s Wheel: When you know V and I, to find R:

\[R = \frac{V}{I} = \frac{12V}{10A} = 1.2Ω\]

Step 3: Verify using I and R

Double-check using power formula:

\[P = I^2 \times R = (10A)^2 \times 1.2Ω = 100 \times 1.2 = 120W\]

Practical Implications: - Battery capacity: With 12V 7Ah battery: Runtime = 7Ah / 10A = 42 minutes at full load - Heat dissipation: Motor generates 120W of heat at stall—ensure adequate ventilation - Starting current: Expect 3-5× inrush current (30-50A) for ~100ms during startup - Efficiency: Typical DC motor is 70-80% efficient → Mechanical power ≈ 85-96W

IoT System Design: - Use MOSFET (IRLZ44N rated 50A) or motor driver (L298N rated 2A per channel, dual for 4A total—insufficient, use BTS7960 rated 43A instead) - Add current sensing (ACS712 20A module) for fault detection - Implement soft-start: PWM ramping from 0% to 100% over 500ms to reduce inrush - Monitor motor current—if exceeds 12A, indicates mechanical jam or motor failure

Note🏠 Example 3: Vacuum Cleaner (Finding Current and Fuse Selection)

Scenario: You’re developing a smart home IoT plug that monitors and controls a vacuum cleaner. You need to select the appropriate fuse rating.

Given: - Vacuum cleaner rating: P = 500W - Supply voltage: V = 120V AC

Find: Current draw and minimum fuse rating

Solution:

Step 1: Find current using P and V

From the Ohm’s Wheel: When you know P and V, to find I:

\[I = \frac{P}{V} = \frac{500W}{120V} = 4.17A\]

Step 2: Select fuse rating

Fuse selection rule: Choose fuse rated ≥125% of continuous current (NEC Article 240.4)

\[I_{fuse} = I_{load} \times 1.25 = 4.17A \times 1.25 = 5.21A\]

Fuse requirement: Use 5A fuse (standard rating)

Step 3: Verify using standard fuse ratings

Standard fuse ratings: 1A, 2A, 3A, 5A, 7A, 10A, 15A, 20A…

  • 3A fuse: Too small (3A < 5.21A) → Will blow during normal operation ✗
  • 5A fuse: Adequate (5A ≥ 5.21A with minimal margin) → Acceptable for steady load ✓
  • 7A fuse: Better safety margin → Recommended for inrush current tolerance ✓
  • 10A fuse: Oversized → Won’t protect against overload conditions ✗

Practical Implications: - Startup surge: Vacuum motors draw 5-10× running current for 50-200ms during startup - Running current: 4.17A - Inrush current: 4.17A × 7 ≈ 29A (typical) - Fuse type selection: - Fast-blow (F) fuse: 5A rated will likely blow on startup due to 29A inrush → ✗ Not suitable - Slow-blow (T) fuse: 5A or 7A rated will tolerate brief inrush → ✓ Use this type - Recommendation: Use 7A slow-blow fuse for reliable operation

IoT Smart Plug Design: - Add inrush current limiter (NTC thermistor 10Ω at 25°C, surge rating 50A) - Monitor power consumption in real-time: P = V × I (update every 100ms) - Detect faults: - Current >10A continuous → Overload condition → Disconnect - Current <1A → Motor stalled or low suction → Alert user - Power factor <0.6 → Inefficient operation or motor failure - Energy reporting: Calculate kWh consumption: E = P × t = 0.5 kW × t (hours)

Real-World Calculation Example: - Usage: 30 minutes per day - Daily energy: E = 0.5 kW × 0.5 h = 0.25 kWh - Monthly energy: 0.25 kWh × 30 days = 7.5 kWh - Monthly cost: 7.5 kWh × $0.12/kWh = $0.90/month

590.2.3 Quick Reference: Common IoT Component Calculations

Tip📊 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)

590.2.4 Understanding Check

Warning🎯 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:

  1. What is the pump’s current draw at rated power?
  2. What is the pump motor’s resistance?
  3. How long can the pump run on a full battery before requiring recharge?
  4. The solar panel is under partial cloud cover, producing 12V at 3A. Can it run the pump AND charge the battery simultaneously?
  5. 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: 1. Protect against sustained overcurrent 2. 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:

  1. 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)
  2. Battery protection:
    • Add low-voltage disconnect (LVD) at 11V (or charge controller built-in LVD)
    • Prevents over-discharge below 20% SoC
  3. Monitoring:
    • INA219 sensor to measure solar panel voltage/current
    • INA219 sensor to measure battery voltage/current
    • ESP32 to log data and trigger alerts
  4. 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

590.2.5 IoT-Specific Applications and Calculations

Note📱 LED Current Limiting for Microcontrollers

Scenario: You’re connecting an LED indicator to an ESP32 GPIO pin. LEDs require current limiting to prevent damage.

Given: - ESP32 GPIO output: V_GPIO = 3.3V - LED forward voltage: V_LED = 2.0V (typical for red LED) - Desired LED current: I_LED = 20mA (standard brightness)

Find: Required resistor value

Solution:

The resistor must drop the excess voltage between the GPIO and the LED:

\[V_{resistor} = V_{GPIO} - V_{LED} = 3.3V - 2.0V = 1.3V\]

Using Ohm’s Law to find the required resistance:

\[R = \frac{V_{resistor}}{I_{LED}} = \frac{1.3V}{0.020A} = 65Ω\]

Standard resistor selection: The closest standard E12/E24 resistor value is 68Ω.

Verification:

With 68Ω, the actual current will be:

\[I_{actual} = \frac{1.3V}{68Ω} = 19.1mA\]

This is close enough to the desired 20mA (within 5%).

Practical Considerations:

LED Color Forward Voltage (V_f) Resistor for 20mA @ 3.3V Resistor for 20mA @ 5V
Red 1.8-2.2V 68Ω 150Ω
Green 2.0-2.4V 56Ω 130Ω
Blue 2.8-3.4V 10Ω-47Ω 100Ω
White 2.8-3.6V 0Ω-47Ω (use 33Ω for safety) 100Ω

Common mistake: Using 5V resistor values with 3.3V systems results in very dim LEDs!

Note🔋 Battery Life Calculation

Scenario: Calculating how long a battery-powered IoT sensor will last.

Formula:

\[\text{Battery Life (hours)} = \frac{\text{Battery Capacity (mAh)}}{\text{Average Current Draw (mA)}}\]

Example: ESP32 deep sleep application

Given: - Battery: 18650 Li-Ion cell, 3000 mAh - Deep sleep current: 0.15 mA (ESP32 hibernation mode) - Wake-up every 10 minutes to read sensor and transmit - Active current during wake: 160 mA (Wi-Fi TX) - Active time per wake: 5 seconds

Find: Battery life in days

Solution:

Step 1: Calculate average current

Time breakdown per 10-minute cycle (600 seconds): - Deep sleep: 595 seconds @ 0.15 mA - Active: 5 seconds @ 160 mA

Average current using weighted average:

\[I_{avg} = \frac{(595s \times 0.15mA) + (5s \times 160mA)}{600s}\]

\[I_{avg} = \frac{89.25 + 800}{600} = \frac{889.25}{600} = 1.48 \text{ mA}\]

Step 2: Calculate battery life

\[\text{Battery Life} = \frac{3000 \text{ mAh}}{1.48 \text{ mA}} = 2027 \text{ hours} = 84.5 \text{ days}\]

Step 3: Apply practical derating (80% usable capacity, temperature effects, aging):

\[\text{Practical Life} = 84.5 \times 0.80 = 67.6 \text{ days (≈2.2 months)}\]

Answer: Approximately 67 days of operation on a single battery charge.

Optimization tip: Increasing sleep interval to 30 minutes would triple battery life to ~200 days!

Note🔌 Voltage Divider for Level Shifting

Scenario: Reading a 5V sensor output with a 3.3V ADC (e.g., ESP32).

Given: - Sensor output: 5V maximum - ADC maximum safe input: 3.3V - ADC input impedance: 100kΩ (typical)

Find: R1 and R2 values for voltage divider

Voltage divider formula:

\[V_{out} = V_{in} \times \frac{R2}{R1 + R2}\]

We need:

\[3.3V = 5V \times \frac{R2}{R1 + R2}\]

Solving for the ratio:

\[\frac{R2}{R1 + R2} = \frac{3.3}{5} = 0.66\]

This means: R2 = 0.66(R1 + R2) → R2 = 0.66R1 + 0.66R2 → 0.34R2 = 0.66R1 → R2 = 1.94R1

Choose practical values: If R1 = 10kΩ, then R2 ≈ 20kΩ

Verification:

\[V_{out} = 5V \times \frac{20kΩ}{10kΩ + 20kΩ} = 5V \times 0.667 = 3.33V\]

Power dissipation check:

\[I_{divider} = \frac{5V}{30kΩ} = 0.167mA\]

\[P_{total} = V \times I = 5V \times 0.167mA = 0.83mW\]

This is negligible—1/4W resistors are more than adequate.

Design guidelines: - Total resistance (R1 + R2) should be 10kΩ to 100kΩ - Too low: Wastes power - Too high: Susceptible to noise and loading effects - For ESP32 ADC: 10kΩ + 20kΩ = 30kΩ total is optimal

Note📡 I2C Pull-up Resistor Sizing

Scenario: Selecting pull-up resistors for I2C communication bus.

Given: - Bus voltage: V_DD = 3.3V - I2C bus capacitance: C_bus ≈ 100 pF (short traces, 2-3 devices) - Desired rise time: t_r ≤ 300 ns (Fast Mode, 400 kHz I2C)

Find: Pull-up resistor value

Solution:

I2C uses open-drain outputs, requiring pull-up resistors to restore logic HIGH.

Step 1: Calculate minimum resistance (based on I2C max sink current)

I2C devices can sink 3 mA minimum (per I2C specification):

\[R_{max} = \frac{V_{DD}}{I_{sink}} = \frac{3.3V}{0.003A} = 1100Ω = 1.1kΩ\]

Step 2: Calculate maximum resistance (based on rise time)

RC time constant limits rise time:

\[t_r = 2.2 \times R \times C_{bus}\]

For 300 ns rise time:

\[R_{min} = \frac{t_r}{2.2 \times C_{bus}} = \frac{300 \times 10^{-9}}{2.2 \times 100 \times 10^{-12}} = \frac{300ns}{220pF} ≈ 1360Ω\]

Wait, this gives us the minimum resistance to not exceed the rise time.

Actually, we want maximum resistance:

\[R_{max} = \frac{t_r}{2.2 \times C_{bus}} = \frac{300ns}{220pF} ≈ 1360Ω\]

Step 3: Choose resistor value

Valid range: Must be low enough for rise time, high enough to not exceed sink current

  • Too low (< 1kΩ): Excessive current draw, can damage I2C pins
  • Too high (> 10kΩ): Slow rise time, communication errors

Recommended: Use 2.2kΩ or 4.7kΩ pull-ups (standard I2C values)

For this scenario with 100 pF bus capacitance: 2.2kΩ is optimal.

Power consumption:

When bus is HIGH (idle state):

\[I_{pullup} = \frac{3.3V}{2.2kΩ} = 1.5mA \text{ per line}\]

Total for SDA + SCL: 3 mA (negligible for most applications)

Quick reference table:

Bus Capacitance Max I2C Speed Recommended R_pullup
100 pF 400 kHz (Fast Mode) 2.2kΩ
200 pF 400 kHz 1.5kΩ
400 pF 100 kHz (Standard) 4.7kΩ
> 400 pF 100 kHz 10kΩ

590.2.6 Common Mistakes to Avoid

See Electricity Pitfalls for detailed coverage of common mistakes when working with electrical circuits.