This is an old revision of the document!
[Photo of Breadboard.png]
Because of a fire at my house where the existing (6 month old) smoke detectors didn't even go off, I decided to build a better set of detectors which do far more than just detect smoke. This design features the mighty Oak with its built in wifi and Particle.io ability to communicate with the world. It includes a MQ-135 air quality sensor which not only senses smoke but also other harmful fumes and gases. It also has a DHT-22 temperature and humidity sensor to give constant feedback to the state of the enviroment. And it has an alarm which goes off when a specified threashold is reached. All of this data can then be pulled from the Oak into Particle.io where it can be accessed by ifttt.com, thingspeak.com or any other monitoring site including one you create yourself. I currently have mine populating several graphs from thingspeak.com which can be viewed here… http://www.intheorystudios.com/oak1 And when the alarm threashold is reached, I get a text message on my phone from ifttt.com I love the Oak and how quickly I was able to bring this design to life. Thanks Digistump!
| Part | Quantity | Identification |
|---|---|---|
| Oak with soldered headers | 1 | |
| Breadboard | 1 | |
| DHT-22 | 1 | Temperature and Humidity Sensor |
| MQ-135 | 1 | Air Quality Sensor |
| 4.7k resistor | 1 | |
| Buzzer or Piezo | 1 | For creating the alarm noise |
| 128×64 OLED Display | 1 | Optional |
This project is surprisingly simple, from the components to the code. If you think about your in-home smoke detector, if its anything like the ones I have, it uses something like a photoelectric sensor which, more or less, sees the amount of particles in the air. If those particles are dense enough, the alarm goes off. In my case, I had a small fire in my garage and smoke was filling the house but the smoke was white and didn't have many particles for the current detectors to see. But in the garage, the black, dense smoke was everywhere. As soon as I opened the door leading to the garage and the black smoke came into the kitchen, the smoke detectors finally did their job. But if we had been asleep when the fire started, its very possible that we would not have woken up before the smoke choked us to death. That's a problem. And that is where the Oak Smoke Detector+ comes in.
The Oak Smoke Detector+ not only is able to detector smoke, but all kinds of smoke from the black, dense stuff to the thin, wispy, white stuff and even detect fumes and gases which could pose a harm to you and your family. The MQ-135 sensor is what does all of the magic here. Its one of a series of gas sensors which does a terrific job of general air quality sensing which include smoke. You can see a list of the different gas sensors here… http://playground.arduino.cc/Main/MQGasSensors
[Image of OakSmokeDetectorWiringDiagram.png]
The circuit is fairly straight forward. If you haven't already, go ahead and solder the headers onto your new Oak. Start by plugging the MQ-135 into breadboard and connect the VCC pin to the 5v rail and the GND pin to your ground rail. The MQ-135 has to pins for output, one for digital out and the other for analog out. After doing some testing, I prefer the analog out since it gives you a range of values from 0 to 1024 while the digital one simply gives you 0 or 1 based on the setting of its potentiometer. The main thing to keep in mind with the MQ-135 and most of the other gas sensors is that they need a burn-in period of at least 12 hours. That is because they contain a tiny element which gets hot and then uses that to read the values. Also, when you turn on your new Oak Smoke Detector+ after being off for any length of time, it will require a few minutes to stabilize before the readings are accurate again. Connect the AOut pin of the MQ-135 to the analog pin of the OAK (A0). Next, plug the DHT-22 temperature and humidity sensor in the breadboard and run pin1 to the 5v rail and pin4 to the GND rail. Between pin1 and pin2, place a 4.7K resistor. From pin2, run a lead to pin5 on the Oak. If you are using the 128×64 OLED display, connect VCC to the 5v rail and GND to the ground rail. We will be using i2c in this project so connect SCL to the SCL pin on the OAK and SDA to the SDA on the Oak. Connect the black wire of your buzzer or piezo to the GND rail and the red wire to pin6 of the Oak. Lastly, connect the Oaks VIN and GND pins to the appropriate rails on your breadboard and you are almost ready. All you need now is a power supply to your breadboard power rails that will give you a steady 5v and nothing more. Once you connect the power, your MQ-135 will start to warm up and your Oak will connect to your wifi. Now its time to program!
Code to show example of it working
Explanation of code
Where to go from here, potential uses, etc.