This project uses a Digi Xbee3 wireless Zigbee module and a Sparkfun ESP32 ThingPlus board to implement a Zigbee to WiFi bridge. The bridge passes Zigbee sensor data over WiFi to the Machinechat JEDI One IoT platform. For the bridge, the Xbee3 module is configured as a Zigbee coordinator that echoes received sensor data over UART to the ESP32 ThingPlus. The ESP32 reads received UART data, parses the sensor data into a json string and sends over WiFi to the JEDI One. The Xbee3 application code is implemented in MicroPython and the ESP32 application code implemented in Arduino.
.The connection schematic and bill of material for the zigbee to WiFi bridge is contained in the scheme-it project zigbee_wifi_bridge
For testing purposes, an Amphenol T9602 temperature/humidity sensor is connected to a second Xbee3 wireless module configured as a Zigbee router to provide sensor data for the project.
The connection schematic and bill of material for the T9602 zigbee sensor is contained in the scheme-it project XB3_T9602.
The Machinechat JEDI IoT platform is configured to display and monitor the T9602 sensor data.
Software:
Project Parts:
ESP32 board
Digi Xbee 3 Zigbee module and antenna (qty = 2)
Amphenol T9602 Sensor
Sparkfun ESP32 ThingPlus Arduino WiFi bridge project details
In this Arduino project the ESP32 board is set up to receive sensor data over the UART from the Xbee 3 Zigbee coordinator. The ESP32 reads the sensor data, parses it into a json string and sends it over WiFi to the JEDI One for processing.
In Arduino, use below link in the " Additional Boards Managers URLs " field: to add ESP32 support.
https://dl.espressif.com/dl/package_esp32_index.json
For setting up the board refer to:
For details setting up the Arduino software refer to:
Add these libraries thru Arduino’s Library Manager:
Example T9602 sensor data json string sent to JEDI one:
{“context”:{“target_id”:“T960AAC9AD”},“data”:{“data2”:59,“data3”:0,“data1”:32}}
Arduino sketch “esp32_WiFi_zigbee.ino” and source code located in below Github link.
Github link: https://github.com/eewiki/machinechat/tree/master/Zigbee%20WiFi%20Bridge
Digi Xbee3 MicroPython WiFi bridge project details
In this MicroPython project the first Xbee3 module is configured as a Zigbee coordinator with MicroPython REPL mode enabled. The Xbee3 coordinator establishes the Zigbee network and echoes any received sensor data over the UART to the ESP32.
Example T9602 Zigbee sensor data message sent over UART to the ESP32:
MsgFrom:0013A20041AAC9AD:T9602:810155769:Humidity:34.60083%:Temp:60.87921F:#
MicroPython source code “ZigbeeCoordEchoServer.py” located in below Github link.
Github link: Xbee3-MicroPython/WeatherCenter at master · eewiki/Xbee3-MicroPython · GitHub
Digi Xbee3 MicroPython T9602 sensor project details
In this MicroPython project the second Xbee3 module is configured as a Zigbee router with the same network ID as the Xbee3 coordinator used in the bridge and MicroPython REPL mode is enabled. For more detailed information on the sensor and implementation refer to on eewiki project Xbee3 Micropython and Amphenol T9602 Humidity Temperature Sensor .
MicroPython source code “T9602home_r1.py” located in below Github link.
Github link: Xbee3-MicroPython/WeatherCenter at master · eewiki/Xbee3-MicroPython · GitHub
References