Maker Andreas Spiess has constructed a bidirectional Residence Assistant-compatible mailbox notifier with a long-range wi-fi transmission system — because of a pair of LoRa transceivers linked to a Microchip ATtiny1614 at one finish and an Espressif ESP32 on the different.
“I wish to construct a long-range bidirectional mailbox notifier,” Spiess explains of the mission. “At the moment, my mailbox notifier makes use of LoRaWAN and The Issues Community. Not too long ago, it has grow to be much less dependable than prior to now […] as a result of LoRaWAN makes use of the ‘aloha’ or ‘transmit and neglect’ precept. IT works excellently with sensors. If a worth doesn’t get by means of, the next one will. That’s not what I would like for my mailbox notifier as a result of it solely transmits knowledge if it reaches a brand new state.”
Whereas one doable answer can be to have the notifier continually transmit its state, that is not a perfect situation for a battery-powered gadget — so Spiess set about changing the wi-fi hyperlink with a easy point-to-point hyperlink, nonetheless utilizing LoRa, with a bidirectional “automated repeat request” or “ARQ” implementation.
“Two switches can wake the battery-powered MCU [microcontroller unit],” Spiess explains. “Each begin the LoRa module, which transfers the suitable ‘EMPTY’ or ‘FULL’ [message] wirelessly. The receiver, or gateway, acknowledges the obtained code by transmitting an ‘acknowledgement’ code. It additionally creates an MQTT message with the present mailbox standing. The gateway is mains-powered and linked to Wi-Fi. The mailbox notifier re-transmits its message till it’s confirmed.”
Spiess has prototyped the brand new system and examined it efficiently, estimating the battery lifetime of the sensor at round eight years. (📷: Andreas Spiess)
Utilizing this technique — with a low-power Microchip ATtiny1614 on the mailbox finish and a Wi-Fi-equipped Espressif ESP32 because the gateway — Spiess will get assured notifications even when the sign is quickly blocked, with out fixed polling. The MQTT message, in the meantime, can set off automations in Residence Assistant, delivering the highly-integrated and strong mail-delivery notification system Spiess had hoped for.
The mission is documented in full within the video embedded above and on Spiess’ YouTube channel; the supply code has been revealed to GitHub beneath the permissive MIT license.