banner
Home / Blog / Playing with Sonoff Zigbee & WiFi automation
Blog

Playing with Sonoff Zigbee & WiFi automation

Dec 26, 2023Dec 26, 2023

I don’t think I’ve ever used Zigbee, but I’ll soon have the opportunity as ITEAD sent me the Sonoff ZBBridge gateway, a Sonoff T2 2-gang WiFi switch as well as a Zigbee motion sensor.

I had reviewed several Sonoff devices in the past, but it had been over three years that I hadn’t. ITEAD recently contacted me basically telling me I could select whatever I wanted from their product list for a review on CNX Software. Since I had reviewed several of the company’s WiFi smart sockets, smart switches, and a light bulb, I had less to play with, and then I thought it might be fun to play with Sonoff Zigbee products. But I did not own any Zigbee hardware, so I had to think about a use case.

I have a small annoyance in the house I rent. When we come back at night, we have to leave the car headlights on until I turn on the light on the porch. So it would be nice if the light could be triggered automatically upon motion detection, while still giving me the option to manually turn on and off the light as needed. That’s how the idea started, but I had to figure something out first…

I had no idea what standard was used in Thailand for the light switch. So I asked in a Thai Facebook private group about Sonoff, and was told to use a Sonoff switch for the US market, meaning either Sonoff T0 (WiFi only) or T2/T3 (WiFi + 433 MHz RF) from the Tx series. I was also told to make sure both neutral and live were connected, which they were, as some installations may only include the live wire. I eventually asked for a 2-gang T2 switch, plus Sonoff ZBBridge for Zigbee <-> WiFi connectivity, and a Zigbee motion sensor.

When the DHL delivery man called me, I was a bit surprised as he had two bags to give me. It turns out the company sent me two sets of the hardware I asked for.

Very convenient to take a photo of both sides of the packages! I intend to use one set with eWelink first, so maybe I’ll use the second with ESPHome or Tasmota, or alternatively, keep it for next year’s giveaway week on CNX Software. Let’s open three packagings from one of the sets.

Sonoff T2 WiFi + RF433 switch comes with mounting screws plus a multilingual quick installation guide, the Sonoff ZBBridge only ships with its quick user guide, plus the motion sensor package included a double-sided sticker for attachment, as well as a quick user guide.

I would not usually think about opening the motion sensor, but since the case is made to be easily opened……I could not resist, it’s actually a requirement because one needs to remove some paper that prevents the CR2450 battery from being depleted during transportation/storage before being used.

Time to open Sonoff ZBBridge (aka Sonoff Zigbee Bridge) gateway. We’ll need to take out the four rubber pads, loosen four screws before removing the bottom cover.

Not much to see on that side of the Zigbee 3.0 gateway. We can just remove the board from the enclosure to have a closer at the main components. A Silicon Labs MG21 module is used for Zigbee connectivity, while an ESP8285 chip provides WiFi connectivity. Both are using PCB antennas. A Micro USB port is used for power, and there’s a pairing button that shows as a pinhole once in the enclosure.

Sonoff Tx wireless switches come with 1, 2, or 3 gangs, and each model comes with the same enclosure with support for up to three gangs.

Each wire is secured with a screw. The model I have features neutral, the live input, and two live output to connect to the lights. Let’s separate the two plastic parts of the enclosure, as this will be needed for installation.

Again, the board is powered by an ESP8285 WiFi microcontroller, and fitted with two touch sensors with the PCB designed for three. We can also see a 4-pin UART that can be used to program the Espressif chip, as well as another 4-pin header with VCC, C2D, C2CK, and GND. That header is for Silicon Labs C2 serial communication protocol designed to enable in-system programming, debugging, and boundary-scan testing on low pin-count Silicon Labs devices such as the “Busy Bee” BB10 8-bit 8051 MCU used here, apparently to control the touch sensors.

Let’s carry on with the teardown by pulling out the MCU board connect to the power board via an 8-pin header. There are some thick traces for the mains as one would expect. We’ll need to remove the four screws holding the TOUS POWER board in place, and the four terminal screws to completely take out the board.The only oddities are the “via holes” on the high power traces. If I understand correctly it’s called Via stitching and can help decrease the heat generated with the extra solder added during soldering, among other benefits.

The power board is also fitted with two 10A/250AC relays as advertised.

To get an idea about pricing, I’ll use Banggood where ZBBridge is sold for $16.28, Sonoff SNZB-03 motion sensor goes for $9.49, and a 2-gang Sonoff T2 wireless switch is sold for $20.08. So the total comes up to about $45 including shipping. You’ll also find those on ITEAD website.

I’ll now have to replace the wall switch for my lights with Sonoff T2, place the motion sensor in a strategic location, set up the Zigbee gateway, and configure all that with eWelink Android app.

Continue reading “Setting up a motion activated light with Sonoff Zigbee sensor and T2 WiFi switch“.

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.

Support CNX Software! Donate via cryptocurrencies or become a Patron on Patreon

Related posts:

Setting up a motion activated light with Sonoff Zigbee sensor and T2 WiFi switch