Back to Embedded Systems Hardware Engineering Series

Capstone 4: Home Automation Hub

April 17, 2026 Wasil Zafar 40 min read

Design a multi-protocol smart home gateway that bridges WiFi, Zigbee 3.0, and Bluetooth Mesh — with local automation rules and Matter protocol support.

Table of Contents

  1. Protocol Comparison
  2. Hardware Architecture
  3. RF Design
  4. Protocol Bridge Firmware
  5. Device Planner
  6. Conclusion

Protocol Comparison

ProtocolFrequencyRangeTopologyMax DevicesPower
WiFi (802.11n)2.4 GHz50 mStar~30High
Zigbee 3.02.4 GHz100 mMesh65,000Very low
BLE Mesh2.4 GHz30 mMesh32,767Low
Thread2.4 GHz100 mMesh~250Very low
Z-Wave (700)868/908 MHz100 mMesh232Low
MatterVariousVariesApplication layerProtocol dependentVaries

Hardware Architecture

Multi-Protocol Hub 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

Coexistence Challenge: WiFi, Zigbee, and BLE all share the 2.4 GHz band. The PCB layout must ensure >20mm antenna separation, use ground plane isolation between radios, and implement time-division multiplexing in firmware to avoid simultaneous transmissions.
# 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.

Draft auto-saved

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.