4.7.2 Zigbee Application Demo: Light Control and Monitoring using Alexa Echo Plus

WBZ451 Curiosity Board

Devices (Device): | PIC32CX1012BZ25048(MCU) on WBZ451 Module |

Peripherals (Used, On-Board): | RGB LED | User Button| UART-USB Converter|

Introduction

This page describes the demo steps for WBZ451 Curiosity board Extended Light control and Monitoring using Amazon Echo Plus (zigbee gateway)

An overview of the demo is shown below.

Hardware Requirement

Tool Qty
WBZ451 Curiosity Boards1
Micro USB cable1
Amazon Echo Plus (Built-in Zigbee smart home hub)1
Smart Phone with Alexa app installed1
Personal Computer1

SDK Setup

Gettting Started with Software Development

Software Requirement

Tera Term

Programming the precompiled hex file or Application Example

Programming the hex file using MPLABX IPE

  1. Precompiled Hex file is located in "<Harmony Content Path>\wireless_apps_pic32cxbz2_wbz45\apps\zigbee\ext_light" folder

  2. For more details on the steps, go to Programming A Device Programming A Device

Note: Users should must the correct Device and Tool information

Programming the Application using MPLABX IDE

  1. Follow steps mentioned in of Running a Precompiled Example document

  2. Open and program the Application Example "ext_light.x" located in "<Harmony Content Path>\wireless_apps_pic32cxbz2_wbz45\apps\zigbee\ext_light\firmware" using MPLABX IDE

For more details on how to find the Harmony Content Path, refer to Installing the MCC Plugin

Demo Description

The demo applications demonstrates the Zigbee protocol functionality of PIC32CXBZ/WBZ family of devices and modules. It consists of a ZigBee 3.0 Coordinator and Router implemented as shown below :

Application Zigbee Logical Device Type Functionality
Amazon Echo PlusCoordinatorDevice capable of controlling and monitoring other devices.
Extended LightsRouterIs a lighting device that can be switched on/off , brightness & color of the light can be adjusted via the color commands.

Zigbee device commissioning:

  • The Zigbee router i.e. Extended Lights can be commissioned and brought to the existing zigbee network formed by Zigbee gateway i.e. Amazon Echo Plus or can create new zigbee Distributed network (if there is no nearby network).

Zigbee Light control:

  • Extended light RGB LED can be controlled from Zigbee Gateway of the same network.

  • When the light status is changed the light change report will be sent to zigbee gateway through Zigbee communication.

Demo Steps:

Hardware & Software Setup
  1. Supply power to WBZ451 Curiosity Board consisting of Extendted light application by connecting a USB cable. Power Supply (PS) Green LED will turn on when connect to PC.
  2. The application activity is shown as "Console Log" through on board UART-USB converter
  • Open Terminal(eg: Tera Term) with the setup as shown below to look for these logs

  • On the PC side virtual COM port connection that corresponds to the board shall have following settings:

    BAUD RATE: 115200 (as configured in SERCOM configuration)
    PARITY: None
    DATA BITS: 8
    STOP BITS: 1
    FLOW CONTROL: None
Additionally, local echo and sending line ends with line feeds shall be enabled in the PC serial terminal application.

Commissioning (Router - Extended Light)

Light can be added to Alexa's Zigbee network by voice commands or by using Alexa mobile app
  • Voice Commands: Open Alexa to discover the Light device. Say “Discover my devices”. or

  • Alexa App:

    • Launch Alexa app, from the menu, select the Add Device.
    • Select the type of smart home device “Light” and select "Other".
    • Initiate Discover Devices
    • Input command : resetToFN on light device.The Light will be discovered and shown as light in Alexa app as shown below.
      Figure 4-17. .

Note: Echo Plus is in discovery mode for 45 secs. Devices wanting to join Echo Plus should initiate joining/connecting procedure within this time limit for a successful join RGB color control from Alexa
  • Either through voice commands like "Alexa, Turn on my first light", "Alexa, Change color of my first light to "GREEN"", "Alexa, increase the brightness of my first light" or from Alexa app the RGB LED can be controlled through Zigbee network

---->

Other Functionalities

  1. On board button actions:

    • When the on board "User Button (SW2)" is pressed for more than 10sec, it can delete all the networking information and will bring the device to factory default state. This functionality is available in both combined interface and light devices.

  2. Persistent Data Storage (PDS): The RGB light status (On/Off) and brightness values are stored in non-volatile memory called PDS. So, power off/on of extended light, these values persist and RGB LED will reflect accordingly. This PDS storage is tied to zigbee network.

    • The light On/Off status, colour and light brightness is being stored in non-volatile memory in this case. So, power off/on, the LED will be updated with light on/off and brightness values retrieved from previous transaction.

Creating Application Device Types From Scratch Using MCC

All the supported device types including this Extended Colour light projects can be generated by following the steps in Generating project from MCC.