1527  Case Studies and Worked Examples

1527.1 Learning Objectives

By the end of this chapter, you will be able to:

  • Apply the hardware prototyping framework to real projects
  • Analyze a complete development journey from concept to production
  • Work through component selection and power budget calculations
  • Test your knowledge with comprehensive review quizzes

1527.2 Hardware Prototyping Framework

A complete hardware prototyping framework helps you systematically approach IoT development:

1527.2.1 Platform Selection

Compare platforms based on: - Processing power and memory - Connectivity options (Wi-Fi, BLE, LoRa, cellular) - Power consumption (active, sleep modes) - GPIO availability and interfaces - Development ecosystem and community - Cost and availability

1527.2.2 Component Library

Maintain a catalog of: - Sensors with electrical specifications - Actuators with drive requirements - Communication modules with protocol details - Power components with efficiency data

1527.2.3 Power Budget Analysis

Calculate for each state: - Active current draw - Idle/standby current - Deep sleep current - Estimate battery life based on duty cycles

1527.2.4 Pin Management

Track and validate: - GPIO allocation and conflicts - Voltage level compatibility - Current sourcing/sinking requirements - Shared bus assignments (I2C, SPI)


1527.3 Interactive Simulator: ESP32 IoT Dashboard

TipESP32 Multi-Sensor IoT Dashboard

What This Simulates: Complete ESP32 IoT system integrating sensors, Wi-Fi, MQTT, and local display

System Architecture:

%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#2C3E50', 'primaryTextColor': '#fff', 'primaryBorderColor': '#16A085', 'lineColor': '#16A085', 'secondaryColor': '#E67E22', 'tertiaryColor': '#fff'}}}%%
flowchart LR
    DHT[DHT22] --> ESP[ESP32]
    ESP --> OLED[OLED Display]
    ESP --> MQTT[MQTT Broker]
    MQTT --> DB[Database]
    DB --> Dashboard[Web Dashboard]

    style ESP fill:#2C3E50,stroke:#16A085,color:#fff
    style MQTT fill:#16A085,stroke:#2C3E50,color:#fff

How to Use: 1. Click Start Simulation 2. Watch sensors initialize and connect to Wi-Fi 3. See MQTT connection established 4. Observe sensor readings published every 5 seconds

Key Learning Points:

  1. Multi-Sensor Integration - Reading multiple I/O types simultaneously
  2. Wi-Fi Management - Connection handling with reconnection logic
  3. MQTT Publishing - Reliable data transmission to cloud
  4. JSON Formatting - Standard IoT data serialization
  5. Error Handling - Graceful failure recovery

1527.4 Case Study: Smart Thermostat Development

This case study follows a complete development journey from concept to production.

1527.4.1 Project Requirements

  • Wall-mounted smart thermostat
  • Temperature and humidity sensing
  • Occupancy detection (PIR)
  • Wi-Fi connectivity to cloud
  • Touchscreen display
  • 2-year target lifespan (with AC power)
  • FCC/CE certification required
  • Target retail price: $99

1527.4.2 Phase 1: Proof of Concept (2 months)

Goals: Validate core functionality

Hardware: - ESP32 DevKit - DHT22 sensor (temperature/humidity) - PIR motion sensor - 2.4” TFT display

Key Learnings: - DHT22 too slow (2-second read time) - Display refresh causing Wi-Fi dropouts - Power consumption higher than expected

Iteration 1 Result: Core concept proven, identified technical risks

1527.4.3 Phase 2: Alpha Prototype (3 months)

Improvements: - Replaced DHT22 with SHT31 (faster, more accurate) - Added display buffer to prevent Wi-Fi conflicts - First custom PCB design (2-layer)

PCB Issues Discovered: - Antenna keep-out zone violated (reduced Wi-Fi range) - Power supply noise coupling to ADC - Missing I2C pull-ups

Iteration 2 Result: Functional prototype, 3 PCB respins needed

1527.4.4 Phase 3: Beta Prototype (4 months)

Refinements: - 4-layer PCB with proper ground plane - Switched to ESP32-S3 for improved performance - Added on-device ML for occupancy prediction - Production-intent enclosure design

Testing: - 30-day continuous operation test - Temperature chamber testing (-20C to +60C) - EMC pre-compliance testing

Iteration 3 Result: Production-intent design validated

1527.4.5 Phase 4: Pre-Production (5 months)

Activities: - DFM (Design for Manufacturing) review - Test fixture development - Certification preparation (FCC, CE) - Small batch production (50 units)

Certifications: - FCC Part 15 testing: 2 iterations - CE marking: EMC + safety testing - Total certification cost: $18,000

1527.4.6 Phase 5: Production (2 months)

Final Specifications: - ESP32-S3 (dual-core, Wi-Fi, 8MB flash) - SHT31 (temp/humidity), PIR (occupancy), BH1750 (light) - 3.5” resistive touchscreen - Wi-Fi 802.11n + Bluetooth LE - 24VAC transformer + Li-ion backup - 4-layer PCB, SMT assembly, injection-molded enclosure

Final BOM Cost: $142 at 1000 units Manufacturing Yield: 98.2%

1527.4.7 Timeline Summary

Phase Duration PCB Revisions
POC 2 months 0 (breadboard)
Alpha 3 months 3
Beta 4 months 2
Pre-production 5 months 1
Certification 3 months 0
Production 2 months 0
Total 18 months 6 PCB versions

1527.4.8 Key Takeaways

  1. Plan for 3+ PCB iterations - First designs rarely work perfectly
  2. Certification takes time and money - Budget 3 months and $15-20K
  3. Component selection matters - Wrong sensor choice cost 2 months
  4. DFM review is essential - Production issues are expensive
  5. Test in real conditions - Lab success does not equal field success

1527.5 Comprehensive Review Quizzes

1527.5.1 Quiz 1: Platform Selection

Question: You’re at the Proof-of-Concept prototype stage. Which approach is MOST appropriate?

POC is about β€œQuick validation of concept feasibility.” Breadboarding with dev boards enables rapid iteration to validate ideas cheaply before investing in custom hardware.

Question: Your ESP32 dev board shows 80mA idle current vs 10uA spec. What should you investigate FIRST?

Commercial dev boards include USB-serial converters (CH340: 20mA), voltage regulators (inefficient LDOs: 5-10mA quiescent), power LEDs (5-20mA), which add 30-50mA base consumption. For ultra-low-power, use custom PCBs with only essential components.

1527.5.2 Quiz 2: Component Knowledge

Question: An SMD resistor marked β€œ103” measures what resistance value?

Three-digit SMD code: first two digits are value, third is multiplier (number of zeros). β€œ103” = 10 x 10^3 = 10,000 Ohm = 10k Ohm. Similarly: β€œ104” = 100k Ohm, β€œ473” = 47k Ohm, β€œ220” = 22 Ohm.

Question: Reflow soldering an 0805 capacitor, the solder paste stencil should be what thickness?

Stencil thickness: 0.1-0.15mm (4-6 mil) for fine-pitch, 0.127mm (5 mil) common for standard SMD. For 0805 (2.0mm x 1.25mm), 0.127mm stencil provides adequate paste volume without bridging.

1527.5.3 Quiz 3: Debugging

Question: Your JTAG debugger cannot connect to ARM Cortex-M MCU. Multimeter shows 3.3V on VTREF pin. What should you check NEXT?

VTREF correct means power is good. Most common failures: swapped SWDIO/SWCLK pins, missing pull-up resistors (10k Ohm to 3.3V), wrong pin assignments. SWD requires pull-ups for proper signal levels.

1527.5.4 Quiz 4: PCB Manufacturing

Question: Comparing prototype manufacturing: PCB from OSH Park (USA, $5/sq in, 2-week) vs JLCPCB (China, $2/10pcs, 1-week). When should you choose OSH Park despite higher cost?

OSH Park advantages: USA-based (faster shipping to North America, no customs delays). When 5-day domestic shipping beats 7-14 day international, pay premium. For price-sensitive projects, JLCPCB wins; for urgency, OSH Park shines.

1527.5.5 Quiz 5: Power Design (Multi-Select)

Question: You’re designing a battery-powered environmental sensor PCB. Which THREE design choices will MOST improve power efficiency and battery life?

Options C, D, and F are correct for ultra-low-power design. Low-IQ regulators minimize quiescent current waste. Load switches completely disconnect sensors, eliminating leakage current. MCU deep sleep dominates power budget - 10uA vs 100uA is 10x battery life difference.


1527.6 Knowledge Check: Development Timeline


1527.7 Summary

Hardware Prototyping Stages: - Proof of Concept (PoC): Core feasibility demonstration - Functional Prototype: Complete feature implementation - Engineering Prototype: Production-intent design - Pre-Production Prototype: Manufacturing validation

Platform Selection: - Microcontrollers (MCUs): Low power, real-time, limited resources - Microprocessors (MPUs): High performance, rich OS, abundant resources - Hybrid approaches: Combined MCU+MPU or System-on-Chip (SoC)

Best Practices: - Start simple, build incrementally - Design for testability with debug headers - Plan for 3+ PCB iterations - Budget time and money for certification - Test in real-world conditions