My apartment has a really crappy fire alarm system that gets fasely triggered all the time. It even gets activated when boiling water! These fire alarms are based on gas particles and the saying "If there's smoke, there's fire." But I wanted something a little more relaxed.
This fire alarm is based off an Infrared detector. This means it will only get activated by things like sunlight and hot objects.
First off, lets build the detector circuit. It requires 1 Photon, 1 Flame sensor, 1 Red LED, 1 Active Buzzer, and 5 Jumper Wires. Below is the wiring schematic for the circuit.
The code for this photon is fairly simple, as seen below.
Note on line 22 and 33, the value of 2900 was detemined through testing the Flame sensor with a lighter and by pointing it at the sun. Calibrating it this way should eliminate false positives. Using the Potentiometer on the Flame Detector, you can also fine tune how sensitive the sensor is to signals like sunlight and cellphone batteries. For my model, turning the screw CCW decreases the sensitivity. (Upon further testing, it is the phone's camera, not the battery making the sensor activate.)
The code simply states:
- If we detect a fire, and there wasnt a fire before, to turn on the LED indicator and activate the buzzer.
- If there was a fire before, but we don't detect one now, turn off the LED and the buzzer
- If there is a fire currently, but we recieve a signal from the other photon to turn off the buzzer, turn off the buzzer.
Of course, all the pins and variable names can be changed to best suit your needs. When naming Particle.Publish Events, make sure to only use letters, numbers, "\", "/", "-", and "_". Anything else will make the events not work properly.
Now that the detector is set up, lets buld the receiver.
The receiver uses 1 Photon, 1 Button, 1 Resistor (any resistance should work), 1 Red LED, 1 Blue LED, and 3 Jumper Wires. Follow the schematic below to build the receiver.
And the code for the receiver is:
This code does the following:
- Reads Alert messages from the Fire Detector and sets its status LED accordingly.
- Checks if the button is pressed. If it is, it sends a message to the Fire Detector to turn the buzzer off.
The best part about this fire detector is the ability to turn the annoying buzzer off.
Using ThingSpeak and Particle's Webhooks, I was able to graph the detect value from the detector in real time. My version doesn't say when the fire went off (not for lack of trying), but it does let you see how intense the signal was. In the case of this sensor, a lower value means a hotter object, which can be seen in the code for the detector.
You can follow this link to learn how to set up your own webhooks. It's super easy!
Use the link below to view Live Data.
Here is a picture of the detector in action. The Red LED indicating that a flame is detected.