Protocol Comparison
| Protocol | Frequency | Range | Topology | Max Devices | Power |
|---|---|---|---|---|---|
| WiFi (802.11n) | 2.4 GHz | 50 m | Star | ~30 | High |
| Zigbee 3.0 | 2.4 GHz | 100 m | Mesh | 65,000 | Very low |
| BLE Mesh | 2.4 GHz | 30 m | Mesh | 32,767 | Low |
| Thread | 2.4 GHz | 100 m | Mesh | ~250 | Very low |
| Z-Wave (700) | 868/908 MHz | 100 m | Mesh | 232 | Low |
| Matter | Various | Varies | Application layer | Protocol dependent | Varies |
Hardware Architecture
flowchart TD
A["ESP32-S3
Main Controller
WiFi + BLE"] --> B["CC2652R
Zigbee 3.0
+ Thread"]
A -->|UART| B
A --> C["eMMC
8GB Storage"]
A --> D["Ethernet
W5500 (SPI)"]
A --> E["USB-C
Power + Debug"]
B --> F["PCB Antenna
2.4GHz Zigbee"]
A --> G["PCB Antenna
2.4GHz WiFi/BLE"]
A --> H["Status LEDs
RGB × 3"]
A --> I["Local Web UI
mDNS + REST"]
style A fill:#3B9797,color:#fff
style B fill:#16476A,color:#fff
# Home automation hub BOM — multi-protocol gateway
# Prices in USD at qty 100
bom = [
("ESP32-S3-WROOM-1", "Dual-core 240MHz, WiFi+BLE5", 3.90, 1),
("CC2652R", "Zigbee 3.0 + Thread radio", 4.50, 1),
("W5500", "Ethernet SPI controller", 2.10, 1),
("eMMC 8GB", "KLMAG1JETD-B041 storage", 3.80, 1),
("USB-C PD sink", "FUSB302 + 5V/3A negotiation", 1.20, 1),
("LDO 3.3V", "AMS1117-3.3, 1A", 0.15, 2),
("LDO 1.8V", "AP7361C-18, for CC2652", 0.25, 1),
("Crystal 32.768kHz", "For RTC and Zigbee timing", 0.30, 2),
("RJ45 + magnetics", "Ethernet jack with transformer", 1.80, 1),
("PCB 4-layer", "80x80mm, ENIG, impedance ctrl", 2.60, 1),
("ABS Enclosure", "Desktop mount, 100x100x30mm", 2.20, 1),
("Passives", "Caps, resistors, RF matching", 1.50, 1),
]
print("Home Automation Hub BOM — Qty 100")
print("=" * 65)
print(f"{'Component':<22} {'Description':<33} {'Qty':>3} {'Unit $':>7}")
print("-" * 65)
total = 0
for name, desc, price, qty in bom:
line_total = price * qty
total += line_total
print(f"{name:<22} {desc:<33} {qty:>3} ${price:>6.2f}")
print("-" * 65)
print(f"{'TOTAL BOM':<58} ${total:>6.2f}")
print(f"\nWith assembly + test: ${total * 1.25:.2f}")
RF Design Considerations
# RF coexistence analysis — channel allocation strategy
# 2.4 GHz band: 2400-2483.5 MHz
protocols = {
"WiFi Ch 1": {"center": 2412, "bw": 22, "color": "blue"},
"WiFi Ch 6": {"center": 2437, "bw": 22, "color": "blue"},
"WiFi Ch 11": {"center": 2462, "bw": 22, "color": "blue"},
"Zigbee Ch 15": {"center": 2425, "bw": 2, "color": "green"},
"Zigbee Ch 20": {"center": 2450, "bw": 2, "color": "green"},
"Zigbee Ch 25": {"center": 2475, "bw": 2, "color": "green"},
"BLE Adv Ch37": {"center": 2402, "bw": 2, "color": "red"},
"BLE Adv Ch38": {"center": 2426, "bw": 2, "color": "red"},
"BLE Adv Ch39": {"center": 2480, "bw": 2, "color": "red"},
}
print("2.4 GHz RF Coexistence Map")
print("=" * 60)
print(f"{'Protocol':<18} {'Center MHz':>10} {'BW MHz':>7} {'Range':>20}")
print("-" * 60)
for name, spec in protocols.items():
lo = spec["center"] - spec["bw"] // 2
hi = spec["center"] + spec["bw"] // 2
print(f"{name:<18} {spec['center']:>10} {spec['bw']:>7} {lo}-{hi} MHz")
print("\nRecommended coexistence strategy:")
print(" WiFi: Fix to Channel 1 (2401-2423 MHz)")
print(" Zigbee: Use Channel 25 (2474-2476 MHz) — minimal WiFi overlap")
print(" BLE: Adaptive frequency hopping avoids occupied channels")
print(" TDM: Zigbee TX window: 5ms every 100ms (5% duty cycle)")
Protocol Bridge Firmware
/* Unified device model — protocol-agnostic abstraction layer
Bridges Zigbee, BLE Mesh, and WiFi devices */
#include <stdint.h>
typedef enum {
PROTO_ZIGBEE,
PROTO_BLE_MESH,
PROTO_WIFI,
PROTO_THREAD,
} protocol_t;
typedef enum {
DEV_LIGHT,
DEV_SWITCH,
DEV_SENSOR,
DEV_THERMOSTAT,
DEV_LOCK,
} device_type_t;
typedef struct {
uint64_t ieee_addr; /* Unique 64-bit device address */
protocol_t protocol; /* Source protocol */
device_type_t type; /* Normalized device type */
uint8_t online; /* 1 = reachable */
uint32_t last_seen; /* Timestamp (epoch seconds) */
char name[32]; /* User-friendly name */
/* Generic state union */
union {
struct { uint8_t on; uint8_t brightness; uint16_t color_temp; } light;
struct { uint8_t state; } sw;
struct { int16_t temperature; uint16_t humidity; } sensor;
struct { int16_t setpoint; int16_t current; uint8_t mode; } thermo;
} state;
} unified_device_t;
/* Device registry — up to 128 devices */
#define MAX_DEVICES 128
unified_device_t device_registry[MAX_DEVICES];
uint16_t device_count;
/* Automation rule example:
* IF sensor.temperature > 25°C THEN light.on = 1
* Rules stored in eMMC, evaluated every 1s
*/
Device Planner
Home Hub Device Planner
Plan your smart home device network across protocols. Download as Word, Excel, or PDF.
Conclusion
The home automation hub capstone integrates multi-radio hardware design, RF coexistence engineering, and protocol bridging firmware. The ESP32-S3 + CC2652R combination covers WiFi, BLE, Zigbee, and Thread — with Matter support enabling future-proof interoperability across all major smart home ecosystems.
Next Capstone
In Capstone 5: Industrial Monitoring System, we’ll design a ruggedized industrial sensor platform with 4–20mA inputs, Modbus RTU, and hazardous area compliance.