Getting Started with Connected Lighting
Set up your own Zigbee 3.0 network
By Clemens Valens (Elektor Labs)
Introduction: The Promise and Reality of Connected Homes
For many years, the promise of a future where all home objects communicate has been reiterated. Yet, consumers are still waiting. Who hasn't seen demonstrations of smart lightbulbs controlled wirelessly, reconfigurable at will? But how many homes are actually equipped with this technology?
While kits for connected lights and power outlets are commercially available, a multitude of networking and communication standards (Bluetooth, Wi-Fi, custom ISM-band, Zigbee) create incompatibility. This fragmentation means devices from one manufacturer generally cannot communicate with those from another, leaving home automation as a persistent "thing of the future" for most.
Cost is another barrier. With an average of 40 sockets in a US home and a price of approximately $25 per connected lamp/switch pair, outfitting a home could cost around $1,000 – a significant budget just to replace existing wired systems.
However, hope is emerging. In early 2017, Swedish furniture giant Ikea introduced its Trådfri line of connected lamps and dimmers, reportedly based on the new Zigbee 3.0 standard. This development is expected to significantly boost home automation adoption.
From ZigBee to zigbee
ZigBee, conceived in 1998 and standardized in 2003, is a low-power, low-data-rate wireless networking technology designed for Personal Area Networks (PANs) and small-scale projects like home automation and data collection. While the term "ZigBee" was prominent a decade ago, it faded from public view. In reality, the technology evolved, dropping its capital 'Z' and 'B', and discreetly found its way into many products. It's likely that many wirelessly connected lightbulbs or dimmer kits purchased today use zigbee technology, including popular systems like Philips Hue.
Figure 1: Ikea's Trådfri connected lamps and a remote control. According to zigbee network sniffers, these lamps are zigbee 3.0 compatible, though officially they use ZigBee Light Link (ZLL) and ZigBee Home Automation (ZHA).
Figure 2: The Philips Hue personal wireless lighting system, which utilizes the ZLL protocol.
Zigbee 3.0 and Future-Proofing
An inconvenience of earlier zigbee versions was the proliferation of sub-protocols addressing specific needs. Zigbee 3.0 aims to remedy this by offering backward compatibility with Zigbee PRO, ZigBee Light Link (ZLL) 1.0, and Home Automation (ZHA) 1.2. It also supports over-the-air (OTA) firmware upgrades and simplifies device addition (node commissioning), including Touchlink commissioning via Near-Field Communication (NFC).
Beyond zigbee, other standards like Bluetooth and Wi-Fi (with their low-energy derivatives) are also vying for a place in home automation. Smartphones and tablets, ubiquitous and equipped with these technologies, serve as convenient remote controls. The rapid evolution of technology means any universal system must be future-proof, capable of supporting multiple wireless protocols and being field-programmable to accommodate new standards.
A truly future-proof platform for home automation should support several wireless protocols and be field-programmable. Such a multiprotocol platform could do more than just control lights; it could capture sensor data, function as a beacon, and become part of the Internet of Things (IoT), running multiple protocols simultaneously at minimal cost and energy consumption.
Making Connected Lighting Tangible: The Silicon Labs Kit
To experiment with connected lighting, evaluation or demonstration kits from silicon vendors are ideal. This article uses a setup from Silicon Labs, featuring a Raspberry Pi-based zigbee gateway and a sophisticated zigbee node with an LED.
Image: A tablet displaying a "Smart Home" interface. The screen shows the current home status: temperature at 22.6°C, weather as "CLOUDY" with 17°C. Below this are icons for "Home", "Music", "Network", "Security", and "Camera". A circular slider shows a light setting at 45%. Below the main display, days of the week (Monday, Tuesday, Wednesday) are shown.
Figure 3: The Silicon Labs zigbee gateway (ref. RD-0001-0201), built on a Raspberry Pi. It includes the RPi, an enclosure, SD card, Wi-Fi dongle, and MeshConnect stick.
Figure 4: The connected lighting node reference design RD-0085-0401 from Silicon Labs. This board combines a user-programmable EFR32-Mighty-Gecko-based radio module with a sophisticated LED.
Setting Up Your Zigbee 3.0 Network
Getting started requires a gateway and at least one node. The Silicon Labs gateway is built around the ultra-low-power EFR32 Mighty Gecko System-on-Chip (SoC). The kit (RD-0001-0201) includes a Raspberry Pi 2 Model B, a MeshConnect USB stick from CEL, an enclosure, SD card, Wi-Fi dongle, and power adapter. The MeshConnect stick (RD-0002-0201) can also be purchased separately.
The connected lighting node, a reference design (RD-0085-0401), is also available. For example, a capacitive sense dimmable-light switch (RD-0039-0201) can be added to extend the setup.
Prepare the SD Card for the Raspberry Pi
- Using a computer, download the official Raspbian Lite operating system from this URL. It is crucial to use the 2016-05-27 version due to specific driver requirements.
- Insert the SD card into your computer.
- Use Etcher (recommended by the Raspberry Pi Foundation) to install the downloaded image onto the SD card.
- Safely eject the SD card from your computer.
Prepare the Raspberry Pi
- Insert the prepared SD card into the Raspberry Pi (RPi).
- Connect the RPi's Ethernet port to a network router using an Ethernet cable.
- Connect the CEL MeshConnect stick to a USB port on the RPi.
- Insert the Wi-Fi dongle into another USB port on the RPi.
- Optional: Connect a keyboard and monitor to the RPi. This is not strictly necessary for the following steps.
- Power on the RPi.
Finalize Software Installation
- Find the RPi's IP address on your network (e.g., by checking your router's connected devices list).
- Open an SSH session to the RPi's IP address using a tool like PuTTY. If you connected a keyboard and monitor, you can perform these steps directly in the RPi's Command Line Interface (CLI).
- Log in using the username
pi
and the passwordraspberry
. - Enter the command
sudo raspi-config
and press Enter. - In the
raspi-config
utility:- Select option 1, "Expand Filesystem", and wait for it to complete.
- Reboot the RPi when prompted.
Figure 5: The Raspberry Pi requires configuration using the
raspi-config
utility, which can also be used to change the default password. - Reconnect your SSH client (e.g., PuTTY) and execute the following commands one by one, pressing Enter after each. Be careful with typos.
sudo chmod 666 /etc/apt/sources.list
sudo echo deb http://devtools.silabs.com/solutions/apt jessie main >> /etc/apt/sources.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 90CE4F77
sudo apt-get update
sudo apt-get install silabs-zigbee-gateway
sudo apt-get install silabs-networking
sudo reboot
Almost There
At this point, the Raspberry Pi should function as a Wi-Fi access point (AP) and be visible to your computer.
- Connect to the Wi-Fi network named "Silicon Labs xxxx" (where "xxxx" is a 4-digit hexadecimal number).
- Open a web browser and navigate to the IP address
192.168.42.1
.
Figure 6: The web interface for the Silicon Labs Zigbee Gateway. All status lights are green, indicating readiness. The '➕ ZigBee3.0 Device' button is used to add new nodes.
Run the Gateway: Adding Nodes
If you see "ZigBee 3.0 Network: Up" in green, proceed to the "Run the Gateway" section.
Connect via SSH to 192.168.42.1
using your SSH client (e.g., PuTTY) and log in as before (username pi
, password raspberry
). Ensure the MeshConnect stick is connected and identify its serial port (e.g., /dev/ttyUSB0
).
Execute the following commands to update the gateway firmware:
sudo service siliconlabsgateway stop
cd /opt/siliconlabs/zigbeegateway/
sudo python tools/ncp-updater/ncp.py scan
sudo python tools/ncp-updater/ncp.py flash -p /dev/ttyUSB0 -f firmware/ncp-uart/em3588/*.ebl
sudo reboot
Now, build your connected lighting network by adding nodes:
- Connect a computer, smartphone, or tablet to the gateway's Wi-Fi network as described previously (steps 17 and 18).
- Connect the EFR32MG zigbee node RD-0085-0401 to a USB power source.
- Set the 'Select' switch on the node to the right position ➡️ to activate the network status LED.
- Set the VDD Off/On switch to the right position ➡️.
- Set the LVL Lo/H switch to the right position ➡️.
- In the browser interface, click or tap the '➕ ZigBee3.0 Device' button. Listening for new devices lasts for 120 seconds but can be extended.
- On the zigbee node RD-0085-0401, press the S1 button 10 times rapidly to enter "join mode". The board should appear in the interface as 'Dimmable Color Light - 0xXXXX - 1 - (Joined)', where XXXX is a 4-digit hexadecimal number.
Figure 7: The connected lighting node RD-0085-0401 has been successfully added to the zigbee 3.0 network.
Figure 8: The complete web interface for controlling the connected light. It shows brightness, color temperature, hue, and saturation controls. The "No Images Found" message at the bottom indicates that firmware images for Over-The-Air (OTA) programming need to be placed in a specific directory.
And Now?
You now have a functional zigbee network ready for experimentation. You can explore further by customizing the gateway, designing your own nodes, or integrating other devices. The future of connected lighting is now partly in your hands.
Shutting Down the Gateway
It is improper to switch off a Raspberry Pi by simply pulling its power. Like any modern computer running a complex operating system, it must be shut down properly to avoid file corruption. The RPi does not have a power button, but it can be shut down from a terminal (directly or via SSH) using the command:
sudo poweroff
Wait until the green LED stops blinking (the red LED will remain on), then unplug the power supply.
More Information
For comprehensive details on the gateway, its options, capabilities, and possibilities, refer to the Silicon Labs document:
- [1] UG129: Zigbee Gateway Reference Design User's Guide (RD-0001-0201, RD-0002-0201).
For full details on the Zigbee node, consult the document:
- [2] UG252: ZigBee Lighting Reference Design Demo Board Kit User's Guide (RD-0085-0401, RD-0035-0601). Schematics and other design files are also available for download.
FROM MOUSER
- 634-RD-0001-0201: Silicon Labs Zigbee/Wi-Fi Gateway
- 634-RD-0085-0401: Silicon Labs Zigbee Lighting Kit