DIY WiFi gas detector with text alerts

Hey guys, back with another little project that I’ve been fiddling with for the past week. With kids around, every parent is thinking how to make their home safer for the little ones and for everybody in general. One of the most dangerous thing in the house can be the stove and since we have a gas-powered one, I always wondered why there are no simple gas detectors that can be used around the stove, just to alert instantly that gas may be leaking.
Well, that was the moment when I decided to build one of my own. Having a Particle (Spark) Photon lying around, I decided to use that as a foundation for the project. I like the fact that they are very small and cheap, and also can be flashed over the Wi-Fi. Having that settled, I needed the gas sensor and some kind of alerting system.
For the gas sensor I went for an
MQ-4 gas sensor because it can detect methane (CH4) as well as natural gas (CNG).
I found out later that it’s quite sensitive to CO2 as well, which turned out to be very useful while testing the setup. If you’re planning to use one in your projects and never used one before, remember that the gas sensors have a burn-in time when they are powered. That is to say that the sensor needs time to warm up (anywhere between 2 and 10 minutes). This is because the actual sensor has a heating element that helps detect these gases and while that is cold, it will give erroneous readings.

Now on to the alerts. Half of the alerting system was simple, add a beeper next to the sensor which would work perfectly when somebody is around. However I still had to sort out the second half, for the cases when somebody was not in the immediate vicinity. For that I wanted to have text/SMS alerts to my phone and possibly to a secondary phone, for example my wife’s phone. Now I realized that I should probably get one of our neighborhood FD guys phone number in there too.
Knowing that the Photon is not the most robust controller in terms of notifications (I know there’s the IFTTT or other alerting systems) but I wanted something small, reliable and really not depending on various 3rd parties in the cloud. So I made a small web app on my local web server that would send me specific text message when a URL is hit. Many cell carriers offer now the possibility to send somebody an email to a specific email address, and that email will be turned into an SMS and sent to the phone, so that turned out to be a good enough solution for me.
Read More: DIY WiFi gas detector with text alerts

Leave a Comment

Your email address will not be published. Required fields are marked *