I’ve been building a home automation system for several years. Today, Internet of Thing devices measure the environment in four locations, track movement of people (and cats) throughout the house, turn appliances on and off, integrates with Alexa voice commands, incorporate digital clocks for visual messages, use MQTT messages between devices and Adafruit.io for data analysis.
Several IoT devices have piezo buzzers for alarm notification but they were not very loud. A couple of years ago I published an example of one called “Harry’s Horn." It was fun and worked but it did not really have the decibels an alarm needed. After a little research I settled on a 12 volt siren. This project I call diysiren is the first phase prototype on both a breadboard and protoboard. All the code is production ready.
My do it yourself (DIY) home automation system is built on a variety of Raspberry Pi servers and a few Espressif boards. An open source MQTT message broker and bridge coordinates all of the data and command transfers (subscriber/publisher model). All of the Raspberry Pi code is written in Python3 with the latest Raspbian build.
I use the Mosquitto open source MQTT server and I've found it to be easy to use and very reliable.The diysiren application subscribes to three topics:
- diy/system/panic - loud oscillating siren
- diy/system/fire - loud continuous siren
- diy/system/who - device status update (in construction)
The application waits for one of these messages and uses a NPN MOSFET switch to provide power to the 12 volt siren.
Construction in Phases
My first step was to build the application on a breadboard. I solder my ESP32 Wemos boards upside down to better view the pin numbers. I also use long male/female headers for the inside pins and female headers for the outer pins.
I'm a Mac user and rely on Keynote to design my protoboards. The diagram below is easy to follow when you are soldering the protoboard.
Protoboard design using Mac Keynote
The finished protoboard is ready to install in a project box. The ESP32 Wemos can also be programmed and debugged right on the protoboard. I like Adafruit's protoboards because your project can transition from breadboard to product very easily.
As Socrates said, "to know thyself is the beginning of wisdom", my two weaknesses are soldering and enclosures. For this project I found an electrical box enclosure at Lowes that might work. After a bit of "hacking" I made it fit for the first version of the home automation alarm.
Ready to Mount
Ok, i managed to fit the protoboard into the electrical box enclosure with a little help from anti-static foam. A larger or better fitting project box would make this more professional.
I also don't like the siren power wire outside the enclosure. A better approach would be to drill another hole in the top, pass the wires through and put insulation or glue around the wire hole.
This project uses the Arduino SDK with libraries included for the Espressif boards like the ESP32 and ESP8266. My code works in my environment so you will need a client to send the MQTT messages. I recommend installing the Mosquitto MQTT broker/bridge on a Raspberry Pi. My system also integrates with Alexa voice commands and Adafruit.IO to control the alarms.