Title
Date
Need
Detect the opening and closing of a door in a home automation system located outside the WiFi/Zigbee range. In this case, the location is a storage room situated four floors away from the main residence.
Purpose
Implement a wireless transceiver device capable of reliably reaching the transceiver located in the residence.
Include a handshake protocol to confirm the reception of data packets.
Send periodic messages that provide continuous feedback on the communication status with the MCU located in the storage room.
Requirements
Communication stability through walls and construction obstacles between the storage room and the residence.
Communication frequency compliant with emission regulations.
Compatibility of the transceiver located in the residence with the current home automation system: Home Assistant
Implemented Solution
Communication is carried out using 868 MHz radio modules, modulated with LoRa technology (without LoRaWAN), following the component chain:
PC (Home Assistant) — WiFi — MCU — LoRa — MCU — Sensor
The prototype, used as a proof of concept, uses the following components:
ESP8266 (WiFi) — ATMEGA32u4 @ 8 MHz — RFM95 (868 MHz) <-> RFM95 (868 MHz) — ATMEGA32u4 @ 8 MHz — Magnetic door sensor
The MCUs will be replaced in the later version with more suitable ones according to the task requirements.
The firmware implements a logic of up to three retransmissions when a packet acknowledgment is not received within a defined time window. Thanks to this solution, door opening and closing is correctly detected in 100 % of cases, without any false positives or false negatives.
Communication tests were performed using antennas with different gains. Increasing the antenna gain did not improve the link quality. This is because a higher-gain antenna has a more directional radiation pattern, which reduces coverage in other directions. Since communication occurs through a building, where propagation depends heavily on reflections and wall penetration, the signal does not benefit from increased directionality and, in some cases, it is even negatively affected.
Gallery
Content pending publication