How to add Wifi to a cheap smoke alarm

esp8266
hardware
Tags: #<Tag:0x00007f1e66700888> #<Tag:0x00007f1e66700680>
(Pnuding) #1

I thought I’d shared what I’ve done here with a few smoke alarms to integrate them with OpenHAB.
For years I’ve had regular battery-operated smoke alarms in some rooms, but it would be nice to also get notified out of home if they were ever to go off.
However I didn’t want to spend boatloads of money on funky z-wave or KNX smoke alarms, and there was no wiring or space for putting any in.

Adding an ESP8266 and therefore some Wifi was the obvious temptation, but it would have drained the alarms’ 9V batteries within little time, even if using the chip’s power saving modes.

My constraints were:
-low cost
-acceptable to not be able to query status when the smoke alarm isn’t triggered
-reasonably low startup time in case of alarm
-needs to trigger along when using the smoke alarm’s self-test function
-no meaningful impact on smoke alarm’s battery life
-shouldn’t stop working while the battery level is still acceptable for the smoke alarm itself

So I went looking into using a ESP12E module together with a voltage regulator and switch it externally triggering on a signal output from the smoke alarm.
However it felt clunky, the voltage regulator was a huge waste going down from the 9V battery to the 3.3V of the ESP8266 and there were some leak currents using a switching transistor.

After some searching, the pieces however came together:

  • the smoke alarms I use (french brand “L’Alerteur”) are based on the Microchip RE46C141, which provides a continuous high signal on its IO pin 7 when the alarm is triggered
    ** and it does this also in case of a test alarm
  • instead of a linear regulator I found MP2307-based step down converter modules from China
    ** this has excellent stability with the ESP8266 (I use it in most of my ESP8266 gadgets)
    ** with the wide input range down to 4.75V it works even when the battery runs low, so the smoke alarm will have started warning of low battery before we ever get into trouble
  • I found the MP2307 has an enable input on its pin 7: if that’s not pulled to the input voltage, the converter shuts down and then has less 3µA leakage. So I can use this to control it

So how does it all work now?

I found the signal output on the the smoke alarm is laid out on one of its solder pads.
On the converter PCBs from China the Enable input is already tied to the input voltage, so I had to lift leg 7 of the MP2307 off the circuit board. Then I connected it (via a big resistor, we don’t need any real currents here) to the signal output of the smoke alarm.
And of course the power input connects to the pins on the smoke alarm that carry battery voltage.

Now if the smoke alarm goes off, the step-down converter starts supplying the ESP8266 module with current and it starts up.
What you do on there is up to you, you could just use a tiny Arduino program that connects to Wifi, enables the Openhab switch item via HTTP request and then goes to deep sleep or something.

For convenience I flashed mine with Sonoff Tasmota because that’s what I have on most switches and stuff. It’s complete overkill but whatever… :slightly_smiling_face:
To limit battery waste I set the “sleep 250” parameter in there so it idles reasonably after the initial connection.

I then use the LWT MQTT topic where it announces that it’s online and tie that to the smoke alarm item.

Switch Livingroom_smoke "Smoke Alert Living Room is [MAP(switchtrigger.map):%s]" <smoke> 
{mqtt="<[TiziDomotica:tele/livingroomsmoke/LWT:state:MAP(online.map)]"} 

In practice this comes on about 5-8 seconds after the alarm triggers, and stays on until about 15 seconds after the alarm ends.

The online.map mapping turns the LWT status into ON/OFF

Online=ON
Offline=OFF

and thens switchtrigger.map turn that into the status text for display

OFF=idle
ON=triggered!
-=idle
NULL=unknown

Last but not least there’s a rule that fires off a notification via a Telegram chatbot

rule "When Living Room smoke is detected send a message"
when
   Item Livingroom_smoke changed to ON
then
	sendTelegram("bot1", "There's smoke in the living room!")
end

And what does the overall setup look like? Here’s a peek into the finished smoke alarm:

IMG_0604

And the other side of the boards, here you can see the connection to the power and signal pins of the smoke alarm, the resistor added onto the MP2307 and some hot glue to avoid mechanical strain there.

IMG_0605

Don’t forget to test this well if you build it yourself!

3 Likes

(James Huang) #2

This looks really awesome!

0 Likes

(Rhys Hughes) #3

Excellent build idea, trying it out myself. What size resistor did you use and which leg is pin 7 on the mp2307?

0 Likes

(Martin) #4

Any concerns about insurance coverage in case of a fire and they find out you modified the alarms?
Depending on your local legislation, alarms may be required and need to comply with certain standards. Even if it may not affect the function any certification will be lost by a mod. And insurance may want to blame you for it.
Could still be cheap if you put an original one right next to it. I.e. one for the legal issues and one for your system integration.

0 Likes

(sam jonas) #5

Hey,

@pnuding , Thanks for posting this topic. I was facing similar doubt and was looking what to do next. Thanks for your solutions.They were quiet informative and helpful and it worked for me.

Best Regards!!!

1 Like

(Pnuding) #6

For the resistor you can use anything large (10k or higher) you have lying around. This is really just a precaution so there can’t be any current flowing here.
Counting pins on the 8pin package - usually pin 1 will be marked with a little pit, you count up to 4 as you follow that row to the right, then on the opposite side you go back from 5 to 8. So pin 8 will be right across from pin 1 where you saw the pit.

0 Likes

(Pnuding) #7

Yes Mhgglmmr, if in your location you have any legal or insurance requirements you probably have to be careful there.

0 Likes

(Rhys Hughes) #8

Thanks pnuding, nice little weekend tinker project for me :grinning:

0 Likes

(Pnuding) #9

Btw i saw there are now also a few similar regulator modules on AliExpress that put the enable input on its own solder pad.
Haven’t tried them so YMMV but looks useful:
https://s.click.aliexpress.com/e/cZ1omB48

0 Likes