12  Common Hardware Platforms

12.1 Learning Objectives

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

  • Compare Arduino, ESP32, Raspberry Pi, STM32, and Particle platforms across power, cost, connectivity, and ecosystem dimensions
  • Justify platform selection for specific IoT project requirements using quantitative criteria such as battery life and total cost of ownership
  • Operate interactive simulators to prototype and validate firmware on different platforms before purchasing hardware
  • Assess the strengths, limitations, and production scalability of each platform family

Key Concepts

  • Prototyping Platform: Standardised development board ecosystem (Arduino, Raspberry Pi, ESP32) with consistent pinout, libraries, and community support.
  • Arduino: Beginner-friendly MCU ecosystem with standardised shields and a large library ecosystem, ideal for rapid iteration.
  • ESP32: Dual-core MCU with Wi-Fi and Bluetooth, the dominant prototyping platform for connected IoT devices at $5 per module.
  • Raspberry Pi: Linux-based single-board computer used for IoT gateways, edge AI, and applications requiring full OS support.
  • MicroPython: Python 3 subset running directly on microcontrollers, enabling rapid scripting without C/C++ compilation.
  • PlatformIO: Cross-platform embedded development environment supporting 900+ boards with dependency management and CI integration.
  • Community Ecosystem: Libraries, tutorials, and forum support that dramatically accelerates development on popular prototyping platforms.

Prototyping is building rough, working versions of your IoT device to test ideas quickly and cheaply. Think of it like building a model airplane before constructing the real thing – a prototype reveals problems when they are still easy and inexpensive to fix. Modern prototyping tools make it possible to go from idea to working device in days rather than months.

“Picking the right hardware platform is like choosing the right vehicle for a journey!” said Max the Microcontroller. “An Arduino Uno is like a bicycle – simple, reliable, and great for short trips. An ESP32 is like a car – it has Wi-Fi and Bluetooth built in, so it can go places. A Raspberry Pi is like a truck – powerful enough to carry heavy loads like machine learning and video processing.”

Sammy the Sensor was overwhelmed. “How do I choose?” Max broke it down. “Ask yourself three questions. Do you need wireless connectivity? Go with ESP32. Do you need to run Linux or process images? Get a Raspberry Pi. Is your project simple with just a few sensors? An Arduino is perfect and costs less than five dollars.”

Lila the LED shared a tip. “For IoT prototyping, the ESP32 is the most popular choice because it includes Wi-Fi and Bluetooth at a low price. You can even simulate it online with Wokwi before buying real hardware!” Bella the Battery added her perspective. “From a power standpoint, Arduino and ESP32 can run on batteries for months. The Raspberry Pi needs a constant power supply – it draws way too much current for battery operation. Always consider power requirements when choosing your platform!”

12.2 Arduino Family

12.2.1 Arduino Uno

  • MCU: ATmega328P (8-bit AVR)
  • Speed: 16 MHz
  • Memory: 32 KB Flash, 2 KB RAM
  • I/O: 14 digital, 6 analog
  • Best For: Learning, simple projects, hobbyist prototypes

12.2.2 Arduino Mega

  • MCU: ATmega2560
  • Memory: 256 KB Flash, 8 KB RAM
  • I/O: 54 digital, 16 analog
  • Best For: Projects requiring many I/O pins

12.2.3 Arduino Nano/Mini

  • Compact form factors
  • Same MCU as Uno
  • Best For: Space-constrained projects

12.2.4 Arduino Due

  • MCU: ARM Cortex-M3 (32-bit)
  • Speed: 84 MHz
  • Memory: 512 KB Flash, 96 KB RAM
  • Best For: Computationally intensive applications

12.2.5 Arduino Strengths and Limitations

Strengths:

  • Beginner-friendly IDE and ecosystem
  • Massive community and library support
  • Standardized form factor (shields)
  • Abundant tutorials and examples

Limitations:

  • Limited processing power
  • No built-in Wi-Fi/Bluetooth (except Wi-Fi-enabled variants)
  • 5V logic (compatibility issues with 3.3V devices)

12.2.6 Knowledge Check


12.3 ESP32/ESP8266 Family

12.3.1 ESP32

  • MCU: Dual-core Xtensa LX6, 240 MHz
  • Memory: 520 KB RAM, 4 MB Flash (typical)
  • Connectivity: Wi-Fi 802.11 b/g/n, Bluetooth Classic + BLE
  • Peripherals: Rich (ADC, DAC, touch sensors, SPI, I2C, UART)
  • Power Modes: Deep sleep < 10 uA

12.3.2 ESP8266

  • MCU: Single-core Xtensa L106, 80/160 MHz
  • Connectivity: Wi-Fi 802.11 b/g/n
  • Lower cost and simpler than ESP32

12.3.3 Strengths and Limitations

Strengths:

  • Built-in Wi-Fi/Bluetooth
  • Low cost ($2-10)
  • Low power with deep sleep
  • Arduino IDE compatible
  • Active community

Limitations:

  • Fewer I/O pins than Arduino Mega
  • 3.3V logic only
  • Wi-Fi stack consumes resources

Best For:

  • Wi-Fi-connected sensors
  • Home automation
  • IoT gateways
  • Battery-powered Wi-Fi devices

12.3.4 Knowledge Check


12.5 Raspberry Pi Family

12.5.1 Raspberry Pi 4 Model B

  • Processor: Quad-core ARM Cortex-A72, 1.5 GHz
  • RAM: 1/2/4/8 GB options
  • Connectivity: Gigabit Ethernet, Wi-Fi, Bluetooth
  • Interfaces: USB 3.0, HDMI, GPIO header
  • OS: Raspberry Pi OS (Linux), Ubuntu, Windows IoT

12.5.2 Raspberry Pi Zero/Zero W

  • Compact, low-cost variant
  • Single-core ARM11, 1 GHz
  • 512 MB RAM
  • Zero W adds Wi-Fi/Bluetooth

12.5.3 Raspberry Pi Pico

  • MCU-class board (not Linux-capable)
  • RP2040 dual-core Cortex-M0+, 133 MHz
  • 264 KB RAM
  • Best For: MCU projects needing custom silicon

12.5.4 Strengths and Limitations

Strengths:

  • Full Linux environment
  • Rich software ecosystem
  • Powerful processing for edge computing
  • Extensive peripherals
  • Large community

Limitations:

  • Higher power consumption (2-7W)
  • Not real-time (Linux has scheduling latency)
  • Larger form factor
  • Requires SD card for boot

Best For:

  • Edge gateways
  • Video processing
  • Machine learning inference
  • Complex IoT applications

12.5.5 Knowledge Check


12.6 Other Platforms

12.6.1 BeagleBone Family

BeagleBone Black:

  • Processor: ARM Cortex-A8, 1 GHz
  • RAM: 512 MB DDR3
  • Storage: 4 GB eMMC onboard
  • PRUs: Programmable Real-time Units for deterministic I/O
  • OS: Debian Linux
In 60 Seconds

This chapter covers common hardware platforms, explaining the core concepts, practical design decisions, and common pitfalls that IoT practitioners need to build effective, reliable connected systems.

Strengths:

  • More I/O than Raspberry Pi (65 GPIO)
  • Real-time capable with PRUs
  • Industrial temperature variants
  • Open-source hardware

Best For:

  • Industrial applications
  • Real-time I/O with Linux
  • Robotics and automation

12.6.2 STM32 Nucleo/Discovery Boards

Nucleo Boards:

  • Various STM32 MCU options (Cortex-M0/M3/M4/M7)
  • Arduino-compatible headers
  • ST-Link debugger onboard
  • Professional development environment (STM32CubeIDE)

Strengths:

  • Industrial-grade MCUs
  • Low power optimization
  • Professional toolchain
  • HAL libraries

Best For:

  • Production-intent prototypes
  • Low-power battery applications
  • Professional embedded development

12.6.3 Particle Platform

Particle Photon/Argon/Boron:

  • MCU with integrated Wi-Fi or cellular connectivity
  • Cloud platform included
  • Over-the-air (OTA) updates
  • Cellular data plans for Boron

Strengths:

  • End-to-end IoT platform
  • Easy cloud connectivity
  • Built-in device management
  • Rapid prototyping for connected devices

Best For:

  • Connected products requiring cloud integration
  • Fleet management applications
  • Rapid IoT prototyping

12.7 Worked Example: Choosing a Platform for a Smart Beehive Monitor

A beekeeper cooperative wants to monitor 200 beehives across 15 apiaries. Each hive needs temperature, humidity, and weight sensors with hourly readings, transmitted to a cloud dashboard. Budget: $50 per hive, battery life: 1 year minimum, range to nearest gateway: up to 500 meters.

Step 1: Eliminate non-contenders

Requirement Arduino Uno ESP32 Raspberry Pi 4 STM32L4 Nucleo Particle Boron
Built-in wireless No Wi-Fi+BLE Wi-Fi+ETH No Cellular+BLE
Deep sleep <50 uA N/A 10 uA N/A (600 mA idle) 1.1 uA 3.5 uA
Unit cost $25 $5-10 $55 $15 $40 + data plan
Fits $50 budget (with sensors) Tight Yes No Yes No (recurring cost)

Raspberry Pi is eliminated immediately – 600 mA idle draws would drain any reasonable battery in hours. Particle Boron’s $3/month cellular plan adds $36/year recurring cost per hive. Arduino Uno requires a separate wireless module ($10-15), pushing cost to $40-50 without sensors.

Step 2: Deep comparison of finalists

Factor ESP32 STM32L4 + LoRa module
Unit cost (board only) $5 $15 + $12 (RFM95W) = $27
Wireless range 50-100 m (Wi-Fi) 2-5 km (LoRa)
Gateway requirement Wi-Fi AP at each apiary ($30 x 15 = $450) 3 LoRa gateways ($300 x 3 = $900)
Power per transmission 200 mA x 2s = 0.11 mAh 120 mA x 0.1s = 0.003 mAh
Sleep current 10 uA 1.1 uA
Average current (hourly TX) 121 uA 4.4 uA
Battery life (3000 mAh) 3.4 months 2.8 years
Development ecosystem Arduino IDE, vast libraries STM32CubeIDE, steeper learning curve
Community support Massive (hobbyist + professional) Professional-focused

Step 3: Total cost of ownership (200 hives, 3 years)

Cost Item ESP32 + Wi-Fi APs STM32L4 + LoRa
Sensor nodes (200 x board + sensors) 200 x $35 = $7,000 200 x $47 = $9,400
Gateways/infrastructure 15 x $30 = $450 3 x $300 = $900
Battery replacements (3 years) 2,143 x $2 = $4,286 200 x $2 = $400
Cellular/connectivity 15 x $30/mo x 36 = $16,200 (cellular backhaul) 3 x $10/mo x 36 = $1,080 (TTN)
3-year total $27,936 $11,780

Decision: STM32L4 + LoRa wins despite higher per-node hardware cost ($47 vs $35). The 27× lower average current (4.4 µA vs 121 µA) dramatically reduces battery replacements (200 vs 2,143 over 3 years), and LoRa’s 2-5 km range means 3 gateways replace 15 Wi-Fi access points. The $16,156 savings over 3 years covers the extra development time from STM32’s steeper learning curve.

The 27× average current difference between platforms determines battery lifespan. For hourly transmissions with 3000 mAh capacity:

ESP32: Average current for hourly transmissions:

\[ I_{\text{avg}} = \frac{(10\ \mu\text{A} \times 3598\text{ s}) + (200\text{ mA} \times 2\text{ s})}{3600\text{ s}} = \frac{35,980\ \mu\text{A·s} + 400,000\ \mu\text{A·s}}{3600\text{ s}} = 121\ \mu\text{A} \]

Battery life:

\[ t_{\text{life}} = \frac{3000\text{ mAh}}{0.121\text{ mA}} = 24,793\text{ hours} = 3.4\text{ months} \]

STM32L4: Average current for hourly transmissions:

\[ I_{\text{avg}} = \frac{(1.1\ \mu\text{A} \times 3599.9\text{ s}) + (120\text{ mA} \times 0.1\text{ s})}{3600\text{ s}} = \frac{3,960\ \mu\text{A·s} + 12,000\ \mu\text{A·s}}{3600\text{ s}} = 4.4\ \mu\text{A} \]

Battery life:

\[ t_{\text{life}} = \frac{3000\text{ mAh}}{0.0044\text{ mA}} = 681,818\text{ hours} = 2.8\text{ years} \]

At 200 hives, the ESP32 fleet requires \(200 \times (3 \text{ years} / 0.28 \text{ years}) = 2,143\) battery replacements over 3 years at $2 per unit = $4,286 labor + parts. The STM32L4 fleet needs one replacement per hive (\(200 \times 1 = 200\) batteries at $2 = $400), saving $3,886.

When would ESP32 win instead? If apiaries had existing Wi-Fi (e.g., near farmhouses), eliminating gateway costs. Or if readings were needed every minute rather than hourly – Wi-Fi’s higher bandwidth handles larger payloads more efficiently than LoRa’s 242-byte limit.

Interactive Calculator: Battery Life & TCO Comparison

Explore how transmission frequency and sleep current affect battery life and total cost of ownership across platforms.

Try This:

  1. Switch between ESP32 and STM32L4 to see the default parameters
  2. Change transmission interval from hourly (60 min) to every 10 minutes - watch battery life plummet
  3. Compare a 200-device deployment over 3 years with different platforms
  4. Explore the impact of improving sleep current from 10 µA to 5 µA on ESP32

12.8 Platform Comparison Summary

Platform Processor Connectivity Power Cost Best For
Arduino Uno 8-bit AVR 16MHz None 45mA $25 Learning
Arduino Mega 8-bit AVR 16MHz None 50mA $45 Many I/O
ESP32 Dual-core 240MHz Wi-Fi + BLE 10uA sleep $5-10 IoT
ESP8266 Single-core 80MHz Wi-Fi 10uA sleep $3-5 Simple IoT
Raspberry Pi 4 Quad-core 1.5GHz Wi-Fi + ETH 600mA+ $35-75 Edge compute
STM32 Nucleo Cortex-M various Add modules 1uA sleep $10-25 Professional

: