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.
Example of a concept:
PWM: In this lesson we will use Pulse Width Modulation (PWM) to control the 3 different color LED emitters inside the RGB LED. By powering each color from a separate pin of the Oak (through a resistor) we can use the Oak to control how much power goes to each color, which allows us to control the color of the RGB LED.
PWM can be used in your code like this:
analogWrite(0,1023); more code here...
Where analogWrite(0,1023) means turn Pin0 fully on. A value from 0-1023 can be used to turn the pin on at a level from 0-100%.
What is actually happening with PWM: PWM creates an output that averages out to a certain voltage/power level by turning the pin on and off very quickly. The setting you set of 0-100% (0-1023) is called the duty cycle, at 100% the pin remains on 100% of the time, at 50% it remains on half of the time.
Etc, etc, diagrams and images are welcome but each concept should be no more than two short paragraphs and a code block or image.
[Fritzing diagram of hooking the Oak to the RGB LED with resistors and the breadboard]
Steps to make these connections, things to watch out for (polarity, resistor codes etc)
Code to show example of it working
Explanation of code
Where to go from here, potential uses, etc.