Fire-Alarm-Tone Detector to Open Roller Shutters
by PE0TER in Circuits > Remote Control
167 Views, 0 Favorites, 0 Comments
Fire-Alarm-Tone Detector to Open Roller Shutters
In case of a fire, Roller Shutters should be opened before the power cuts out so doors and windows can be used as escape routes and Fire Brigade has access to the house to extinguish the fire.
Most houses have smoke detectors installed that beep an intermittent high pitch alarm when activated. Upon hearing this alarm one has to investigate what is happening and then take appropriate action. In case of a fire at night one has to wake up first and when older, the alarm tone might be harder to hear.
I have installed Somfy-IO-motor operated roller shutters on the south side of my two story town-house, mainly to keep out the sun in summer. My living room and all bedrooms have their windows face south. At night the shutters are closed.
My roller shutters are controlled via a Somfy-Tahoma box. As Somfy non roller shutter automation products are very expensive and have limited functionality I also have a Home-Assistant Yellow universal home automation system that communicates with Somfy-Tahoma and allows for all kind of home automation gadgets to be connected and used.
I have built a fairly simple tone-selective alarm tone detector that tells my Home-Assistant a fire-alarm-tone is being heard. Home Assistant than takes all the actions required, including opening all roller shutters. Functionality of this setup is tested every time I test my smoke-detectors.
I was inspired to build this device by another Instructables article: https://www.instructables.com/Sonic-Control/
Supplies
Schematic and PCB are designed using a German PCB design software package called Target 3001! V32 Light. I wanted the unit to be as small as possible to fit into a small power connector housing. It ended up a bit larger then anticipated but small enough for its purpose. To get it that small it had to be SMD soldered. As this would be my first SMD project, intended to be hand soldered, I have chosen fairly large model 1206 and 1210 SMD components.
The power connector housing I finally selected was a German make: StrapuBox SG1
To power this detector unit I wanted a small, highly efficient, safe 230VAC to 5VDC switched mode power supply module that had to fit into the power connector housing. I have chosen a Hi-Link HLK-PM01, 5VDC 3W
The processor chosen to receive the Alarm-Tone-Detected signal and broadcast it to my Home Assistant is a ESP8266 Wemos D1. It runs a very basic EspHome script (I am not a programmer), crude but fit for purpose.
Circuit Design
The circuit itself is fairly straightforward and consists of three main parts:
Microphone with pre-amplifier, Tone detector, Microprocessor.
I selected a small electret microphone and combined it with a single power supply OPA-340 OpAmp to get enough signal for the tone detector to work.
Next step was the NE567 tone detector circuit. Components surrounding it are based on the data sheet with the exception of R1 and C1. Center detection frequency of the NE567 is set using formula fo ≃ 1 / (1.1 × R1 × C1). As resistors are the most flexible components to manipulate, the formula changes to R1 ≃ 1 / (1.1 × fo × C1). My FireAngel WST-630-BNL smoke detectors Beep at around 3200Hz. Using a 100nF capacitor for C1 means R1 should be around 2840 Ohm. As capacitors capacity is mostly somewhat smaller, I have chosen a fixed R1 and variable R9 non SMD resistors in series and a non SMD capacitor to allow for manipulation once the PCB was assembled.
Output of the NE567 goes low on tone detection and is connected to a LED and input D5 of the Wemos-D1. This input acts reverse. Input D5 is GPIO14.
The actual application specific part of the EspHome yaml file is quite small.
During PCB design I have chosen a grounded through hole component site which eases ground wiring.
When all looked oke I exported the XGerber files and sent them off to PCBWay. Having 5 pcb's made the cheapest way possible means having to wait very long for shipment.
Downloads
Prework & Calibration
On my phone I installed a frequency analysis app to 'listen' to the fire alarm signal. This app showed a signal peak at 3200Hz during the sounding of the alarm. I used this frequency to determine my C1 and R1.
After the unit was assembled I used a tone-generator app with frequency sweep functionality which I set to slowly sweep from 2900Hz - 3500Hz. I then tuned R9 for the led to light in the centre portion of this frequency band, adjusting the tone-generator sound volume as low as possible for the detector still to function.
Assembly
Once the PCB's arrived I started off with soldering both SMD IC's, followed by the SMD resistors and capacitors to the PCB. Then, on the other side of the PCB, R1, C1 and R9. I then temporarily wired-up the microphone and LED and soldered some test leads to 5VDC, 3.3VDC and GND so I could use my prototype board power supply unit to test if it actually worked, and it did so I could adjust R9 to the correct detector frequency value.
Next step was programming an initial EspHome configuration into the Wemos-D1 using https://web.esphome.io/ after which I entered my WiFi credentials. Then this Wemos-D1 was soldered onto the base PCB making sure it was clear above all SMD components on the base PCB.
The assembled base PCB was then positioned into the power adaptor housing to find where the holes for LED and microphone needed to be drilled after which both LED and microphone were wired to the base PCB in such a way they would line-up with the holes drilled.
The power supply module was wired-up and with dual sided tape glued into the power adapter housing followed by the base PCB being positioned with LED peeping through the LED hole and microphone pressed against the front panel. A piece of PE foam presses it into position when the back is mounted and closed.
Last part is plugging the detector unit into a wall socket, watching the LED blink once. Then opening a browser window into Home-Assistant and selecting the EspHome tab (assuming EspHome is installed on your HA-unit). Then choose Adopt for the unit to be integrated into your EspHome environment. Once that is completed you choose Edit to modify the basic yaml script to add the binary sensor lines for this application, then save to save them and Install to install the modified configuration to the detector. After a reboot of the sensor the 'FA-detected' variable is available in your HA-unit for you to use.
Upload Design Files Not Possible
I was not able to add the exported eagle format sch and pcb design files, sch file would upload but is not shown, pcb file does upload but should be linked to the sch file to be useful.
Instructables does not accept zip files, yaml files nor xgerber pcb production ordering files so unfortunately this will be a real DIY project where you have to do all the design work I have done from scratch, based on the screen pictures and photo's I was able to attach. I hope these are good enough for you to build your own version of this device.