As mentioned in the "pitchtalk" my colleague crashed the roof of his car on his garage door. He left the garage too early and pulled the radio antenna out of his roof with the garage door...
So I said: "I'll build you a solution!"
Scope: Show if the garage door is opened completely or not and command the same door from within the car. (in house or from the corner of the street).
An home automation/Iot/Blynk project was born.
To make software development easy I choose for the Blynk solution.
- Easy coding on the arduino
- Easy coding on the smartphone
- With ssl some security
The "device" has to detect if the door is open or close. In order to do this I choose for magnetic reed switches. You can install the switches on the "chain-rail" and the magnet is installed on the "wagon" (See pictures) You can also install microswitches.
There is an upper switch and a lower switch. When the upper one is closed the door is open and shows a green led in the Blynk app. When the lower switch is closed the door is closed and a red led is shown in the Blynk app. In between (when both switches are open) the door is moving. (an amber led is shown)
Once the door is completely opened (green led) a message is logged to the blynkterminal and the time is stored. This time is checked to the "Open warning" time configured in the blynk app. Once the door is openend for too long a message is send to the blynk app.
In order to open or close the garage door a pin on the arduino is configured that can be put to high in order to close a relay during some time. The garage door engine is activated by making contact between two wires. (those are connected to the relay)
Hardware setupThe solution is powered with an old smartphone charger. only six wires should be connected.
- 2 for the "upper" reed switch (feather pin 12 and + USB out)
- 2 for the "lower" reed switch (feather pin 14 and + USB out)
- 2 that go to the garage door opener to make contact to close or open the door (Connected to the relay)
Everything is mounted on a Adafruit half protoboard and put in an purpose printed casing. (In order to mount it on the protoboard I had to cut the unused terminals of the relay)
Install the right libraries for the Adafruit Huzzah and for Blynk. Change the connection settings for your wifi network and the Blynk app key in the code and upload it to the arduino.
Blynk app creationLets build an Blynk project that looks similar to this:
Create a new Blynk project on your smartphone. Use ESP8266 as the hardware model.
Add the green (input V2), red (input V3) and Amber(input V4) leds to the project.
Add a terminal block to the project on input V0 and disable "add new line" and "input line"
Add the button "activate Door" on the project with output V4 and Push-buton mode. This will give you the possibility to open or close the door.
Add the Numeric input to the project. This is used to define the elapsed time before the warning is send. Configure it on output V5.
Add the realtime clock to the project. This is used to get the time on the terminal screen.
Add the notifications settings to the project. This gives the project the ability to send the "open door" warning and to inform you if the device went off-line.
Connect everything and start the app as well as the arduino and it should work.
Sharing the solutionIt is possible to share the app with others in Blynk. Attention you can only receive one project in sharing mode. So If you build two projects and want to share them with the same people, they will only see the project that was last loaded.
You can also use webhooks to share acces to the blynk API. Using this and IFTT it is possible to use voice commands to operate your garage door.
Have Fun!
Comments