fixed import form wordpress plugin
[homepage.git] / src / _posts / 2018-08-27-wifimqtt-smoke-detector-with-5yrs-battery-and-esp8266.md
1 ---
2 id: 1076
3 title: WIFI+MQTT Smoke-Detector with 5yrs battery and ESP8266
4 date: 2018-08-27T02:15:19+00:00
5 author: xro
6 layout: post
7 guid: http://wp.realraum.at/?p=1076
8 permalink: /2018/08/wifimqtt-smoke-detector-with-5yrs-battery-and-esp8266/
9 responsive_meta_box_designation:
10   - 
11 responsive_meta_box_facebook:
12   - 
13 responsive_meta_box_twitter:
14   - 
15 responsive_meta_box_googleplus:
16   - 
17 responsive_meta_box_text_linkedin:
18   - 
19 snap_isAutoPosted:
20   - 1535328919
21 snap_MYURL:
22   - 
23 snapEdIT:
24   - 1
25 snapTW:
26   - 's:380:"a:1:{i:0;a:12:{s:2:"do";s:1:"1";s:9:"msgFormat";s:15:"%TITLE% - %URL%";s:8:"attchImg";s:1:"1";s:9:"isAutoImg";s:1:"A";s:8:"imgToUse";s:0:"";s:9:"isAutoURL";s:1:"A";s:8:"urlToUse";s:0:"";s:4:"doTW";i:0;s:8:"isPosted";s:1:"1";s:4:"pgID";s:19:"1033870673255563265";s:7:"postURL";s:55:"https://twitter.com/realraum/status/1033870673255563265";s:5:"pDate";s:19:"2018-08-27 00:15:51";}}";'
27 categories:
28   - english
29   - MakingCrafting
30   - Projekte
31   - realraum News
32 ---
33 Read about Flocx&#8217;s current project, a battery-saving WIFI+MQTT-enabling cheap smoke-detector here: <https://blog.flo.cx/2018/08/ikea-diy-smart-smoke-detector/>
34
35 <img class="alignnone wp-image-1079 size-full" src="http://wp.realraum.at/wp-content/uploads/2018/08/wpid-dsc_8087-1743742083.jpg" alt="" width="3000" height="1688" />
36
37 I wanted to do the same thing for my flat, but instead of using the IKEA one, I ordered two cheap 7€ SmartWares detectors from Amazon with 9V batteries that are advertised to give 5yrs battery life and otherwise identical hardware. Also instead of µPython I used Sming and C++. Just for the fun of it, I also added a voltage divider that measures the battery voltage at the time of alarm.
38
39 You can find my [firmware on GitHub](https://github.com/btittelbach/sming_smokedetector).
40   
41 [Read about Flocx&#8217;s current project, a battery-saving WIFI+MQTT-enabling cheap smoke-detector here: <https://blog.flo.cx/2018/08/ikea-diy-smart-smoke-detector/>
42
43 <img class="alignnone wp-image-1079 size-full" src="http://wp.realraum.at/wp-content/uploads/2018/08/wpid-dsc_8087-1743742083.jpg" alt="" width="3000" height="1688" />
44
45 I wanted to do the same thing for my flat, but instead of using the IKEA one, I ordered two cheap 7€ SmartWares detectors from Amazon with 9V batteries that are advertised to give 5yrs battery life and otherwise identical hardware. Also instead of µPython I used Sming and C++. Just for the fun of it, I also added a voltage divider that measures the battery voltage at the time of alarm.
46
47 You can find my [firmware on GitHub](https://github.com/btittelbach/sming_smokedetector).
48   
49 ](https://github.com/btittelbach/sming_smokedetector/blob/master/esp8266_smokedetector/esp8266_smokedetector.pdf) 
50   
51 Todo for the future: motivate someone to do this for realraum. ;->
52
53 Since all 9V smoke-detectors ICs basically use the same pinout with an I/O-function on pin 7 that pulls LOW when no smoke is detected and HIGH on alarm, they are all equally easy to mod. The SmartWares are smaller than the IKEA ones though, so I did not even attempt to fit everything inside the case. More accessibility traded for lower WAF :)
54
55 Note that there are 3V Lithium 10yrs battery life smoke detectors out there, which work a bit differently. For once, the ESP8266 does not run with 3.0V but needs true 3.3V, so at the very least you will need a cheap and tiny boost converter from AliExpress. Furthermore, they do not use a CS2105G0 based chip but a PIC which might not have an pin as CS2105G0-I/O-pin configured.
56
57 A word of warning: In order to conserve the battery, the circuit disconnects the whole GND when no smoke is detected. Thus GND and 3V3 of the ESP8266 may be short-circuited through the unpowered buck-converter, depending on your component. So just to be safe, remove the Wemos from the circuit before connecting it via USB.
58
59 <img class="alignnone size-full wp-image-1078" src="http://wp.realraum.at/wp-content/uploads/2018/08/wpid-dsc_8088959054070.jpg" alt="" width="3000" height="1688" />
60
61 <img class="alignnone wp-image-1089 size-full" src="http://wp.realraum.at/wp-content/uploads/2018/08/wpid-dsc_8092959054070.jpg" alt="" width="3000" height="1688" data-temp-aztec-id="dfe019d6-62c3-4bbe-994b-cdaa5e195592" />