Zigbee Realistic Use Case Window Covering

Revision as of 11:22, 11 April 2024 by Registered User

For the sake of brevity, we will refer to Realistic Use Cases (RUC) as an abbreviation throughout this discussion.

1. Introduction

This implementation can be seen as a simple extension of the Wiki: Zigbee RUC Lighting [1], adding another Zigbee cluster for the Home automation aspect.
In the aim to test and verify various functionalities and ensure proper functioning, this approach mixes and maintains several devices with different clusters on the same network.

RUC Window Covering model kit
Connectivity Window Covering model kit.png


2. Getting started

From the Wiki: Zigbee RUC Lighting[1], this project adds a Window Device as Router (ZR) and a Window Controller as End Device (ZED) for Window covering features.

RUC Window Covering
Connectivity Realistic Use Case-Wiki-RUC Window Covering Overview.png


2.1. Hardware requirements

P-NUCLEO-WB55 Pack [2] and STM32WB5MM-DK[3] are required to set up the demonstration.
For more information, please visit STM32WB Development ecosystem

P-NUCLEO-WB55 STM32WB5MM-DK
Connectivity nucleo-description.png
Connectivity STM32WB5MM-Board-Description.png


Additionally, it uses an Arduino Motor Shield Control (AMS) [4] based on the ST dual full-bridge driver L298P [5] to drive a DC motor, enabling the real opening and closing of a window covering.
DC motor specification: 12v, 80rpm

Arduino Motor Shield
Connectivity AMS 645x424.png


2.2. Software and system requirements

All applications are available on the Github hotspot:

  • Zigbee_Coord
  • Zigbee_Shutter_Remote
  • Zigbee_Roller_Shutter

For more information to build Zigbee application, please visit STM32WB Build Zigbee Project
To check messages from the board, use any convenient terminal software via the UART Interface, please visit Wiki: Zigbee Log via UART
One driver was created for Arduino Motor Shield, that could be found with source example.
Please see below Server cluster side for more information.

2.3. Install the Zigbee network

To install the RUC example, please follow the Wiki: RUC - HowTo Join a Zigbee Network and Wiki: RUC - HowTo bind devices.

3. Zigbee Implementation

This example will use the Zigbee cluster Window Covering [6] with the following topology:

  • a Window Covering as ZR with server cluster
  • a Window Covering Controller as ZED with client cluster
Window Covering cluster usage
Connectivity Zigbee Realistic Use Case-Wiki-RUC Window Covering.png


3.1. Window Covering

The server is based on a STM32WB5MM-DK [3], which has a slot to put an Arduino board to expand its functionality.
It uses an Arduino Motor Shield Control (AMS) [4] based on the ST dual full-bridge driver L298P [5] to drive a DC motor, enabling the real opening and closing of a window covering.

One driver was created to enable the following functionalities:

  • Adjust the motor’s speed by modifying the duty cycle of a PWM (driven by a GPIO connected to a timer).
  • Change the rotation direction (driven by a GPIO).
  • Set a break (also driven by a GPIO)
  • Current sensing, with that possibility, this feature detects when the window covering is stuck and stops the motor.

3.2. Window Covering Controller

The client is based on a board P-NUCLEO-WB55 [2] where Switch 1/2/3 on the board can be seen like command Up/Stop/Down.

The client cluster of the Window Covering[6] implements 7 commands but only three commands are used.

  • Up / Open
  • Down / Close
  • Stop

As with the previous example, these commands are associated with callbacks functions on the server side. When an UP command is sent, the corresponding callback function on the server side, initiates the motor rotation to open the window covering.

3.3. Binding and Report process

This use case reuses the same process of Wiki: Zigbee RUC Lighting.
For more information please visit it.

4. Possible Extension

A potential extension is to add the Alarms cluster [7] to notify when the shutter is blocking and flash the LEDs controller to warn User.

5. Acronyms and definitions

Term Definition
ZC Zigbee Coordinator
ZR Zigbee Router
ZED Zigbee End Device
RUC Realistic Use Case
AMS Arduino Motor Shield
GPIO General Purpose Input Output
PWM Pulse Width Modulation
DC motor Direct Current motor

6. References