10 Electronics for IoT: Signals and Calculators
10.1 Overview
This first route connects electronics roles and signal boundaries to checkable calculations.
This is part 1 of 2. Continue with Electronics for IoT: Power and Switching for the second focused route.
10.2 Start Simple
Prove One Physical Chain From Input to Action
Picture a planter that reads moisture correctly until its pump starts and resets the controller. The full circuit path matters more than either part alone.
A microcontroller means a small computer built to read inputs and control outputs. Trace its supply, ground, input limits, output drive, and protection before connecting the load.
Test dry, wet, pump start, pump stop, weak supply, and disconnected sensor cases. Keep the circuit, parts, voltage, current, input, output, reset log, and result so another person can repeat the check.
This check covers one board and load, not every electrical fault. The deeper sections develop signals, interfaces, components, protection, power, and measurement.
Imagine a smart planter that must read moisture, switch a pump, and survive battery operation. The calculator is not the design; it is a check on one electrical promise at a time. Start with the part you want to protect, the current it may draw, and the measured evidence that the chosen resistor, transistor, or supply can handle it.
10.3 Learning Objectives
By the end of this section, you will be able to:
- Classify Semiconductor Materials: Distinguish conductors, insulators, and semiconductors by their electrical properties
- Differentiate N-type and P-type: Describe doping processes and predict semiconductor behavior based on impurity type
- Analyze Diode Operation: Trace one-way current flow through PN junctions and select diodes for protection circuits
- Compare Transistor Types: Evaluate BJT versus FET transistors and justify selection for specific IoT applications
- Design Switch Circuits: Calculate component values for transistor-based digital switches in IoT devices
10.4 Why This Chapter Matters
Follow these connections in order: This chapter answers the first practical electronics question most beginners run into: why can a microcontroller sense the world and control loads only when extra circuitry sits between the GPIO pin and the real device. In real IoT hardware, the difference between a project that works and a project that burns parts is usually not “more code.” It is understanding signal levels, current limits, and switching components. After this chapter, a beginner should be able to recognize why a diode, resistor, or transistor is present in a circuit instead of seeing the board as a mystery.
10.5 How To Use This Chapter
- Read the beginner explanation first if electronics still feels vague or intimidating.
- Use this chapter as an orientation page. The goal is to understand the role of each building block before diving into the deeper chapters on materials, diodes, and transistors.
- When you see a real-world example, connect it to a concrete device: fan controller, smart light, relay board, battery-powered sensor, or motor driver.
Chapter path:
- First you separate electricity from electronics and identify the building blocks that let IoT devices sense, decide, and switch loads.
- Then you follow an analog signal from a physical event through conditioning, a 10-16 bit ADC, microcontroller processing, and wireless transmission.
- Next you use the calculators to check resistors, dividers, battery life, and power-path choices with the chapter’s own example numbers.
- Finally you design and verify a MOSFET switch for a 12 V motor controlled from a 3.3 V ESP32 pin.
Checkpoints recap; collapsed examples and quizzes add practice depth.
Simple Analogy: Electronics as the Brain and Nerves
Think of an IoT device like a human body:
- Electricity = blood flowing through veins (provides energy)
- Electronics = brain and nervous system (controls what happens)
- Transistors = neurons (make decisions: “fire” or “don’t fire”)
- Circuits = neural pathways (connect sensors to actions)
Just as your brain decides “too hot → sweat” or “danger → run,” electronics decide “temperature > 75°F → turn on fan” or “motion detected → send alert.”
Why Electronics ≠ Electricity
| Electrical Device | Electronic Device | Key Difference |
|---|---|---|
| Light bulb - flip switch → light on | Smart bulb - phone command → chip decides → light on | Electronics add intelligence |
| Fan - plug in → spins at fixed speed | Smart fan - sensor reads temp → microcontroller adjusts speed | Electronics react to sensors |
| Heater - always on when plugged in | Smart thermostat - monitors temp → turns heater on/off automatically | Electronics make decisions |
The magic ingredient? Transistors - tiny electronic switches that can turn on/off millions of times per second, making all digital logic possible.
Key Building Blocks Explained
| Component | Simple Explanation | Real-World IoT Example | Why It Matters |
|---|---|---|---|
| Voltage (V) | Electrical “pressure” pushing electrons | 3.3V from ESP32 GPIO pin | Too high voltage = fried components |
| Current (I) | Flow of electrons (like water flow rate) | LED draws 20mA | Too much current = overheating |
| Resistance (R) | Opposition to current flow | 220Ω resistor limits LED current | Prevents component damage |
| Ohm’s Law | V = I × R (the fundamental relationship) | V=3.3V, LED Vf=2V, needs 20mA → R=(3.3−2)/0.02=65Ω → use 68Ω resistor | Design every circuit with this |
| Diode | One-way valve for electricity | Prevents battery reverse polarity damage | Protects expensive circuits |
| Transistor | Electronic switch controlled by voltage/current | ESP32 pin (3.3V) controls 12V motor via transistor | Microcontrollers can’t directly drive high-power loads |
Real Numbers: Why You Need Electronics Knowledge
| Without Electronics Knowledge | With Electronics Knowledge | Impact |
|---|---|---|
| Connect LED directly to GPIO → LED or GPIO burns out | Add 220Ω resistor → LED lights safely | Prevent $20 ESP32 damage |
| Control relay with GPIO pin → GPIO pin damaged | Use transistor switch → relay works perfectly | Avoid 40mA relay coil damaging 12mA GPIO |
| Battery lasts 6 months → acceptable? | Optimize with MOSFET load switching → 5 year battery life | 10× improvement |
| Trial-and-error debugging (4 hours) | Read datasheet, calculate voltages → fix in 15 minutes | 16× faster debugging |
The Most Important Electronics Concepts for IoT
-
Transistors as Switches (90% of IoT usage):
- Microcontroller GPIO can only provide 10-40mA
- Motors, relays, high-power LEDs need 100mA to 10A
- Transistor acts as electronically-controlled switch: small signal controls big load
- Example: ESP32 (12mA) → Transistor → 1A LED strip
-
Power vs Signal (Critical distinction):
- Signal: 3.3V GPIO, I2C/SPI data lines (low current, logic levels)
- Power: Motor supply, LED strips, actuators (high current, voltage can vary)
- Never mix these! Use transistor to separate signal from power
-
Current Limiting (Protect everything):
- LEDs without resistors → burn out in seconds
- Transistors without base resistors → damaged GPIO
- Always calculate resistor values, don’t guess
Quick Self-Assessment
Before proceeding, can you answer these?
| Question | Beginner Answer | You Should Know |
|---|---|---|
| “Can I connect a 5V sensor directly to ESP32 (3.3V)?” | “Let me try…” | “No. Use a level shifter or voltage divider.” |
| “LED not lighting, what’s wrong?” | “LED is broken” | “Check polarity, resistor value, voltage, and current.” |
| “How to control 12V motor with ESP32?” | “Connect GPIO to motor wire” | “Use a transistor or MOSFET switch plus a flyback diode.” |
If you got those right, you’re ready for this chapter. If not, read carefully and take notes!
Recommended Learning Path:
- Start: Read this chapter (Electronics Fundamentals) - understand transistors
- Foundation: Study Electricity - master Ohm’s Law and power calculations
- Application: Sensor Circuits - connect real sensors
- Practice: Sensor Labs - hands-on ESP32 projects
Electronics is like having a super-smart brain that can make decisions about electricity!
10.5.1 Traffic Controller Story
the microcontroller was very proud of his special friend - a tiny switch called Terry the Transistor. “Terry can turn electricity on and off super fast!” Max explained. “Even faster than you can blink!”
One day, Temperature Terry detected that a room was getting too hot. “It’s 30 degrees! Too warm!” Sammy reported. Max thought quickly. “Terry, we need to turn on the cooling fan!” But the fan needed lots of electricity - way more than Max could provide by himself. Terry the Transistor said, “Don’t worry, Max! You just give me a tiny signal, and I’ll let the big electricity through to power the fan!”
the LED watched in amazement as Terry worked. With just a whisper from Max (a tiny signal), Terry opened a big gate that let powerful electricity flow to the fan. “It’s like being a traffic controller!” Lila said. “A small hand signal can stop or start huge trucks!” the battery smiled. “That’s exactly right! Electronics are smart controllers. They use tiny signals to control big power - that’s why your tablet can play videos, your toys can talk, and smart homes can do amazing things!”
10.5.2 Key Words for Kids
| Word | What It Means |
|---|---|
| Electronics | Smart parts that can control and direct electricity |
| Transistor | A tiny switch that can turn electricity on/off really fast |
| Microcontroller | A mini computer brain that makes decisions |
| Signal | A message sent using electricity (like a secret code) |
| Chip | A tiny piece with millions of transistors inside |
| Circuit Board | A flat board where electronic parts connect together |
10.5.3 Try This at Home!
Play the Transistor Game!
- One person is the “Microcontroller” (the boss who gives quiet commands)
- One person is the “Transistor” (the gatekeeper)
- Other people are “Electricity” waiting to get through
Rules:
- The Microcontroller whispers “ON” or “OFF” to the Transistor
- When the Transistor hears “ON,” they open their arms and let Electricity people walk through
- When they hear “OFF,” they block the path with closed arms
- The Electricity people can ONLY pass when the Transistor opens the gate!
What you learned: Just like in real electronics, a tiny command (whisper) controls whether big electricity (people) can flow through. That’s how transistors work in all your electronic devices!
10.6 Prerequisites
Before diving into this chapter, you should be familiar with:
- Electricity Fundamentals: Understanding voltage, current, resistance, Ohm’s Law, and power calculations is critical for analyzing transistor circuits and calculating bias resistor values
- Atomic Structure: Basic knowledge of atoms, electrons, protons, and electron shells helps you understand semiconductor physics, doping, and PN junctions
- Circuit Analysis: Ability to read circuit diagrams and apply Kirchhoff’s laws for analyzing transistor switching and amplifier circuits
Transistors are the foundation of all modern computing. Every microcontroller, sensor, and communication module in IoT contains billions of transistors. Understanding how they work is essential for IoT hardware design.
- Semiconductor: Material with controllable conductivity between conductors and insulators; foundation of all electronics
- Doping: Adding impurities to silicon to create N-type (excess electrons) or P-type (excess holes) semiconductors
- Diode: Two-layer semiconductor (PN junction) allowing current flow in only one direction; forward bias conducts, reverse blocks
- Transistor: Three-layer semiconductor acting as voltage/current-controlled switch or amplifier; building block of all digital logic
- BJT (Bipolar Junction Transistor): Current-controlled device where small base current controls large collector-emitter current
- FET (Field Effect Transistor): Voltage-controlled device where gate voltage controls drain-source current; nearly zero input current
10.7 Identifying IC Packages and Breakout Boards
Diode, transistor, BJT, and FET are now names instead of mysteries. It helps just as much to recognize what those parts look like in your hands — both as bare chips and as the breakout boards that package them for hobbyist and IoT use.
10.7.1 IC Package Types
Before applying the specification, inspect the real ic package (dip/soic/qfp) below: its package, terminals, scale, and installation context are part of the engineering evidence.
Carry those visible constraints into the surrounding analysis; the abstract symbol or capability name does not capture mounting, wiring, protection, or service access.
Not every integrated circuit looks the same. The package is the physical housing that protects the silicon die and brings its pins out to something you can solder or plug in:
| Package | Full Name | Pin Style | Where You’ll See It |
|---|---|---|---|
| DIP | Dual-Inline Package | Two rows of through-hole legs | Breadboard-friendly ICs, classroom kits, socketed chips |
| SOIC | Small-Outline IC | Two rows of surface-mount gull-wing leads | Compact production boards, op-amps, logic gates |
| QFP | Quad-Flat Package | Leads on all four sides | Microcontrollers and other high-pin-count chips |
| SMD (general) | Surface-Mount Device | No through-hole legs; solders flat to the board | Most modern production ICs, including SOIC and QFP |
Inspect Figure 10.1 with an end mark that anchors pin numbering. SOIC and Public domain in mind. Look at how it presents these DIP integrated circuits show the breadboard-friendly package in the first row of the table: a protected silicon die inside a black body, with two parallel pin rows and an end mark that anchors pin numbering. SOIC and QFP shrink the same packaging job for surface mounting. Photo: Kimmo Palosaari, Public domain before applying ic package types.
In Figure 10.1, first identify the black DIP bodies and their two parallel rows of metal leads. Next find the end mark that anchors pin numbering; orientation must be established before any pinout is copied to a breadboard. The caption’s SOIC comparison points toward denser surface-mount packages, which preserve the silicon-to-pin function while changing pitch, assembly method, and thermal path. The Public domain credit identifies the photograph’s source, not a package property.
Every DIP and SOIC package marks pin 1 with a notch or dot at one end — find that mark before trusting any pinout diagram, since a chip inserted backward can be damaged the moment power is applied.
A Texas Instruments SN74S08N (a quad-AND-gate logic IC in a 14-pin DIP) shows the pattern every datasheet follows: a pinout diagram numbering each pin around the notch, a logic diagram showing what each pin does functionally, and an internal schematic for engineers who need transistor-level detail. Datasheets also carry the practical numbers a builder needs before committing to a part — the SN74S08N runs about $1.61 for a single unit but drops to around $0.65 each at a 5,000-unit order, the kind of volume-pricing curve that makes ICs economical at production scale but not for a one-off prototype.
10.7.2 Reading a Breakout Board
Before applying the specification, inspect the real generic sensor breakout board below: its package, terminals, scale, and installation context are part of the engineering evidence.
Carry those visible constraints into the surrounding analysis; the abstract symbol or capability name does not capture mounting, wiring, protection, or service access.
A breakout board takes a surface-mount IC too small to hand-solder and brings its pins out to a row of through-hole headers you can plug into a breadboard. Reading one is a repeatable skill: find the power pins first, then ground, then the interface pins.
A thermal-camera breakout built around a small infrared sensor array is a representative example. Its silkscreen labels six pins: Vin (supply voltage in), 3Vo (a regulated output you can tap if you need 3.3V elsewhere), GND (ground), SCL and SDA (I2C serial clock and data — the same bus wires detailed in Serial Bus Interface Contracts), and INT (an interrupt pin the sensor pulls when something changes, so the microcontroller does not have to keep polling it). Once you can name what each pin on an unfamiliar breakout board is for, wiring up a new sensor becomes a matter of matching a handful of labels instead of reverse-engineering a schematic.
Use the diagram in Figure 10.2 to ground reading a breakout board: it shows a sensor breakout makes a tiny surface-mount device usable on a breadboard by exposing power, ground, and bus signals on labeled header pins; read those labels before copying any wiring diagram. Photo: SparkFun Electronics, CC BY 2.0 rather than leaving the relationship implicit.
Figure 10.2 distinguishes A sensor breakout makes a tiny surface-mount device usable on a breadboard by exposing power from and bus signals on labeled header pins; read those labels before copying any wiring diagram. Photo: SparkFun Electronics, then adds ground as the detail that changes the circuit interpretation. This makes a sensor breakout makes a tiny surface-mount device usable on a breadboard by exposing power, ground, and bus signals on labeled header pins; read those labels before copying any wiring diagram. Photo: SparkFun Electronics, CC BY 2.0 visible. It connects to reading a breakout board by identifying the evidence a practitioner should retain.
In one sentence: Transistors are tiny electronically-controlled switches that bridge the gap between low-power microcontroller signals and high-power real-world loads—mastering this concept unlocks all IoT hardware design.
Remember this rule: Always check three things before connecting a load to a GPIO pin—required current (does it exceed GPIO limits?), required voltage (does it match logic level?), and load type (inductive loads need flyback diodes).
Checkpoint: Electronics Roles
You now know:
- Electronics uses semiconductors to control current, while electrical devices mainly consume current.
- GPIO pins are signal outputs; loads such as motors, relays, and high-power LEDs usually need a transistor or MOSFET driver.
- A safe beginner check starts with current, voltage, and load type before any wire is connected.
Next, trace a sensor value: physical event, analog voltage, digital number, then message.
10.8 From Electricity to Electronics
Electronics is the study and application of devices that control electron flow using semiconductors.
While electrical devices (motors, heaters, lamps) just use current flow, electronic devices (computers, sensors, microcontrollers) actively control and manipulate current using semiconductors.
10.8.1 Analog-to-Digital IoT Flow
One of the most critical electronics concepts for IoT is how analog sensor signals are converted to digital data:
Inspect this evidence before proceeding: pause for Figure 10.3 because the labels turn signal flow from physical phenomenon to wireless transmission in IoT systems. Physical events (temperature, light, pressure) are converted by sensor transducers into continuous analog voltages (0-3.3V), conditioned through amplification and filtering circuits, digitized by ADC converters into discrete binary values (10-16 bit resolution), processed by microcontrollers, and transmitted wirelessly. Orange nodes represent analog domain, teal nodes represent digital domain, with ADC as the critical bridge between continuous and discrete signal representations into an observable circuit or material relationship.
First identify Analog-to-digital sensor evidence chain in Figure 10.3, then contrast it with ANALOG DOMAIN and test the claim beside A/D trust boundary. These visible labels explain signal flow from physical phenomenon to wireless transmission in IoT systems. Physical events (temperature, light, pressure) are converted by sensor transducers into continuous analog voltages (0-3.3V), conditioned through amplification and filtering circuits, digitized by ADC converters into discrete binary values (10-16 bit resolution), processed by microcontrollers, and transmitted wirelessly. Orange nodes represent analog domain, teal nodes represent digital domain, with ADC as the critical bridge between continuous and discrete signal representations. They keep analog-to-digital iot flow tied to evidence that can be inspected on the schematic, part, or trace.
This layered variant emphasizes the domain boundaries between physical, analog, and digital realms, helping students understand where signal transformations occur and what challenges exist at each transition.
The calculation ahead needs a visual reference. Inspect Figure 10.4, where domain boundary view showing signal transformations and error sources at each processing stage is labelled for the specific circuit case.
Read Figure 10.4 from Signal domains: every transformation adds uncertainty toward Physical quantity, then verify the detail beside pressure or light. This ordering demonstrates domain boundary view showing signal transformations and error sources at each processing stage. It returns the chapter narrative to a measurable quantity, state, or component choice.
Key Stages Explained:
- Physical → Sensor: Environmental changes (temperature rises from 20°C to 25°C) are converted to electrical signals
- Analog Signal: Continuous voltage proportional to physical quantity (e.g., 10mV per °C)
- Signal Conditioning: Amplify weak signals (µV → mV), filter noise, level shift to ADC input range
- ADC Conversion: Sample analog voltage at regular intervals, quantize to nearest digital value
- Digital Processing: Microcontroller applies calibration, averages readings, detects thresholds
- Wireless Transmission: Packaged data sent via communication protocol to cloud or gateway
Example - Temperature Sensor Chain:
- NTC Thermistor: 10kΩ at 25°C → Voltage divider: 1.65V → Op-amp gain ×2: 3.3V → 12-bit ADC: 4095 → ESP32 converts to 25.0°C → MQTT publishes value
Checkpoint: Signal Path
You now know:
- Physical events become analog voltages before the microcontroller can use them.
- Signal conditioning prepares the voltage for the ADC input range, such as 0-3.3V.
- A 12-bit ADC value like 4095 is not the end of the path; firmware still calibrates and transmits the result.
Once the signal path is clear, the chapter shifts from naming blocks to checking promises. The calculators below make each promise explicit: current limit, divider ratio, runtime, and power architecture.
10.9 Interactive Electronics Calculators
Before diving into semiconductors, let’s master the practical calculations you’ll use daily in IoT development.
10.9.1 Ohm’s Law Calculator
Ohm’s Law (V = I x R) is the foundation of all circuit analysis. Use this calculator and reference when designing your IoT circuits.
Common IoT Applications:
1. LED Current Limiting:
- Supply voltage - LED forward voltage = voltage across resistor
- R = V_resistor / I_desired
- Always use next higher standard resistor value
2. Pull-up/Pull-down Resistors:
- Typical values: 10kΩ (low power), 4.7kΩ (faster switching), 1kΩ (strong pull)
- Higher resistance = less current = longer battery life
- Lower resistance = faster response time
3. Power Budget:
- Calculate power for each component: P = V × I
- Sum total power consumption
- Verify power supply can handle total current
- Check individual component power ratings (¼W, ½W, 1W resistors)
Standard Resistor Values (E12 series): 10, 12, 15, 18, 22, 27, 33, 39, 47, 56, 68, 82 (and multiples: ×10, ×100, ×1k, ×10k, ×100k)
10.9.2 LED Resistor Calculator
LEDs are everywhere in IoT - status indicators, displays, and debugging. This tool calculates the perfect current-limiting resistor.
10.9.3 Voltage Divider Calculator
Voltage dividers are essential for reading analog sensors and interfacing different voltage levels. This tool helps you design voltage dividers for IoT applications.
10.9.4 Battery Life Calculator
Understanding battery life is critical for IoT devices. This tool calculates runtime based on current consumption and sleep modes.
10.9.5 IoT Device Power Supply Architecture
Now that you can estimate battery life, let’s examine how power flows through your IoT device and where optimization opportunities exist:
Inspect Figure 10.5 with LIMIT / CHECK and PROTECTION + CHARGING in mind. Look at how it presents ioT device power supply architecture showing complete power distribution from sources (battery, USB, solar) through power management (charger ICs, LDO regulators, buck converters, PMIC load switching) to device loads (microcontroller, wireless radio, sensors, actuators) with protection circuits (flyback diodes, TVS/Zener overvoltage protection, fuses). Orange nodes are power sources, navy nodes are power regulation, teal nodes are digital loads, gray nodes are high-power loads requiring transistor switches and protection circuits before applying iot device power supply architecture.
At IoT power architecture and release evidence, Figure 10.5 states one side of the design; LIMIT / CHECK introduces the next state or component, and SOURCE + STORAGE names the consequence. The visual shows ioT device power supply architecture showing complete power distribution from sources (battery, USB, solar) through power management (charger ICs, LDO regulators, buck converters, PMIC load switching) to device loads (microcontroller, wireless radio, sensors, actuators) with protection circuits (flyback diodes, TVS/Zener overvoltage protection, fuses). Orange nodes are power sources, navy nodes are power regulation, teal nodes are digital loads, gray nodes are high-power loads requiring transistor switches and protection circuits. The running iot device power supply architecture narrative uses that consequence to decide what is safe and measurable.
10.9.6 Power Source Decision Tree
This decision tree helps IoT designers select the optimal power source based on deployment constraints. Rather than showing power flow, it guides through the critical questions that determine which power architecture is feasible for your application.
Before continuing power source decision tree, trace Figure 10.6; the drawing makes decision tree for selecting IoT power sources: Start with mains availability, consider size constraints and deployment location, then match battery chemistry to expected deployment duration. Solar is viable when average current is low enough for panel sizing. Energy harvesting suits long-term, maintenance-free installations available for a component-level check.
Enter Figure 10.6 at IoT Power Source Decision Tree and answer the mains-availability branch first. A YES route reaches 5V USB or 12V wall, while the alternative continues through size, deployment duration, solar exposure, and harvesting constraints. The ordering prevents battery chemistry from becoming the first guess: establish available infrastructure and average load before selecting the source and its regulation path.
Power Path Strategies:
-
Linear Regulation (LDO): Simple, low noise, but inefficient
- Use for: Microcontroller and sensitive analog sensors
- Efficiency: 60-70% (Vout/Vin)
- Example: 5V → 3.3V LDO wastes (5-3.3) × current as heat
-
Switching Regulation (Buck Converter): Complex but efficient
- Use for: Battery-powered devices, high current loads
- Efficiency: 80-95% regardless of voltage difference
- Example: 12V → 3.3V at 90% efficiency vs 27.5% for LDO
-
Load Switching via PMIC: Gate power to unused peripherals
- Use for: Sensors, radios not continuously needed
- Savings: Eliminate standby current (often 100µA - 10mA per device)
- Implementation: P-channel MOSFET controlled by MCU GPIO
-
Direct Battery Connection: Bypass regulators when possible
- Use for: High-power actuators (motors, solenoids)
- Control: MOSFET switch from MCU GPIO
- Protection: Flyback diode for inductive loads
10.10 Continue to Part 2
Continue with Electronics for IoT: Power and Switching.
