Zigbee: Network coordinator

This Zigbee network coordinator sample establishes the Zigbee network and commissions Zigbee devices that want to join the network.

You can use this sample together with the Zigbee light bulb and the Zigbee light switch to set up a basic Zigbee network.


The sample supports the following development kits:

Hardware platforms


Board name

Build target

nRF52840 DK




nRF52833 DK




nRF5340 DK




nRF21540 DK




You can use one of the development kits listed above.

Optionally, you can use this sample with one or both of the following samples:

You can mix different development kits.


This Zigbee network coordinator sample demonstrates the Zigbee Coordinator role. It is a minimal implementation that supports only the network steering commissioning mechanism.


See Configuring your application for information about how to permanently or temporarily change the configuration.

FEM support

You can add support for the nRF21540 front-end module to this sample by using one of the following options, depending on your hardware:

  • Build the sample for one board that contains the nRF21540 FEM, such as nrf21540dk_nrf52840.

  • Manually create a devicetree overlay file that describes how FEM is connected to the nRF5 SoC in your device. See Set devicetree overlays for different ways of adding the overlay file.

  • Provide nRF21540 FEM capabilities by using a shield, for example the nRF21540 EK shield that is available in the nRF Connect SDK. In this case, build the project for a board connected to the shield you are using with an appropriate variable included in the build command. This variable instructs the build system to append the appropriate devicetree overlay file. For example, to build the sample from the command line for an nRF52833 DK with the nRF21540 EK attached, use the following command within the sample directory:

    west build -b nrf52833dk_nrf52833 -- -DSHIELD=nrf21540_ek

    This command builds the application firmware. See Programming nRF21540 EK for information about how to program when you are using a board with a network core, for example nRF5340 DK.

Each of these options adds the description of the nRF21540 FEM to the devicetree. See Radio front-end module (FEM) support for more information about FEM in the nRF Connect SDK.

To add support for other front-end modules, add the respective devicetree file entries to the board devicetree file or the devicetree overlay file.

User interface

LED 3:

Indicates whether the network is open or closed:

  • On - The network is open.

  • Off - The network is closed.

Button 1:

Reopens the network for 180 seconds.


The network is also opened after start-up.

Building and running

Make sure to configure the Zigbee stack before building and testing this sample. See Configuring Zigbee in nRF Connect SDK for more information.

This sample can be found under samples/zigbee/network_coordinator in the nRF Connect SDK folder structure.

See Building and programming an application for information about how to build and program the application.


After programming the sample to your development kit, test it by performing the following steps:

  1. Turn on the development kit that runs the coordinator sample. When LED 3 turns on, this development kit has become the Coordinator of the Zigbee network and the network is established.

  2. Turn on the other development kits that you programmed.

    • When LED 3 turns on the development kit that runs the light bulb sample, it has become a Router inside the network.

    • When LED 3 turns on the development kit that runs the light switch sample, it has become an End Device, connected directly to the Coordinator.


    If LED 3 on the development kits does not turn on, press Button 1 on the Coordinator to reopen the network.

  3. Optionally, if you are testing with both the light bulb and the light switch samples, complete the following additional steps:

    1. Wait until LED 4 on the development kit that runs the light switch sample turns on. This LED indicates that the switch found a light bulb to control.

    2. Use buttons on the development kit that runs the light switch sample to control the light bulb, as described in the light switch sample’s user interface section. The result of using the buttons is reflected on the light bulb’s LED 4.

You can now use buttons on the light switch to control the light bulb, as described in the User interface section of the light switch sample page.


This sample uses the following nRF Connect SDK libraries:

This sample uses the following sdk-nrfxlib libraries:

In addition, it uses the following Zephyr libraries:

  • include/zephyr.h

  • include/device.h

  • Logging