5 Getting Started with Zigbee Applications
This document gives an overview of few key Zigbee 3.0 protocol concepts and guidance on implementing these features on PIC32CX-BZ/WBZ using Microchip software. The document describes how the protocol configurations such as application, device types, clusters, commissioning can be enabled/disabled, configured in a step by step manner using Microchip's embedded software development framework tools. Microchip Harmony Framework is a full feature, production grade, embedded software development platform from Microchip. It provides a framework for creating Zigbee devices running on PIC32CX-BZ/WBZ family of device and modules.
Device Types and Clusters
To allow interoperability among ZigBee products produced by various manufacturers, the ZigBee Alliance has defined a set of standard device types. These device types specify the functionality of a device. This functionality is again dependent on independent functional entities, called clusters which is a container of attributes which can be read/written through command/responses defined by Zigbee Device Profile(ZDP). The alliance also provides a library, ZigBee Cluster Library (ZCL) is intended to act as a repository for cluster functionality. A developer constructing a new application should use the ZCL to find relevant cluster functionality that can be incorporated into the new application so as not to re-invent the wheel.
Zigbee Device reference application implements behavior of Zigbee Lighting and Occupancy (ZLO) devices and Green power device for operation on a Zigbee network.
Supported Device Types
- Combined Interface( Gateway / Coordinator)
- Light devices (OnOff / Dimmable / Color / Extended Color / Temperature Color Light)
- Thermostat
- Color scene controller
- Multi Sensor
- Intruder Alarm System(IAS) - ACE
- Zigbee Green Power (Proxy, Sink) - An additional feature which is enabled on top of the above device types based on its capability.
For more details regarding Zigbee lighting and Occupancy device types, refer to Zigbee Lighting and Occupancy (ZLO) device Specification by Zigbee Alliance.
Microchip Harmony framework allows users to create applications for above supported device types. The MPLAB Code Configurator (MCC) is the GUI based configurator also allows user to select optional clusters as per their use case. Below it can be observed that how the supported device types can be accessed using MPLAB Code Configurator (MCC) tool after launching MCC GUI.
[Follow the step by step procedure to generate a zigbee based project of any supported device type from MPLAB Code Configurator (MCC)](#tasks_1).
Supported Clusters
The clusters in the ZigBee Cluster Library incorporate the concept of a client, who initiates the transaction, and the server, who performs the work. For example, a light switch (color scene controller device type, which implements on/off cluster in client role) initiates the transaction when someone taps the light switch. One or more lights (OnOff device type which implements on/off cluster in server role) complete the transaction by turning on or off and perhaps reporting the status change to some monitoring device(s) (combined interface device type which implements on/off cluster in client role).The table below shows the client/server clusters available for various device types in Microchip Zigbee stack.
S. No | Device Type | Server Clusters | Client Clusters |
---|---|---|---|
1 |
Combined Interface |
Basic Identify Groups Tie IAS ACE Level Control Color Control Alarms Thermostat FanControl Occupancy Sensing Illuminance Measurement Temperature Measurement Thermostat UI IAS Zone |
Basic Identify Groups Scenes OnOnff |
2 |
OnOff Light |
Basic Identify Groups Scenes OnOff |
Basic Identify Groups |
3 |
Dimmable Light |
Basic Identify Groups Scenes OnOff Level Control |
Basic Identify Groups |
4 |
Color Dimmable Light |
Basic Identify Groups Scenes OnOff Level Control Color Control |
Basic Identify Groups |
5 |
Extended Color Light |
Basic Identify Groups Scenes OnOff Level Control Color Control |
Basic Identify Groups |
6 |
Temperature Color Light |
Basic Identify Groups Scenes OnOff Level Control Color Control |
Basic Identify Groups |
7 |
Thermostat |
Basic Identify Groups Scenes Alarms Thermostat Fan Control Occupancy Sensing Temperature Measurement Temperature UI Configuration |
Basic Identify Groups Time Fan Control Occupancy Sensing Illuminance Temperature Measurement |
8 |
Color Scene Controller |
Basic Identify Groups Scenes OnOff Level Control Color Control |
Basic Identify Groups |
9 |
Multisensor |
Basic Identify Groups Occupancy Sensing Illuminance Measurement Temperature Measurement Diagnostics |
Basic Identify Groups |
10 |
Intruder Alarm System (IAS) ACE |
Basic Identify Groups IAS Zones |
Basic Identify Groups IAS ACE |
For more details regarding mandatory or optional clusters for specific device type, refer to, the specification from Zigbee Alliance Link to Zigbee Lighting and Occupancy Devices by Zigbee Alliance
The following figure illustrates how the available clusters can be accessed for a combined interface device type, using MPLAB Code Configurator (MCC) tool. The optional clusters/attributes/commands as per zigbee device specification can be added/removed from the project through configuration as per custom use case.
Reference Examples
The following is the list of Application device types supported as part of reference applications:
-
Combined Interface( Gateway / Coordinator)
-
Light devices (OnOff / Dimmable / Color / Extended Color / Temperature Color Light)
-
Thermostat
-
Color scene controller
-
Multi Sensor (with low power mode enabled)
-
Intruder Alarm System(IAS) - ACE
-
Zigbee Green Power (Proxy, Sink) - An additional feature which is enabled on top of the above device types based on its capability
Few sample application projects are available as reference in the zigbee folder. Other device type projects can be created using MPLAB Code Configurator (MCC) tool. For steps, refer to Zigbee Project Generation
Demo Steps
Following demo steps explain in detail how to establish zigbee network, zigbee commissioning and data exchange between zigbee devices:
Serial Console Commands
For more information, refer to Serial Console Commands
References
IEEE Std 802.15.4™-2006 Part 15.4: Wireless Medium Access Control (MAC) and Physical Layer (PHY) Specifications for Low-Rate Wireless Personal Area Networks (WPANs)