Arduino Garage Control project including sketch and tutorial.
#Demo Watch it in action!
#Overview The purpose of this project was to create a DIY garage control utitlity that can be remotely controlled via my iPhone. I chose for BLE (Bluetooth Low Energy a.k.a. Bluetooth 4.0) as it - what's in a name - very energy efficient and above all, has better connectivity (range + connectiontime) then its predecessors. We certainly didn't want to reinvent the wheel as there are quite a few tutorials on the internet showing remotely controlled garages by a smartphone. But it's not just a test project I really want to use it on a daily basis. Therefore it must be good, real good. And that meant, useful, fast and super easy to use. A big plus for this implementation is that it will auomatically connect once the BLE shield is in range of your smartphone, no need to press the connect button (over and over). Most of the time it takes <1 second to be connected once you open one of the apps!
#Apps I wrote two iOS companion apps. Note that you need to compile these yourself, the apps are not available on the App Store.
- Carage Controller - Monitor sensors and control the garage door
- My Garage - Only function is to connect and immediately send the door switch command and close. This can be used with Siri by giving the command "Open my garage" which will just open the app and let it do it's thing.
Both apps are using a modified BLE Shield library and will keep scanning for the device until it's found and then connect. This is very useful since (in case your so lucky that your car supports this) you can drive up to your house, press the steering wheel button (or activate Siri with the home button) and say "Open my garage". As soon as you come in range of the Arduino it will open the garage!
#Requirements The requirements describe the parts you need to create the same Arduino project as I did and is almost plug and play (that is whilst using my sketch and iOS app). It's up to you to decide what you want t$
- Automated garage that can be controlled with a relay. What's a relay?
- Power source (I used the 24V power source from the garage door itself.)
- Arduino Uno or compatible Arduino board
- Bluetooth BLE Shield
- Grove Base Shield
- Grove Relay or other relay
- Magnetic switch: Any magnetic window switch will do, some are better (stronger) than others. I used the ones displayed in this picture which are great!
- Grove (analog) Light Sensor
- Grove (analog) Temperature Sensor
- Grove 4pin connector cables
- A box to fit everything in
- Tools (drill, screwdriver, wires, ...)
- Optional Power Converter e.g. 24V to 5V to power the Arduino
- Optional but recommended 2.4GHz SMA antenna. Caution: you need an antenna with middle pin or adapter.
- RedBearLab Arduino BLE Library
#How To
- Mount the grove base shield on the BLE shield, and mount the BLE shield on the Arduino
- Connect the light sensor connector with A3 on the base shield
- Connect the temperature sensor connector with A2 on the base shield
- Connect the relay with D4 on the base shield
- Cut one grove connector cable in two.
- Plug the connector side in D6 and wirethe black and yellow cables to either side of the magnetic switch.
- Upload the sketch
- Open the console and enable debugging (= send 'd') or connect with one of the companion iOS apps
- Optional add a random authentication bytes "handshake" to both the sketch and the iOS app. These bytes are sent before switching the relay. Without this handshake the command to open the garage door will not be accepted.