Zigbee Realistic Use Case Window Covering

Revision as of 09:41, 11 December 2023 by Registered User (→‎Server side)

1. Introduction

This implementation can be seen as a simple extension of the RUC Lighting, adding another Zigbee cluster in the Home automation aspect.
Test and verify various functionality and ensure proper functioning.

2. Cluster implementation

2.1. Server side

The server is based on a STM32WB5MM-DK [1], which has a slot to put an Arduino board to expand its functionality.
It uses an Arduino Motor Shield Control (AMS) [2] based on the ST dual full-bridge driver L298P [3] to drive a DC motor, enabling the real opening and closing on a window covering.
The driver wasn’t enabled initially, so I created one 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 as output UP or LOW).
  • Set a break (also driven by a GPIO set as OUTPU UP or LOW)
  • Current sensing (For each channel will be a voltage proportional to the measured current.The calibration ensures a voltage of 3.3V when the channel delivers its maximum current of 2A.) With that possibility, This feature allowed me to detect when the window covering got stuck and stop the motor.

The server has 10 attributes, but only a few have been implemented by ST’s stack. It posed a real problem for me as I needed to determine whether the functions or attributes existed and, if not, find a way to make them functional. In the end, I didn’t use the cluster’s attributes.

2.2. Client side

Only three commnands are used

3. References