Quick start guide

Note

Zigbee R22 is currently in maintenance mode, and it is not recommended to use it for new Zigbee designs. While critical bug fixes and security updates will be provided as necessary, it will not receive any enhancements or new features. The Zigbee R23 add-on represents Nordic’s primary solution for future Zigbee developments, offering improvements, support for new features, and support for the nRF52840 SoC and new platforms such as the nRF54L series.

This guide demonstrates some of the basic concepts of the Zigbee network using the Zigbee R22 add-on for the nRF Connect SDK and the nRF Connect for VS Code extension. It guides you through programming and testing of the required samples.

Overview

As part of this guide, you are going to program three Zigbee samples onto three different development kits in order to set up a basic Zigbee network composed of three devices, or nodes. A node is “a testable implementation of a Zigbee application on a single stack with a single network address, and on a single network”.

Zigbee star topology setup for this guide

Zigbee star topology setup for this guide

The figure shows the Zigbee network star topology you are going to set up. See Zigbee topologies for more information.

Each of the samples you will use for forming the network is based on the single-chip, single-protocol architecture, uses the default configuration (that is, without any additional sample extensions enabled) and has a clearly defined role:

  • Zigbee network coordinator demonstrates the Zigbee Coordinator role and supports only the network steering commissioning mechanism.

  • Zigbee light bulb demonstrates the Zigbee Router role and implements the Dimmable Light device specification, as defined in the Zigbee Home Automation public application profile.

  • Zigbee light switch demonstrates the Zigbee End Device role and implements the Dimmer Switch device specification, as defined in the Zigbee Home Automation public application profile. Once commissioned into the network, it looks for devices with the implemented Level Control and On/Off clusters and can control the one that answers first.

All these samples also implement the Basic and Identify clusters, which are the basic Zigbee clusters.

Quick start requirements

For this quick start guide, you need three development kits of the following types:

Hardware platforms

PCA

Board name

Board target

nRF52840 DK

PCA10056

nrf52840dk

nrf52840dk/nrf52840

nRF52833 DK

PCA10100

nrf52833dk

nrf52833dk/nrf52833

nRF 5340 DK

PCA10095

nrf5340dk

nrf5340dk/nrf5340/cpuapp

nRF21540 DK

PCA10112

nrf21540dk

nrf21540dk/nrf52840

You can mix different development kits.

Note

Make sure that you have three development kits before proceeding to the next steps.

Software requirements

For this quick start guide, install the following software:

  • Toolchain Manager - An application for installing the full nRF Connect SDK toolchain.

  • Microsoft’s Visual Studio Code - The recommended IDE for the nRF Connect SDK.

  • nRF Connect for VS Code extension - An add-on for Visual Studio Code that allows you to develop applications for the nRF Connect SDK.

  • SEGGER J-Link - Tool for handling the serial connection.

Set up the software

To set up the required software, follow the steps for the nRF Connect for VS Code extension described in Installing the nRF Connect SDK.

Program the samples

To program the samples, complete the following steps:

  1. Open the nRF Connect for VS Code extension.

  2. Complete the steps listed on the How to build an application page in the nRF Connect for VS Code extension documentation.

  1. Program the application to the board:

    1. Connect your development kit using the serial port.

    2. In the Connected Devices View, click Refresh Connected Devices. Your development kit appears on the list.

    3. In the Actions View, click Flash.

      nRF Connect for Visual Studio Code - Refresh Connected Devices and Flash buttons

    When the programming is done, the LED 3 on the development kit turns on to indicate that the Zigbee network is open. After some time, it turns off and the Zigbee network needs to be reopened (see below).

  2. Add the Zigbee light switch sample.

    Repeat Steps 2 and 3 for the sample.

  3. Add the Zigbee light bulb sample.

    Repeat Steps 2 and 3 for the sample. The LED 4 turns on when the application is started.

  4. Press Button 1 on the development kit programmed with the network coordinator sample to reopen the Zigbee network. After some time, the devices join the Zigbee network. On the development kit programmed with the light bulb sample, LED 3 turns on when the light bulb joins the network. On the development kit programmed with the light switch sample, LED 3 turns on when the device joins the network and LED 4 turns on when the light switch finds a light bulb to control.

Reopening the network

If you find that you are having issues with your devices joining the Zigbee network, it may be because the network needs to be reopened manually. If the network is open, LED 3 on the development kit programmed with the network coordinator sample will be on. If LED 3 is not on, the network is closed and needs to be reopened.

To reopen the network, press Button 1 on the development kit that has been programmed as the network coordinator. By default, the network remains open for 180 seconds at startup, and after Button 1 is pressed. After 180 seconds, the network will close and will need to be reopened.

For more information, see the User interface section for the Zigbee Network coordinator sample.

Test the network

After forming the Zigbee network, test the interaction between the devices:

  1. Press Button 2 once on the development kit programmed with the light switch sample to turn off the light bulb’s LED 4.

  2. Press Button 1 once on the development kit programmed with the light switch sample to turn on the light bulb’s LED 4.

  3. Press and hold Button 2 on the development kit programmed with the light switch sample to decrease the light bulb’s LED 4 brightness.

  4. Press and hold Button 1 on the development kit programmed with the light switch sample to increase the light bulb’s LED 4 brightness.

Next steps

After you complete this quick start guide, we recommend that you get familiar with the following topics: