ESP32-C6 Zigbee Tutorial: Build a Zigbee Light with Arduino IDE (2026 Guide)

ESP32-C6 Zigbee Tutorial: Build a Zigbee Light with Arduino IDE (2026 Guide)

If you've already played with Wi-Fi projects on the ESP32-C6, you're about to unlock the chip's real party trick: a built-in 802.15.4 radio that talks native Zigbee, no external dongle required. That's a big deal, because until the C6 came along, adding Zigbee to a DIY project usually meant a separate coordinator module and a pile of extra wiring.

In this guide, you'll turn a bare ESP32-C6 into a working Zigbee light endpoint using nothing but the Arduino IDE, then join it to a real Zigbee network through Home Assistant or Zigbee2MQTT. If you've already followed our ESP32 OTA update guide or built the ESP32-C6 Matter smart light, this is the natural next project — same board, same IDE, a different (and in many homes, more reliable) protocol.

Why Zigbee on the ESP32-C6, Specifically

Zigbee is a low-power mesh protocol built on the IEEE 802.15.4 standard, running in the 2.4 GHz band. Unlike Wi-Fi, every Zigbee device on the network can act as a repeater for its neighbors, so a house full of Zigbee sensors and bulbs actually gets more reliable as you add devices, not less.

The ESP32-C6 matters here because it's one of the few chips that gives you Wi-Fi, Bluetooth LE, Zigbee, and Thread on a single die. That means you can prototype a Zigbee end device today and repurpose the same hardware for a Matter/Thread project later without buying new silicon.

A fair warning before you start: Zigbee mode on the C6 draws noticeably more current than Wi-Fi idle in these early SDK releases, so don't expect coin-cell battery life out of the box — plan on USB or a small LiPo for now.

What You'll Need

  • 1x ESP32-C6 dev board (Dev Module, XIAO ESP32C6, or similar)
  • USB-C cable
  • Arduino IDE 2.x installed
  • A Zigbee coordinator already running — Home Assistant with a Sonoff/ConBee dongle, or Zigbee2MQTT, both work fine
  • Optional: an LED or relay if you want the end device to actually control something

Step 1: Install the ESP32 Board Package

Open Arduino IDE and go to File → Preferences. In "Additional Board Manager URLs," add:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Then open Tools → Board → Boards Manager, search "esp32," and install the package from Espressif Systems. Zigbee support needs a reasonably recent release of this core, so if your Zigbee menu options don't show up later, come back here and update the package first.

Step 2: Configure Board Settings for Zigbee

Plug in your ESP32-C6 and select it under Tools → Board → ESP32 Arduino → ESP32C6 Dev Module. Then set these two options, which is the step most tutorials skip and the one that causes the most "why won't this compile" questions:

  • Zigbee Mode: choose Zigbee ED (End Device) for a simple sensor/light, or Zigbee ZCZR if you want the board to act as a router/coordinator too
  • Partition Scheme: choose one of the Zigbee-labeled partition schemes (e.g., "Zigbee 4MB with spiffs")

Skip either of these and your sketch will either fail to compile or upload but crash on boot.

Step 3: Write the Zigbee Light Sketch

Here's a minimal end-device sketch that exposes an on/off light endpoint over Zigbee:

cpp
#include "ZigbeeCore.h"
#include "ep/ZigbeeLight.h"

#define LED_PIN     LED_BUILTIN
#define BUTTON_PIN  9   // Boot button on most C6 boards
#define LIGHT_ENDPOINT 10

ZigbeeLight zbLight = ZigbeeLight(LIGHT_ENDPOINT);

void toggleLED(bool state) {
  digitalWrite(LED_PIN, state);
}

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT_PULLUP);

  zbLight.setManufacturerAndModel("XlogeDIY", "ZBLight01");
  zbLight.onLightChange(toggleLED);

  Zigbee.addEndpoint(&zbLight);

  if (!Zigbee.begin()) {
    Serial.println("Zigbee init failed, rebooting...");
    ESP.restart();
  }

  Serial.println("Waiting for network join...");
}

void loop() {
  // Hold BOOT for ~5s to factory-reset and re-pair
  if (digitalRead(BUTTON_PIN) == LOW) {
    delay(5000);
    if (digitalRead(BUTTON_PIN) == LOW) {
      Serial.println("Factory reset triggered");
      Zigbee.factoryReset();
    }
  }
  delay(100);
}

Upload it, then open the Serial Monitor. You should see the board announce that it's searching for a network to join.

Step 4: Pair It With Home Assistant or Zigbee2MQTT

  • Home Assistant (ZHA): open the ZHA integration, click "Add Device," and put your coordinator into pairing mode. The ESP32-C6 should show up within a few seconds and appear as a light entity.
  • Zigbee2MQTT: enable "permit join" from the dashboard, and the device will show up in the frontend as soon as it associates.

If the board doesn't show up, double-check the coordinator is actually in pairing mode and that you selected the End Device (not router) mode correctly for a simple project like this.

Common Problems People Run Into

It compiles but crashes on boot. Almost always a partition scheme mismatch — go back and confirm you picked a Zigbee-labeled scheme in Tools, not the default one.

Power draw is higher than expected. This is normal in current SDK builds; Zigbee's low-power sleep modes exist, but the Arduino-layer examples don't enable deep sleep by default. If battery life matters for your build, that's your next optimization step, not a sign something's broken.

It joins, then randomly drops off the network. Usually a power supply issue — the radio draws current in short bursts that a weak USB cable or hub can't keep up with. Swap to a shorter, thicker cable before troubleshooting the code.

Zigbee vs. Matter on the Same Board: Which Should You Actually Build?

If you already followed our Matter-over-Thread guide on this same chip, you might wonder why bother with Zigbee too. Short answer: Zigbee has a much bigger existing device ecosystem and simpler pairing today, while Matter/Thread is newer but has stronger long-term vendor support. Since the C6 supports both, a lot of makers prototype in Zigbee first because the tooling (Home Assistant ZHA, Zigbee2MQTT) is more mature, then migrate specific devices to Matter later as that ecosystem catches up.

FAQ

Does the ESP32-C6 need an external Zigbee module? No. The C6 has a built-in 802.15.4 radio, so Zigbee runs natively without extra hardware.

Can I use Zigbee and Wi-Fi on the ESP32-C6 at the same time? Yes, but concurrent radio use adds complexity and power draw. For a first project, stick to Zigbee-only until the basic flow works.

Will this work on the original ESP32 or ESP32-S3? No. Native Zigbee needs the 802.15.4 radio, which is only present on the C6, C5, and H2 variants.

Is Zigbee mode stable enough for a permanent install? It's usable for hobby projects today, but treat it as still-maturing — expect occasional SDK updates to fix edge cases like the crash and power-draw quirks mentioned above.


If you're building projects like this and want to turn your maker skills into income on the side, it's worth checking out the practical guides over at petlifehacks.page — a useful resource if you're exploring ways to earn online alongside your DIY work.

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.