Collect all materials used in the last projects, put them together in a pot and make a super mega project of home automation, which will be based on the detection of the smoke sensor.
Before starting, get some hints from our last project:
Irrigated according to Functional weather conditionsProtect House as Kevin McCallister in “Home Alone”
The project has been designed to interact with all others sensors. Starting from the smoke detector, we set out the sequence of events.
If there is smoke, there will be two steps that the program will run.
- If the value is between 500 and 800, we will be enabled:
- A stepper motor that will move a hand (or any other object you lmay prefer) as a visual signal.
- A LED will start flashing, but only if the brightness of the room is low.
- If the value is greater than 800 we will be enabled:
- A stepper motor that will move a hand (or any other objetct you may prefer) as a visual signal.
- A LED will begin to flash, but only if the brightness of the room is low.
- An hydraulic electrovalve to shut off any fire.
NB. Made sure that the LED works only with low-light conditions, however, by changing the code, you can always enable it, in the presence of smoke. The LED can be replaced with a light bulb, just control a relay with pin D13.
Everything we need:
Now think of the code and then we’ll see how to assemble the whole thing.
As usual, we create a new project with Ideino Workspace. We call it “SmokeSensor.”
In package.json file, the only dependency is related to the module node-static, which we use to send our data detected by the sensor of smoke, to a web page.
The javascript code:
As described in the code comments, you can change the values of the smoke detector.
The html page:
The Web page will look more or less like this:
The sketch made with Fritzing, for the connection of the various components:
Ready! Start the project and hope you should NEVER need it !
Comments