Michael On Everything Else

LoRa-based Home Alarm System

I started a new project recently and this one is centered around LoRa radios.

I’m using two of Adafruit’s RFM9X Feather units as the beginnings of a home alarm system. One unit will be a simple PIR sensor and the second unit will be a receiver or master control unit.

Airspayce’s Radiohead library makes usage very easy. In no time, I’ve been able to code a very simple conversation between the two nodes so that 1) radio traffic is minimal and 2) there is basic message-handling.

I’m also trying to keep everything as simple and minimal as possible, since it’s an alarm system. The fewer places things can go wrong the better. At it’s core, the system currently works like this:

  1. PIR sensor detects a person.
  2. The alarm broadcasts a specific message to any listening nodes.
  3. The receiver receives the message and validates it (looks for a specific message)
  4. The receiver broadcasts a specific acknowledgement to any listening nodes.
  5. The alarm is expecting the acknowledgement and until it receives it, will continue to broadcast the alarm for as long as the PIR is active (currently ~2 seconds)

Both the alarm and the receiver have piezo speakers and can chirp or beep.

I’m waiting on some hardware to make things a bit more pretty and functional, but currently I have a fully functional system. The alarm sensor has only 156 lines of code and the receiver has 117.

The next steps are to add a touch-display and wifi access to the receiver. But with only a couple of days’ work and minimal hardware, I have a system that reliably alerts us.

I was impressed that the two radios are able to talk to each other through our apartment, which has thick concrete walls. I’m currently using untuned, short, wire antennas—properly tuned antennas are on their way. We’re unable to use 5Ghz wifi in our bedroom because of the thick walls so the lower-frequency LoRa radios work well in getting a signal from the front door all the way to the bedroom with signal-strength to spare (RSSI of around -75).