7  Electricity Reference

7.1 Learning Objectives

  • Apply Ohm’s Law, power formulas, and voltage divider calculations to solve practical IoT circuit problems
  • Diagnose common electrical pitfalls including ground loop noise and power supply ripple in sensor circuits
  • Calculate battery life for IoT deployments using capacity, current draw, and efficiency factors
  • Compare battery-powered and energy-harvesting power strategies for remote IoT sensor nodes
In 60 Seconds

This reference chapter consolidates electricity quizzes, visual galleries, common pitfalls (ground loops, power supply ripple), and a comprehensive summary of voltage, current, resistance, and power relationships essential for every IoT circuit design.

7.2 Quiz 5: Comprehensive Review

## Visual Reference Gallery {#sens-elec-gallery}

Explore alternative visual representations of electrical fundamentals. These AI-generated figures provide different perspectives on circuits, components, and power concepts.

Modern clean diagram of Ohm's Law triangle showing V=IR relationship with three variations: V=IR (voltage calculation), I=V/R (current calculation), R=V/I (resistance calculation). Color-coded sections with voltage in orange, current in teal, and resistance in navy. Includes practical examples for IoT applications.

Modern visualization of Ohm’s Law showing the mathematical relationships between voltage, current, and resistance.

AI-generated modern visualization of the fundamental Ohm’s Law relationship used in all circuit analysis.

Geometric low-poly style diagram showing electrons (small spheres) moving through a conductor's atomic lattice. Illustrates the difference between electron flow direction (negative to positive) and conventional current direction (positive to negative). Voltage source shown driving the electron movement.

Geometric representation of electron flow through a conductor showing atomic structure and current direction.

AI-generated geometric visualization explaining the physical basis of electrical current in conductors.

DrawIO diagram of IoT power supply chain: input sources (battery, USB, solar), protection circuits (fuse, reverse polarity), voltage regulation (linear LDO or switching buck/boost), filtering (decoupling capacitors), and distribution to MCU, sensors, and actuators. Shows typical voltages at each stage.

DrawIO editable diagram showing typical IoT power supply design from battery or wall adapter to regulated outputs.

DrawIO template showing the complete power supply architecture for battery-powered IoT devices.

Tradeoff: Battery vs Energy Harvesting

Decision context: When designing a power supply for an IoT device that will operate remotely or in hard-to-reach locations.

Factor Battery Energy Harvesting
Power Predictable, consistent output regardless of environment Variable output depending on light, vibration, or thermal conditions
Cost Lower initial cost ($1-$20 for typical IoT batteries) Higher initial cost ($20-$100 for solar panels, harvesters, and PMICs)
Reliability Finite lifespan; requires periodic replacement Potentially infinite lifespan if properly sized for worst-case conditions
Maintenance Scheduled battery replacements (months to years) Minimal once deployed; monitor harvesting efficiency
Size Scales linearly with capacity needs Fixed harvester size; requires supercapacitor/battery buffer
Environmental Disposal concerns; temperature sensitivity (-20C to 60C) Green solution; some harvesters work in extreme temperatures

Choose Battery when:

  • Deployment is accessible for maintenance (monthly/yearly visits feasible)
  • Power demand is high or unpredictable (actuators, high-bandwidth radios)
  • Environmental conditions are unfavorable for harvesting (indoor, no vibration, stable temps)
  • Project budget is limited and upfront cost must be minimized

Choose Energy Harvesting when:

  • Device is deployed in inaccessible locations (bridges, wildlife, deep ocean)
  • Ultra-long lifetime is required (10+ years maintenance-free)
  • Environmental energy is abundant and consistent (outdoor solar, industrial vibration)
  • Total cost of ownership matters more than initial cost (thousands of devices at scale)

Default recommendation: Battery power unless the deployment location is inaccessible OR you are deploying at scale (1000+ devices) where battery replacement costs exceed harvesting infrastructure investment.

7.3 Common Pitfalls

Common Pitfall: Ground Loop Noise

The mistake: Connecting multiple circuit boards or sensors using separate ground paths that create loops, introducing 50/60Hz mains interference and unexplained voltage fluctuations into sensitive analog measurements.

Symptoms:

  • ADC readings show periodic 50Hz or 60Hz oscillations (depending on mains frequency)
  • Sensor values fluctuate even with stable physical conditions
  • Noise increases when motors, relays, or AC equipment operates nearby
  • Connecting an oscilloscope probe changes the measurement (adds another ground path)

Why it happens: Ground loops form when current flows through unintended ground paths. If sensor ground and MCU ground connect at two different points, the resistance between those points creates a small voltage difference (ground noise). AC equipment induces currents in this loop through magnetic coupling, appearing as 50/60Hz interference.

The fix: Use a star ground topology–connect all ground wires to a single point near the power supply or MCU. For distributed systems, use differential signaling (twisted pairs) or isolated sensors. Add ferrite beads on ground wires to block high-frequency noise.

Prevention: Always plan your ground layout before wiring. Draw your ground connections–if you can trace a loop, break it. For sensitive analog circuits, keep analog ground (AGND) and digital ground (DGND) separate, joining only at the power supply.

Common Pitfall: Power Supply Ripple Corrupting Sensor Readings

The mistake: Powering sensitive analog sensors directly from a switching power supply or USB port without filtering, introducing high-frequency noise that corrupts ADC measurements.

Symptoms:

  • ADC readings jump by 10-50 LSBs even with stable sensor input
  • Noise frequency matches switching regulator frequency (typically 500kHz-2MHz)
  • 12-bit ADC behaves like 8-bit (effective resolution loss of 4 bits)
  • Problem worse when Wi-Fi or BLE radio is transmitting (current spikes)

Why it happens: Switch-mode power supplies (including USB) generate ripple at their switching frequency. This ripple couples into the ADC reference and analog inputs. A 10mV ripple on a 3.3V supply with 12-bit ADC (0.8mV/LSB) causes 12 LSB noise. Radio transmit bursts draw 200-400mA spikes, causing supply voltage dips.

The fix: Add a dedicated LDO regulator (like AMS1117-3.3 or MCP1700) for analog sensor power, with 10uF input and 10uF output capacitors. Place a 100nF ceramic capacitor directly at each sensor’s power pins. Use separate power rails for digital (noisy) and analog (quiet) sections.

Prevention: Include analog power filtering in your initial design. Budget for an LDO even when your digital supply voltage matches sensor requirements–the filtering is worth the small efficiency loss. For battery systems, the LDO dropout of 200-300mV is acceptable for the noise improvement gained.

Common Mistake: Using Standard Resistors in Precision Voltage References

The Error: You build a 2.5V precision voltage reference using a voltage divider with two standard 1kΩ resistors (5% tolerance) from a 5V supply. The reference voltage should be exactly 2.5V for calibrating ADC readings, but measured values vary between 2.375V and 2.625V across production units.

Why This Fails:

Tolerance Stack-Up:

  • R1: 1kΩ ± 5% = 950Ω to 1050Ω
  • R2: 1kΩ ± 5% = 950Ω to 1050Ω

Worst-Case Scenario:

  • Maximum output: (1050Ω / (950Ω + 1050Ω)) × 5V = 2.625V (+5% error)
  • Minimum output: (950Ω / (1050Ω + 950Ω)) × 5V = 2.375V (-5% error)

For precision ADC calibration with 12-bit resolution (0.8mV/LSB at 3.3V):

  • Acceptable error: ±5 LSB = ±4mV
  • Actual error range: ±125mV = ±156 LSB (31× worse than needed!)

Why It Matters in IoT:

  • Temperature sensors with 0.1°C precision become ±1°C inaccurate
  • Battery voltage monitoring shows wrong SoC (State of Charge)
  • Calibration constants change between devices (production nightmare)
  • Field failures when “calibrated” sensors drift out of spec

The Fix: Use Precision Components

Option 1: Precision Resistors (1% or 0.1%)

  • 1kΩ ± 1% tolerance: 990Ω to 1010Ω
  • Worst-case voltage: (1010Ω / (990Ω + 1010Ω)) × 5V = 2.525V
  • Error: ±25mV = ±31 LSB (much better, but still not ideal)

Option 2: Matched Resistor Pairs

  • Use resistor networks where ratio is guaranteed (e.g., 0.1% ratio matching)
  • Example: Bourns 4600X series (0.05% ratio tolerance)
  • Output voltage error: ±0.05% = ±1.25mV = ±1.5 LSB

Option 3: Precision Voltage Reference IC (BEST)

  • Use dedicated voltage reference chip (e.g., TL431, LM4040, ADR431)
  • Accuracy: ±0.5% to ±0.05%
  • Temperature coefficient: 10-50 ppm/°C
  • Cost: $0.50-$2 (worth it for precision)

Example: TL431 Precision Shunt Regulator

  • Output: 2.495V (±0.5%) = 2.482V to 2.507V
  • Error: ±13mV = ±16 LSB at 12-bit
  • Temperature drift: 30 ppm/°C → ±0.75mV over 0-50°C
  • Total error budget: ±14mV (acceptable for ±5 LSB target with margin)

Cost Comparison:

Solution Component Cost Accuracy When to Use
5% resistors $0.02 ±5% (±125mV) Non-critical, LED indicators
1% resistors $0.05 ±1% (±25mV) General analog circuits
0.1% matched pair $0.30 ±0.1% (±2.5mV) Precision sensors
Voltage reference IC $0.80 ±0.5% (±12mV) ADC calibration, precision DAC

Real-World Example: Temperature Measurement

Scenario: NTC thermistor voltage divider for temperature sensing - Voltage divider: 5V supply, 10kΩ NTC + 10kΩ fixed resistor - At 25°C: Vout = 2.5V - ADC resolution: 12-bit (0.8mV/LSB) - Target accuracy: ±0.5°C

With 5% resistors:

  • ±125mV error = ±156 LSB
  • Temperature error: ±3°C (unusable for HVAC control)

With 0.1% matched pair:

  • ±2.5mV error = ±3 LSB
  • Temperature error: ±0.2°C ✓ (meets spec)

Key Lesson: For precision analog circuits (ADC references, sensor calibration, battery monitoring), always use precision components (1% minimum, 0.1% for production). The extra $0.20-$0.50 per unit prevents field failures worth thousands in returns and reputation damage.

Design Checklist:

  • ✓ Use precision voltage reference ICs for ADC Vref
  • ✓ Use 0.1% matched resistor pairs for critical dividers
  • ✓ Use 1% resistors minimum for analog signal paths
  • ✓ Reserve 5% resistors for LED current limiting and pull-ups (non-critical)
  • ✓ Calculate worst-case tolerance stack-up for ALL precision circuits
  • ✓ Include temperature coefficient in error budget

7.4 Concept Relationships: Electrical Fundamentals

Concept Relates To Relationship
Ohm’s Law Circuit Analysis V = I × R enables calculating any parameter when two are known; foundation for all circuit math
Series Circuits Current Flow Same current through all components; voltages add (V_total = V1 + V2 + V3)
Parallel Circuits Voltage Distribution Same voltage across all components; currents add (I_total = I1 + I2 + I3)
Power Battery Life P = V × I determines energy consumption; higher power → shorter battery runtime
Battery Capacity Runtime Runtime (hours) = Capacity (mAh) / Current Draw (mA); doubling current halves runtime
Ground Loops Noise Multiple ground paths create loops where AC currents induce voltage noise (50/60 Hz)
Voltage Divider Sensor Interfacing V_out = V_in × (R2 / (R1 + R2)); used for level shifting and battery monitoring
Tolerance Stack-Up Precision 5% resistors in divider: ±10% output error; use 0.1% matched pairs for precision

7.5 See Also

7.6 Summary

This chapter covered the electrical fundamentals essential for IoT systems:

  • Fundamental Concepts: Electricity is the flow of electrons between atoms, with current (I) measuring charge flow in amperes, voltage (V) representing electrical pressure in volts, and resistance (R) opposing current flow in ohms
  • Ohm’s Law: The relationship V = I × R is fundamental to all circuit analysis, enabling calculation of any electrical parameter when two are known
  • Power and Energy: Power (P = V × I) measured in watts determines energy consumption rate, critical for battery life calculations in IoT devices
  • Circuit Configurations: Series circuits share the same current with voltages adding up (V_total = V1 + V2), while parallel circuits share the same voltage with currents adding up (I_total = I1 + I2)
  • Resistors: Fixed resistors limit current and divide voltage (color codes indicate values), while variable resistors (potentiometers, thermistors, photoresistors) enable sensor applications
  • Capacitors and Inductors: Capacitors store energy in electric fields (used for filtering and timing), while inductors store energy in magnetic fields (used in power supplies and filtering)
  • Battery Calculations: Battery life = capacity (mAh) / current draw (mA), essential for determining IoT device deployment duration and sleep mode requirements

Fundamentals:

Sensing:

Actuation:

  • Actuators - Motors, relays, and control circuits

Design:

Architecture:

Learning:

7.7 Visual Reference Library

This section contains AI-generated phantom figures designed to illustrate key concepts covered in this chapter. These figures provide visual reference material for understanding sensing and actuation systems.

Note: These are AI-generated educational illustrations meant to complement the technical content.

7.7.1 Ohm’s Law and Relationships

Educational diagram illustrating ohms law2 showing electrical relationships and measurement principles

Ohms Law2

Educational diagram illustrating ohms wheel showing electrical relationships and measurement principles

Ohms Wheel

7.7.2 Light-Dependent Resistors

Technical illustration of light intensity v s l d r resistance used in IoT sensing and actuation systems

Light Intensity V S L D R Resistance

7.7.3 Power and Energy

Technical illustration of power of2 used in IoT sensing and actuation systems

Power Of2

Circuit schematic of power supply circuit showing electronic components, connections, and signal paths

Power Supply Circuit

Illustration of voltage sensor showing sensor components, measurement principles, and typical applications in IoT systems

Voltage Sensor

Voltage divider tolerance stack-up determines worst-case output error for precision ADC references.

\[ V_{error} = V_{supply} \times \sqrt{\left(\frac{\Delta R_1}{R_1}\right)^2 + \left(\frac{\Delta R_2}{R_2}\right)^2} \]

Worked example: For 2.5V reference from 5V using two 1kΩ resistors with ±1% tolerance (\(\Delta R = 10\Omega\)):

\[V_{error} = 5 \times \sqrt{\left(\frac{10}{1000}\right)^2 + \left(\frac{10}{1000}\right)^2} = 5 \times \sqrt{0.0002} = 5 \times 0.0141 = 70.7 \text{ mV}\]

This ±70.7 mV error (±2.8%) equals ±88 LSB for 12-bit ADC (0.8 mV/LSB) — far exceeding precision requirements. Using 0.1% resistors reduces error to ±7.07 mV (±9 LSB), meeting high-accuracy sensor calibration needs.

The Sensor Squad reviews everything they learned about electricity!

It was quiz day for the Sensor Squad, and Sammy the Sensor was a little nervous. “Don’t worry,” said Max the Microcontroller. “Let’s review what we know!”

Bella the Battery went first. “I’m like a water pump – I push electricity around the circuit with my voltage! The higher my voltage, the harder I push.” Max nodded. “And I remember that current is like the amount of water flowing through the pipe. More current means more electrons moving!”

Lila the LED chimed in. “And resistance is like a narrow part of the pipe that slows the water down. My friend the resistor uses resistance to protect me from too much current!” Sammy added, “We can figure out any of those three things using Ohm’s Law: V = I times R.”

“But there’s a sneaky problem,” warned Max. “Ground loops! Imagine if the water pipe had two different drains going to two different places – the water would get confused and swirl around, making noise.” Bella nodded wisely. “That’s why we always use a star ground – one single drain point for all the water to flow back to.”

“And don’t forget about noisy power supplies!” said Sammy. “A switching power supply is like a pump that goes THUMP-THUMP-THUMP really fast. Those thumps can mess up my sensor readings. That’s why we add special filter capacitors – they’re like shock absorbers that smooth out the bumps!”

The whole squad felt ready for their quiz. They had learned about voltage, current, resistance, Ohm’s Law, ground loops, and power supply filtering. “We’re electricity experts!” they cheered together.

7.7.4 Key Words for Kids

Word What It Means
Ground Loop When electricity has more than one path back to the battery, creating noise
Star Ground Connecting all ground wires to one single point to avoid noise
Filter Capacitor A part that smooths out bumpy electricity, like a shock absorber
Power Supply The part that provides electricity to the whole circuit
Ripple Unwanted bumps in the electricity from a power supply
Key Takeaway

Electricity fundamentals – voltage, current, resistance, Ohm’s Law, and power calculations – form the absolute foundation of all IoT hardware. Master these concepts and you can design, build, troubleshoot, and optimize any IoT circuit from simple LED indicators to complex multi-sensor systems.

7.8 Practice: Match and Order

7.9 What’s Next?

If you want to… Read this
Apply reference knowledge to basic circuit analysis Electricity Fundamentals: Ohm’s Law
Understand how electronic components use these principles Conductors & Semiconductors
Explore sensor electronics that rely on these fundamentals Sensor Types: Introduction
See power management applications of electrical fundamentals Sensor Power Management

Now that you understand electrical fundamentals (voltage, current, resistance, power), you’re ready to explore electronics—the world of semiconductors, diodes, and transistors that form the building blocks of active circuits and microcontrollers.

Continue to Electronics →

Further Resources

Interactive Learning:

Video Tutorials:

Reference:

Electronics Foundation:

Sensing:

Power & Energy:

Prototyping:

Labs: