20. December 2014 01:21
I recently moved to a new home and I now have 2 garage doors to control instead of one. So I decided to revamp my garage door home automation project by using the Spark Core. This is a fascinating device as it is designed to connect to the Spark.IO cloud service without doing a lot of coding to maintain the connectivity to the cloud. The default firmware in the device allows you to remotely connect to it and invoke functions, expose variables to the cloud service as well as perform pub/sub between devices. Make sure you check out their website to gain a better understanding of all the capabilities of this small packaged IoT controller.
My goals in this project was to achieve the following:
- know when either garage door is opened or closed.
- remotely close or open the garage door.
- have the door automatically close when I go to bed.
- keep track of how long it takes to open/close the garage door.
- if the door starts to take longer to open and close this might be a sign that it needs maintenance.
- automatically open the garage door when I arrive home.
- automatically close the garage door when I leave my home.
- notify me when the door needs maintenance because it has been opened/closed so many times.
- monitor the temperature and humidity in the garage.
- monitor the garage for motion when the security system is on.
- notify me that I left the door open after a specific time of night.
That is certainly a large number of goals and I don’t intend to complete all of them initially but you kind of get the idea of what the possibilities are.
Initially I intended to do all of this for 2 garage doors with one Spark Core, but after thinking about it a bit it made more sense to use at least two Spark Cores.
One thing I decided to do right off the bat is to make sure I have enough sensors that could determine when the door was opened and when it was closed. I have seen other remote garage door projects that simply have one sensor that detects if the door is closed or not. I wanted more inputs so that I could time how long it took for a door to complete it’s open or close command. I want to keep track of this in order to determine if the door will need maintenance when it starts to take longer to open or close. I can also gather a little more analytics around the timing of the door command and the temperature in the garage. I don’t know if I will use this more detailed information for anything or not but I thought it would be fun to play around with.
So I will have 2 magnetic reed switches that I plan on placing on the door track to determine if the door is closed or opened. The status of the door will be 5 different states: opened, closed, opening, closing and unknown. The unknown state will only be for when neither of the sensors are triggered and the device doesn’t know if the door was previously opened or closed. I have most of the code written to handle the basic door operations and I will be sharing that code in a future post.
So stay tuned on future posts on this topic as I move forward with it. Please feel free to give me feedback or ask questions on items I haven’t clarified very well. I am very interested in anyone’s thoughts on the Spark Core as well as home automation in general.