Garage door and the Spark Core on github
I just posted my initial code for my Garage door project using the Spark Core on github. This is a work in progress and will evolve over time.
I just posted my initial code for my Garage door project using the Spark Core on github. This is a work in progress and will evolve over time.
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:
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.
I gave a talk at the Raleigh Code Camp called "What can I do with a Raspberry PI". The slide deck is attached to this post for those of you that attended.