Wednesday, September 14, 2011

Android app to monitor & open and close garage door

Have you ever wanted to know if your garage door is open without having to go and check it? There have been many blog posts to light an LED when you leave your garage door open, but I want something more convenient. I decided to write an Android app that would allow me to monitor my garage door and even open or close from anywhere. I am going to provide complete instructions for building the required hardware and the android app code.

Monitor your garage door with an Android app
What is required? We need to build the following:
  • Using a Netduino board (or an Arduino board with an Ethernet shield) build a sensor to detect if the garage door is open or closed. I chose an infrared phototransistor so I would not have to make physical contact with the door and because it's cheap! Like $1.13 cheap!
    Build and program a garage door sensor
  • To open or close the garage door I wired an Optoisolator to a spare garage door opener.
    Build and program a garage door opener
    Open and close garage door with your Netduino
  • Write a program (or you might hear it referred to as a sketch) to check the sensor and determine if the door is open or close and report it back over HTTP
  • Even though it's not required, I wrote a second RESTful webservice to talk to the Netduino web server (see diagram). That way the Netduino webserver is never exposed outside my private network. I have another computer with the RESTful webservice that has a layer of authentication that is exposed to the internet.
  • And finally an Android app that will display if the garage door is open or closed as well as open or close it. Here are step by step instructions (with complete source code) for writing the Android App.
I will be covering each step with a detailed post.

28 comments:

Jack Lawson said...

Really looking forward to seeing this series of posts. I bet you could do some awesome things with Arduino and the Tasker app.

Unknown said...

I have toyed with the idea of using this with Tasker. The only thing stopping me is I have not bought it yet. It might be time to buy it.

Anonymous said...

Hi Greg-

Thank you for this. This is wayyyy beyond me as I am not a programmer but I love the concepts of hacking things together and home automation. I don't know if I will be able to do this but I would love to try.

I know this is basic stuff for you, but can you clarify for me what is hooked into what? Does a netduino receive commands without being physically attached to a computer (i.e., you don't need a computer in your garage, correct)? I assume that's what the "net" in the name is for. What about powering the netduino/sensor?

Also, would the android app be able to give you a text or alert sound when the door opens? Could it log the times? This would be great for knowing when a teenager gets home if you are away or sleeping.

Thanks so much!

Unknown said...

The Netduino is connected through an Ethernet cable. The Netduino talks to the computer over the network with HTTP requests and responses. There is no need for a computer in the garage. The Netduino has it's own 5 volt power adapter that plugs into a wall outlet. Yes you could send text messages and emails with this setup as well as log events. The Netduino plus has an SD card that can store up to 2GB.

Anonymous said...

I thought I posted a reply but I must have canceled somehow...

Sorry, can you clarify, what is the netduino connected to? If I have my router in the house and the netduino in the garage, do I need to run an ethernet cable out there? Sorry if this is really basic stuff.

Thanks!!

Unknown said...

Yes, the Netduino is attached to your router by an ethernet cable. You could put the Netduino in the garage but you don't have to. Basically the connections are Router attached to Netduino by ethernet cable attached to infrared sensor by two tiny wires. That gives you a lot of flexibility where you locate each component. I put my Netduino in the basement near my router, then I ran two wires to the infrared sensor in the garage. I am working on shooting a video that I will post on YouTube. When it's done I will post a link here.

Anonymous said...

OK; that makes more sense to me. Unfortunately my garage is fairly far from the house so even if I got up the nerve to try this project I think that might be a dealbreaker. Maybe if a wifi netduino comes out...

Thanks!!!

Unknown said...

Actually you can do that! There is a wireless shield so the Netduino would not have to be physically attached. It's just costs more for the wireless adapter. The are called Xbee Shield if your interested.

Anonymous said...

OK; when you get your video up I'll evaluate if I think I'm up to this task.

Thanks for the work and the responses!

BenE said...

Hi Greg. Thanks for the awesome series of posts.

I had to change my netduino server code to listen on a different port (18001) because
my internet provider blocks port 80 from being served for security reasons. I
went into my router and fowarded the new port (18001) to the IP adddress and port
(18001) of the netduino.

If I use a browser from any computer, it works, I can query the garage door being
open or closed with http://:18001/checkdoor.

However, from a browser or from the garage door app on my phone (or andriod emulator) it
doesn't work. I can see (from debugging statements I added) in the emulator
that the bytes received by the server are zero.

I am thinking I need to write a second webserver like you did but I'm not really sure.
I think I'd like to anyhow for security reasons but I'm not sure how to start it.

Do you have some skeleton code for the RESTful webserver to help me out with that
part of it?

Thanks,
Ben

Vlad said...

Are you seeing a problem when netduino looses power (power outage) and then boots back up again the door will open? I have read that netduino will send 3.3V to the pin upon boot (this will activate garage door opener) and there is no way to prevent this, except adding additional transistors and resistors which makes things more complicated. How did you deal with this? What if you leave the house and there is a temporary power outage, this will open the door for everyone to come in.

Kyle Bale said...

You guys may no longer be interested in working on this or already done, but another solution to the wireless issue would be a WiFi AP client or wifi bridge. Like this: http://tuxgraphics.org/electronics/201006/avr-wifi.shtml
I am an extreme newbie, but it seems to me that this method would be easier and potentially cheaper than a wifi shield.

Anonymous said...

Hi Greg,

Ur posts are awesome can you help me knowing how to automate the bike remotely.

Thanks
Sam

jacob said...

this is an amazing app, which will open and close your door on the place where you are. no need to go and check it.

Unknown said...

Thanks for sharing the information. It is very useful for my future. keep sharing
Signature:
download free descargar gratis whatsapp and download baixaki whatsapp online and descargar whatsapp , baixar whatsapp gratis

Unknown said...

Very helpful advice in this particular post! It’s the little changes that make the largest changes. Thanks for sharing!
Signature:
i like play games happy wheels online and play happy wheels 2 games and zombie tsunami , retrica , retrica camera, happy wheels game , agario

Unknown said...

Thanks for your sharing, have made me very happy. Spare time you can also participate in our game to feel and experience them. Thank you!
Juegos de Matar Zombies
fancy pants 3
fancy pants 3
fancy pants
fancy pants
fancy pants 3 hacked
fancy pants 3 hacked

Unknown said...

What a wonderfull post! thank you... read with pleasure!
Friv

Unknown said...

Thanks for your sharing, hope you will have much more to share. We also want to introduce you to the game free to feel the fun they bring. Try then, Thanks!
return man 3
return man 2
return man

شركة زهرة العلا said...

شركة تخزين الاثاث بالرياض
اسعار فرش المساجد بالرياض
كشف تسربات المياه بالباحة
شركات غسيل موكيت بالدمام
شركة تنظيف خزانات بالدمام
شركة تنظيف كنب بالدمام
شركة تنظيف مجالس بالدمام
شركة مكافحة حشرات براس تنورة
شركة تنظيف براس تنورة
مانع الانزلاق علي البلاط sure step
تركيب هناج للمستودعات بالرياض
افضل شركة عزل فوم بالرياض
شركة جلي رخام بالجبيل
شركة نقل اثاث بالجبيل
شركة تنظيف مكيفات بالرياض

deeksha said...

your blog is really good and thus it is very well interesting , as well as i got more information from your blog. it is really nice too thanks for sharing these information.

Best Android Training Institute in Chennai

Unknown said...

It’s really a great and helpful piece of information. I’m glad that you shared this helpful info with us. Please stay us up to date like this. Thank you for sharing. Fri10000 | Kizi | happy wheel

Unknown said...
This comment has been removed by the author.
Unknown said...

Great! Thanks for sharing the information. I like this information. Keep posting
fireboy and watergirl 4
Geometry Dash 2.0

al3ab banat01 said...

Games are games of human intelligence.
العاب طبخ 2017
العاب
http://gamesbanatcoat.blogspot.com

Linda said...

I would like to thank you for the efforts you have made in writing this article.I would like to thank you for the efforts you have made in writing this article.
Facebook Lite

Secured Engineers said...

I really appriciate your efforts, its very meaningful.
Fire Hydrant System
Security Camera Dealers in india

alicetaylor said...

Thanks for sharing this quality information with us. I really enjoyed reading.

http://word-cookies-answers.com

Post a Comment

Note: Only a member of this blog may post a comment.