Back to Blog
IoTMarch 1, 202612 min read

How to Implement Thread and Matter for Smart Home Devices

A developer guide to building Thread-networked smart home devices with Matter application layer, covering network formation, commissioning, and data model implementation.

How to Implement Thread and Matter for Smart Home Devices

Thread and Matter together form the emerging standard stack for interoperable smart home devices, where Thread provides the low-power IPv6 mesh networking layer and Matter provides the unified application layer that works across Apple Home, Google Home, Amazon Alexa, and Samsung SmartThings ecosystems. Thread is an IEEE 802.15.4-based mesh protocol operating at 250 kbps on the 2.4 GHz band, designed specifically for low-power home automation with features including self-healing mesh topology, no single point of failure, native IPv6 addressing (every device gets a routable IPv6 address), and router-capable devices that automatically form and maintain the mesh. Matter (formerly Project CHIP) defines device types (lights, locks, thermostats, sensors), interaction models (read, write, subscribe, invoke), and a commissioning flow using BLE or Wi-Fi for initial setup. For embedded developers, implementing a Thread+Matter device requires an 802.15.4 radio (nRF52840, EFR32MG24, or ESP32-H2), the OpenThread networking stack, and the Matter SDK (connectedhomeip), all running on approximately 512 KB flash and 128 KB RAM.

How Does the Thread Network Architecture Work?

A Thread network consists of several device roles. Border Routers bridge between the Thread mesh and external IP networks (Wi-Fi/Ethernet), providing internet connectivity and service discovery via mDNS/DNS-SD. Routers forward packets within the mesh, maintain routing tables, and assist with device joining. Router-Eligible End Devices (REEDs) can promote to routers if the network needs more routing capacity. Sleepy End Devices (SEDs) are battery-powered nodes that spend most of their time sleeping, waking periodically to poll their parent router for queued messages. Minimal End Devices (MEDs) maintain radio-on state for faster response but higher power consumption. Thread uses 6LoWPAN for IPv6 header compression, MLE (Mesh Link Establishment) for neighbor discovery and link management, and the Thread Network Protocol for mesh routing (based on distance-vector routing with route costs derived from link quality indicators).

What Is the Matter Device Architecture?

Matter uses a node-endpoint-cluster model. A physical device is a Node on the Matter fabric. Each node contains one or more Endpoints, where each endpoint represents a logical device function (e.g., endpoint 0 is always the root/utility endpoint, endpoint 1 might be a dimmable light, endpoint 2 might be a temperature sensor). Each endpoint implements Clusters—standardized sets of attributes and commands. The On/Off cluster provides On, Off, and Toggle commands with an OnOff attribute. The Level Control cluster adds brightness with MoveToLevel and Step commands. The Temperature Measurement cluster provides MeasuredValue, MinMeasuredValue, and MaxMeasuredValue attributes. Matter uses the Interaction Model for data exchange: Read (query attributes), Write (set attributes), Subscribe (receive attribute change notifications), and Invoke (execute commands). Security is enforced through CASE (Certificate Authenticated Session Establishment) sessions using per-device DAC (Device Attestation Certificate) chains.

/* Matter light endpoint implementation (connectedhomeip SDK) */
/* Platform: nRF52840 with Zephyr RTOS */

#include <app/clusters/on-off-server/on-off-server.h>
#include <app/clusters/level-control/level-control.h>

/* Cluster callbacks - called when Matter controller sends commands */
void MatterPostAttributeChangeCallback(
    const chip::app::ConcreteAttributePath &path,
    uint8_t type, uint16_t size, uint8_t *value)
{
  if (path.mClusterId == chip::app::Clusters::OnOff::Id) {
    if (path.mAttributeId == chip::app::Clusters::OnOff::Attributes::OnOff::Id) {
      bool on = *value;
      set_led_state(on);  /* Drive GPIO for LED */
      LOG_INF("Light %s", on ? "ON" : "OFF");
    }
  }
  if (path.mClusterId == chip::app::Clusters::LevelControl::Id) {
    if (path.mAttributeId == chip::app::Clusters::LevelControl::Attributes::CurrentLevel::Id) {
      uint8_t level = *value; /* 0-254 */
      set_led_brightness(level); /* PWM duty cycle */
      LOG_INF("Brightness: %d", level);
    }
  }
}

/* Commissioning: Device advertises via BLE, controller pairs and
   provisions Thread network credentials and Matter fabric */
void StartBLEAdvertising(void) {
  /* Discriminator and passcode from factory data */
  chip::DeviceLayer::ConnectivityMgr().SetBLEAdvertisingEnabled(true);
}

How Does Matter Commissioning Work?

Matter commissioning (also called "pairing") follows a defined flow. The user scans a QR code or enters a manual pairing code from the device label, which encodes the device's discriminator, setup PIN, and vendor/product ID. The commissioner (phone app) discovers the device via BLE advertisements, establishes a PASE (Passcode-Authenticated Session Establishment) session using the setup PIN, and then provisions the device with Thread network credentials and Matter fabric identity. The commissioner generates a Node Operational Certificate (NOC) signed by the fabric's certificate authority and installs it on the device. After commissioning, the device joins the Thread network, establishes CASE sessions with controllers, and appears in the smart home app. The entire flow takes 15-30 seconds in practice. Multi-admin commissioning allows a single device to be controlled by multiple ecosystems (Apple Home AND Google Home) simultaneously by opening additional commissioning windows.

What Hardware and Software Stack Do You Need?

Required components for a Thread+Matter device:

  • Radio SoC: Nordic nRF52840 (most mature), nRF5340 (dual-core with dedicated network processor), Silicon Labs EFR32MG24, or Espressif ESP32-H2. All support 802.15.4 radio and have sufficient flash/RAM for Matter+OpenThread.
  • Software stack: OpenThread (networking), Matter SDK (application layer), and RTOS (Zephyr or FreeRTOS). Nordic nRF Connect SDK bundles all three. Total flash usage: 400-700 KB; RAM: 100-180 KB.
  • Border Router: At least one Thread Border Router is required per home network. Commercial options include Apple TV 4K, Google Nest Hub, HomePod Mini, or build your own using a Raspberry Pi with an nRF52840 dongle running ot-br-posix.
  • Certification: Matter certification through the Connectivity Standards Alliance (CSA) is required for product branding. Thread certification through the Thread Group is required for Thread logo usage. Budget 3-6 months and $10K-30K for certification testing.
  • Factory provisioning: Each device needs a unique Device Attestation Certificate (DAC) and Certification Declaration (CD) provisioned during manufacturing. The CSA operates a PKI infrastructure for DAC issuance.

How Does Thread Compare to Zigbee and Wi-Fi for Smart Home?

Thread, Zigbee, and Wi-Fi serve different niches in the smart home. Thread uses 802.15.4 like Zigbee but adds native IPv6, eliminating the need for proprietary translation gateways—any Thread device can be reached via standard IP routing. Zigbee uses its own non-IP networking stack requiring a dedicated Zigbee coordinator and hub-specific integration. Wi-Fi provides high bandwidth (useful for cameras and speakers) but consumes 100-500 mW idle power, making it unsuitable for battery-powered devices. Thread sleepy end devices consume 5-15 uA in sleep mode with parent polling, achieving multi-year battery life on coin cells. Matter unifies the application layer across all three transports: a Matter light bulb can work over Thread, Wi-Fi, or Ethernet using the same application code and controller ecosystem. In practice, battery-powered sensors and switches use Thread, plugged-in devices use Wi-Fi or Thread, and high-bandwidth devices use Wi-Fi.

Key takeaway: Thread provides low-power IPv6 mesh networking over 802.15.4 radio, while Matter provides the unified application layer for smart home interoperability across Apple, Google, Amazon, and Samsung. A Thread+Matter device requires approximately 512 KB flash and 128 KB RAM on SoCs like nRF52840 or ESP32-H2, with commissioning via BLE using PASE and fabric-specific Node Operational Certificates.

How Did We Develop a Thread+Matter Product from Prototype to Certification?

At EmbedCrest, we developed a Matter-over-Thread smart door/window contact sensor from concept to CSA certification for a home security company. The product used an nRF52840 SoC with a reed switch and an LIS2DW12 accelerometer for tamper detection. The firmware implemented Matter's Boolean State cluster (for open/closed state) and Power Source cluster (for battery level reporting) on the nRF Connect SDK with OpenThread and Matter SDK. As a Thread Sleepy End Device, the sensor polled its parent router every 2 seconds, consuming 8.5 uA average current and achieving 3.2-year battery life on a CR2032. The development timeline was 8 months: 3 months for firmware development and hardware design, 2 months for internal testing across Apple Home, Google Home, and Amazon Alexa, and 3 months for CSA certification. The certification process required passing 847 test cases from the Matter Test Harness, Thread Group certification testing (273 test cases), and radio compliance testing (FCC Part 15, CE RED). Total certification cost was $28,000 including test lab fees and CSA membership. The most time-consuming certification issue was an interoperability failure with a specific Google Nest Hub firmware version that incorrectly handled the Boolean State cluster subscription, requiring a workaround in our firmware to send unsolicited reports in addition to subscription-based notifications.

What Are the Practical Challenges of Thread Network Deployment?

Thread network deployment in real homes presents challenges not evident in lab testing. The 802.15.4 radio operates at 2.4 GHz, sharing spectrum with Wi-Fi and Bluetooth, causing interference that degrades mesh reliability. In dense apartment buildings with 20+ Wi-Fi networks visible, Thread packet loss can reach 5-10% without channel selection optimization. Thread's channel manager selects the least congested channel during network formation, but cannot adapt dynamically once the network is established. Second, Thread mesh routing depends on router-capable devices (mains-powered) being distributed throughout the home. If all Thread routers are concentrated in one room (the common case when a user buys multiple smart plugs for the same room), coverage gaps appear in distant rooms. Educate users that at least one Thread router device per room is recommended for reliable mesh coverage. Third, Thread Border Router firmware updates from Apple, Google, or Amazon can change network behavior unexpectedly. We observed a case where a Google Nest Hub firmware update changed the default polling period for Sleepy End Devices from 5 seconds to 1 second, tripling battery consumption on our contact sensors until we deployed a firmware update that explicitly negotiated the polling period.

How Do You Optimize Battery Life for Thread Sleepy End Devices?

Thread Sleepy End Devices (SEDs) achieve low power by sleeping between parent router polls, but the polling interval creates a direct trade-off between power consumption and response latency. A 1-second poll interval provides sub-second responsiveness to commands but consumes 15-25 uA average (from radio wake, poll transmission, and RX window). A 5-second poll interval reduces average consumption to 5-8 uA but adds up to 5 seconds of latency for incoming commands. For sensors that only need to report state changes (door contact, motion), use Synchronized Sleepy End Device (SSED) mode introduced in Thread 1.3: the device specifies a long polling interval (30-60 seconds) for routine maintenance and a short listen interval activated only when an event triggers a report. Implement data batching: buffer multiple sensor readings and transmit them in a single CoAP/Matter message to amortize the radio wake-up energy across multiple data points. Use Thread Link Metrics to monitor link quality with the parent router and proactively switch parents when quality degrades, preventing costly retransmissions that dominate power consumption in poor-signal conditions. In our contact sensor product, these optimizations reduced average current from 15 uA (naive implementation) to 8.5 uA (optimized), nearly doubling battery life from 1.7 years to 3.2 years.

ThreadMatterSmart HomeOpenThreadZigbeeIoTnRF52840

Rajdatt

Lead Embedded Systems Engineer at EmbedCrest Technology

Delivering enterprise grade embedded systems, IoT, and Edge AI engineering solutions.

FAQ

Frequently Asked Questions

Can existing Zigbee devices work with Matter?

Not directly, as Zigbee and Matter use different networking and application layers. However, Zigbee bridges (like the Philips Hue Bridge) can expose Zigbee devices as Matter devices to controllers. Silicon Labs EFR32MG24 supports multi-protocol operation, running Zigbee and Thread simultaneously on the same radio, enabling gradual migration from Zigbee to Thread.

How many devices can a Thread network support?

A single Thread network partition supports up to 250+ active devices in practice, with the specification designed for 300+ nodes. A Thread network can have up to 32 active routers, with the leader automatically promoting REEDs to routers as needed. For larger deployments, multiple Thread network partitions can be bridged through border routers.

Is Matter only for smart home or can it be used industrially?

Matter 1.0-1.3 targets smart home device types (lights, locks, HVAC, sensors, media devices). However, the underlying CHIP protocol and data model are extensible. Industrial applications currently use Thread networking with custom application layers, or CoAP/LwM2M over Thread. Future Matter specifications may add industrial device types, but for now, commercial/industrial IoT uses different application protocols.

Ready to Build Your Embedded Solution?

From Edge AI to industrial IoT, our engineering team delivers end to end embedded systems solutions. Let us discuss your project requirements.

Get in Touch