Chapters

6 IoT Electricity: Divider Analysis and Applications

electronics-controller-design
electricity

6.1 Start With the Decision

A sensor input can be damaged when a divider is chosen by ratio alone. Source load, tolerance, and input range must also be checked.

6.2 Route Overview

This is part 1 of 2. Continue with IoT Electricity: Circuit Labs and Measurement.

6.3 Part Objectives

  • Calculate divider voltage and loading effects.
  • Apply series and parallel rules to IoT circuits.

6.4 Overview

This first route turns basic electrical laws into voltage-divider, loading, component, protection, measurement, and series-parallel decisions.

This is part 1 of 2. Continue with IoT Electricity: Kirchhoff Analysis and Diagnostics for the second focused route.

6.5 Start Simple

Picture a small board with a lamp, a switch, and a sensor. Power must reach each part without heat, damage, or a false reading.

First, name the source and the load. Then check the voltage, the current path, and what each part can bear.

A circuit that works once can still fail when a wire is loose, a part warms up, or the supply dips. Good design leaves room for those changes.

That is the simple story, but it cannot size every part or prove every limit. The worked rules and measurements later in the chapter supply that proof.

Use the Practitioner sections to choose and test real parts. Use the Under the Hood sections to follow the laws, edge cases, and failure limits in more depth.

Plain check

  • Mark the power source. Mark its safe range. Name the load. Name its worst case.
  • Trace the current path. Check each branch. Find each return path. Check the shared ground.
  • Check each part value. Check each unit. Keep some safe margin. Record why it is enough.
  • Test the normal state. Test the start state. Test a loose wire. Test a short path.
  • Watch for excess heat. Watch for dim light. Watch for false input. Stop on unsafe change.
  • Measure before release. Save the test state. Save the meter value. Name the test owner.
  • Change one thing once. Run the same test. Compare the two results. Keep the clear record.
  • Build with Practitioner next. Check the laws below. Use the deeper math. Recheck each limit.

Imagine a door sensor, an LED, and a relay sharing the same board. Each part needs the right voltage, a limited current path, and protection from the ways real wiring can be wrong. Start by naming the source, load, signal, and failure you are designing against before adding more components.

6.6 Learning Objectives

  • Calculate LED current limiting resistor values using Ohm’s Law to prevent component damage in IoT circuits
  • Design voltage dividers to interface 5V sensors with 3.3V microcontrollers using resistor ratio calculations
  • Analyze power budget for battery-powered IoT devices by calculating duty cycles and average current consumption
  • Build series and parallel resistor networks and measure voltage/current distribution using multimeters
  • Select and configure passive components (resistors, capacitors, inductors) for real-world IoT applications including sensor pull-up resistors, signal filtering, and DC-DC converters
In 60 Seconds

Passive components (resistors, capacitors, inductors) shape circuit behavior without external power. Real-world IoT applications include LED current limiting, sensor pull-up resistors, and power budget calculations that determine battery life for deployed devices.

Key Concepts
  • LED Current Limiting Resistor: Calculated as R = (Vsupply - Vf) / If; the LED forward voltage Vf is typically 1.8-2.0 V (red), 2.1-2.5 V (green/yellow), 3.0-3.5 V (blue/white); use If = 5-20 mA for standard indicator LEDs
  • Voltage Divider for Sensor Interface: Two resistors in series produce an intermediate voltage: Vout = Vin x R2 / (R1 + R2); used to read resistive sensors (thermistors, LDRs) as voltage changes, and to drop 5 V sensor outputs to 3.3 V for MCU ADC inputs
  • Pull-Up Resistor for Digital Inputs: A resistor from VCC to a digital input ensures the pin reads HIGH when no device is driving it; typical values: 4.7-10 kohm for I2C, 10-47 kohm for button inputs; prevents floating inputs from reading random values
  • Battery Life Calculation: Runtime = Battery_capacity_mAh / Average_current_mA; for duty-cycled IoT devices: Iavg = Iactive x duty_fraction + Isleep x (1 - duty_fraction); essential for sizing batteries in wireless IoT sensor nodes
  • Power Supply Decoupling: 100 nF ceramic capacitor in parallel with 10 uF electrolytic placed close to each IC’s power supply pins; ceramic absorbs high-frequency transients, electrolytic provides bulk charge for slow current demands; prevents supply noise from affecting circuit performance
  • Fuse Protection: A fuse in series with the power supply that opens (breaks) when current exceeds its rated value; prevents fire and board damage from short circuits and overcurrent conditions; fuse current rating should be 20-50% above maximum normal operating current
  • Circuit Protection Diode: A series diode protecting against reverse-polarity power supply connections; simple but effective for field-deployed devices where connectors may be accidentally reversed; adds one diode forward voltage drop (0.3-0.7 V) to the supply path
  • Current Measurement with Shunt Resistor: A small value resistor (0.01-1 ohm) in series with the power supply enables current measurement via voltage sensing: I = V_shunt / R_shunt; allows monitoring of battery current without expensive current sensor ICs in low-cost IoT applications

Resistors, capacitors, and inductors are the three basic building blocks found in almost every electronic circuit. A resistor is like a narrow section of pipe that limits water flow (limits electrical current). A capacitor is like a small tank that stores and releases water (stores and releases electrical charge). An inductor is like a heavy flywheel that resists changes in flow. Together, they shape how electricity behaves in your IoT circuits.

Time: ~12 min | Level: Intermediate | Unit: P06.C04.U09

6.7 Why This Chapter Matters

Follow these connections in order: This is the chapter where electricity stops being abstract and starts turning into wiring decisions you will actually make on a board. If you build IoT devices, you will repeatedly size LED resistors, create voltage dividers, estimate battery life, and choose decoupling parts. These are not edge cases; they are routine design tasks. A student who understands this chapter can move from “I know the formula” to “I can choose a safe part value for a real circuit.”.

6.8 How To Use This Chapter

  • Read the LED resistor, voltage divider, and power-budget parts in order on a first pass. Those three topics cover most beginner IoT hardware decisions.
  • When a formula appears, pause and substitute one set of numbers from your own project instead of only following the book’s numbers.
  • Treat the component tables as design aids, not memorization targets. The goal is to know what each part is for and when to look it up.
Chapter Roadmap
  • Overview
  • Start Simple
  • In 60 Seconds
  • Key Concepts
  • For Beginners: Passive Components
  • Why This Chapter Matters
  • How To Use This Chapter
  • Phoebe’s Field Notes: Why the Same Three Laws Size the Board
  • IoT Voltage Dividers
  • Voltage Divider Value Trials
  • Checkpoint: Voltage Dividers
  • Real-World Applications in IoT
  • Checkpoint: Everyday Applications

The mathematical gist. Mixed-rail battery life is energy bookkeeping: (P_{avg}=\sum V_iI_i(t_i/T)), then (t=E_{battery}/P_{avg}). This chapter’s 92.4 mA 3.3 V load uses about 305 mW. Running its 5 V, 150 mA heater for 30 of every 300 seconds adds 75.0 mW, so a 7.40 Wh cell gives about 19.5 hours in this ideal budget.

Math Bridge · guided foundationsHow does heater duty cycle become battery runtime?Let Eddie connect rail currents, average power, stored energy, and runtime.

First stop: name the passive parts before calculating with them. A resistor, capacitor, and inductor each changes circuit behavior in a different way, so the table below is a parts map for the design choices that follow.

Passive components don’t require external power and don’t generate power.

6.8.1 Comparison Table

ComponentPropertyUnitSymbolFunctionIoT Application
ResistorResistanceOhm (Ω)Resistor circuit symbol showing a zigzag line between two leadsLimits currentLED current limiting, pull-up/down
CapacitorCapacitanceFarad (F)Capacitor circuit symbol showing two parallel plates between two leadsStores chargePower smoothing, filtering
InductorInductanceHenry (H)Inductor circuit symbol showing a coil between two leadsStores magnetic energyDC-DC converters, RF circuits

Read the table from left to right rather than treating the three symbols as standalone figures. First name the stored or opposed electrical quantity, then match its schematic mark to its circuit function, and finally check the IoT use. That sequence connects symbol recognition to the component calculations that follow.

6.8.2 Capacitors

Function: Store electrical energy as electric charge (like tiny, fast-charging batteries)

Typical Values:

  • µF (microfarad): 10^-6^ F - Power supply decoupling
  • nF (nanofarad): 10^-9^ F - Signal filtering
  • pF (picofarad): 10^-12^ F - High-frequency circuits

IoT Applications:

  • Smoothing power supply voltage for microcontrollers
  • Filtering noise from sensor signals
  • Energy storage for low-power devices

6.8.3 Inductors

The photographs below make inductor a physical comparison: look for changes in package, exposed interfaces, mounting, scale, and service access before treating the forms as interchangeable.

Real photograph of inductor
This real example (Drosselspule im Umspannwerk Bisamberg) shows a physical form of inductor. Use the visible package, interfaces, scale, mounting, and surrounding context as evidence; a catalogue label alone does not establish deployment fit. Photo: Mario Sedlak (talk); CC BY-SA 3.0
Real photograph of inductor
This real example (Precision inductor coil) shows a physical form of inductor. Use the visible package, interfaces, scale, mounting, and surrounding context as evidence; a catalogue label alone does not establish deployment fit. Photo: Tactron Elektronik; CC BY-SA 3.0
Real photograph of inductor
This real example (Inductor filter - Line filter) shows a physical form of inductor. Use the visible package, interfaces, scale, mounting, and surrounding context as evidence; a catalogue label alone does not establish deployment fit. Photo: Marcnovac; CC BY-SA 4.0

Read across the forms as engineering evidence. They share a capability name, but packaging and installation change the electrical, mechanical, environmental, and maintenance constraints.

Function: Store energy as magnetic fields when current flows

Typical Values:

  • mH (millihenry): 10^-3^ H - Power inductors
  • µH (microhenry): 10^-6^ H - RF circuits

IoT Applications:

  • DC-DC converters (boost/buck regulators)
  • EMI filtering
  • Wireless charging coils

A reliable inductors starts by viewing Figure 6.1; it identifies inductors take several physical forms even though all store energy in a magnetic field. The visible turns and ferrite cores set inductance, current capacity, loss, and saturation behaviour, so a value in microhenries is only the beginning of a DC-DC, filter, or charging-coil selection. Photo: Miguel, CC BY-SA 3.0 for the calculation or selection that follows.

Four physical inductors with copper wire wound around ferrite cores in several shapes
Figure 6.1: Inductors take several physical forms even though all store energy in a magnetic field. The visible turns and ferrite cores set inductance, current capacity, loss, and saturation behaviour, so a value in microhenries is only the beginning of a DC-DC, filter, or charging-coil selection. Photo: Miguel, CC BY-SA 3.0

Inspect the physical forms in Figure 6.1: the visible turns distinguish wound constructions while the ferrite bodies indicate different magnetic paths. The caption’s current capacity and saturation behaviour are the engineering consequences: a coil can have the required microhenry value yet overheat or lose inductance at the converter’s peak current. That physical comparison leads directly to checking rated current, saturation current, winding resistance, and frequency loss for the intended DC-DC or filter duty.


6.9 IoT Voltage Dividers

A voltage divider is one of the most fundamental circuits in IoT systems, allowing you to interface sensors operating at different voltages with microcontrollers. When you connect two resistors in series between a voltage source and ground, the voltage divides proportionally based on the resistor values.

Step 1: Identify the Basic Principle

Consider a 5V sensor connected to a 3.3V microcontroller. Connecting them directly would damage the microcontroller’s input pin. A voltage divider solves this:

  • Signal path: 5V source, then R1 (1kΩ), then V_out, then R2 (2.2kΩ), then ground.

Step 2: Calculate the Output Voltage

The voltage divider equation determines V_out:

Vout=Vin×R2R1+R2\begin{aligned} V_{out} &= V_{in} \times \frac{R_2}{R_1 + R_2} \end{aligned}

For our example:

Vout=5V×2.2kΩ1kΩ+2.2kΩ=5V×2.23.2=3.44V\begin{aligned} V_{out} &= 5V \times \frac{2.2k\Omega}{1k\Omega + 2.2k\Omega} \\ &= 5V \times \frac{2.2}{3.2} \\ &= 3.44V \end{aligned}

This is still slightly high for a 3.3V MCU (exceeds absolute maximum rating). Adjust R1 to 1.5kΩ:

Vout=5V×2.2kΩ1.5kΩ+2.2kΩ=5V×2.23.7=2.97V\begin{aligned} V_{out} &= 5V \times \frac{2.2k\Omega}{1.5k\Omega + 2.2k\Omega} \\ &= 5V \times \frac{2.2}{3.7} \\ &= 2.97V \end{aligned}

Now the signal is safely within the 0-3.3V range.

Step 3: Consider Current Draw

Voltage dividers constantly draw current (wasted power). Total resistance should be high enough to minimize current:

Idivider=VinR1+R2=5V3.7kΩ=1.35 mA\begin{aligned} I_{divider} &= \frac{V_{in}}{R_1 + R_2} \\ &= \frac{5V}{3.7k\Omega} \\ &= 1.35 \text{ mA} \end{aligned}

For battery-powered devices, increase resistor values proportionally (15kΩ + 22kΩ) to reduce current to 135 µA while maintaining the same voltage ratio.

Step 4: Account for Loading Effects

The MCU input pin has input impedance (typically >100kΩ for GPIO, ~1MΩ for ADC). If the divider resistance is too high, the input impedance creates a parallel path that affects the output voltage. General rule: keep total divider resistance below 1/10 of the input impedance.

Real-World Application Example

The DHT22 temperature/humidity sensor outputs 5V logic levels. To interface with an ESP32 (3.3V GPIO):

  • Use 1.8kΩ for R1 and 3.3kΩ for R2
  • Output voltage: V_out = 5V x (3.3 / 5.1) = 3.24V
  • Divider current: 5V / 5.1kΩ = 0.98 mA
  • Power loss: 5V x 0.98mA = 4.9 mW

This simple two-resistor circuit protects expensive microcontrollers from overvoltage damage in mixed-voltage IoT systems.

Vera’s Probe Points

  • Measure: V_out at the DHT22 divider midpoint feeding the ESP32 pin.
  • Expect: 3.24 V from 5 V through 1.8 kΩ and 3.3 kΩ; 0.98 mA divider current.
  • Wrong?: loading — divider resistance above about 1/10 of the pin’s input impedance drags the node off the calculated value.

Voltage VeraCheckpoint: Voltage Dividers

You now know:

  • A 5V sensor needs level shifting before it reaches a 3.3V GPIO pin.
  • The 1kΩ plus 2.2kΩ trial still gives 3.44V, while 1.5kΩ plus 2.2kΩ gives 2.97V.
  • Scaling the same ratio from 1.35 mA divider current down to 135 µA matters for battery-powered devices.


6.10 Real-World Applications in IoT

Time: ~15 min | Level: Intermediate | Unit: P06.C04.U10

The divider example protected one input pin. The next question is how the same current, voltage, and resistance checks show up in ordinary IoT outputs and buses.

6.10.1 Application 1: Fan Speed Control

Concept: Adjust resistance to control motor current

Inspect Figure 6.2 before application 1: fan speed control; its labelled elements make fan speed control circuit showing variable resistor controlling current flow to motor, demonstrating speed regulation through resistance adjustment concrete enough to test against the circuit narrative.

A 12V fan circuit compares low resistance at 100 ohm and 120mA with high resistance at 1k ohm and 12mA. Higher resistance lowers current and motor speed.
Figure 6.2: Fan speed control circuit showing variable resistor controlling current flow to motor, demonstrating speed regulation through resistance adjustment

Follow Figure 6.2 from Power Supply through the variable resistance to the motor. At Low R = 100 ohm, the annotation I = 12V/100 = 120mA explains why Motor FAST is the resulting state: less series resistance permits more current. The circuit makes the control principle visible, but it also exposes the practical limitation—an inefficient series element dissipates power—so a transistor driven by PWM is the better next design for a real fan.

6.10.2 Application 2: LED Current Limiting

Problem: LEDs will burn out if connected directly to power supply

Solution: Add a resistor to limit current

Example Calculation:

  • Power supply: 5V
  • LED forward voltage: 2V (typical red LED)
  • Desired current: 20mA (0.02A)
R=VsupplyVLEDI=5V2V0.02A=150Ω\begin{aligned} R &= \frac{V_{supply} - V_{LED}}{I} \\ &= \frac{5V - 2V}{0.02A} \\ &= 150\Omega \end{aligned}

Use a 150Ω or 220Ω resistor (standard value)

6.10.3 Application 3: Sensor Pull-up Resistors

An open-drain sensor can assert LOW but cannot drive HIGH, so the pull-up resistor owns the released state. Start with the logic rail and receiver thresholds, then choose a resistance low enough to charge the bus capacitance before the next sample but high enough to keep sink current within the weakest device rating. Values such as 4.7 kΩ and 10 kΩ are starting points, not universal answers: cable length, device count, leakage, clock rate, voltage, and sleep-current goals all move the feasible range. Verify the released rise time and asserted LOW voltage on the assembled bus, including its final connectors and probes, before accepting I2C communication as reliable.

Why needed: Many IoT sensors have open-drain outputs that need pull-up resistors

Typical values: 4.7kΩ or 10kΩ

Application: I2C communication (covered in Chapter 4)

Voltage VeraCheckpoint: Everyday Applications

You now know:

  • A red LED on a 5V supply with a 2V forward drop and 20 mA target current needs about 150Ω.
  • A 150Ω or 220Ω standard resistor is the practical choice in the LED example.
  • I2C and button inputs use pull-ups such as 4.7kΩ or 10kΩ so idle lines do not float.


6.11 Check the Series Path

Before comparing the lab’s parallel branches, verify the resistance rule for a single series path.

6.12 Continue to the Next Part

Carry this evidence into IoT Electricity: Circuit Labs and Measurement, which begins with Hands-On Labs.