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.


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.

Greg Zimmers 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!

Greg Zimmers 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.


Greg Zimmers 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...


Greg Zimmers 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?


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:
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.


Gopi Kishan said...

This is nice comment!!!!!
It describes the use of Android in the Samsung Galaxy mobiles..
Online Android Tutorial

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.

Chang bui thi said...

I love all the posts, I really enjoyed, I would like more information about this, because it is very nice., Thanks for sharing.
i like play games friv4 online and play games 2 girls Download baixar facebook movel

Whatsapp Descargar said...

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

tranthuhahungyen said...

Thanks for sharing this quality information with us. I really enjoyed reading. I think I need it.
Games for girls|
Kizi 1|
Kizi 2

thị hậu nguyễn said...

Good information here. I really enjoy reading them every day. I've learned a lot from them .Thanks so much for sharing this information. Greatly help me being a newbie.
happy wheels
super mario bros

pubsquash John said...

Thanks for sharing the information. It is very useful for my future. keep sharing
Kizi 123|
Friv 234|

bibikafu said...

Thanks for your great article friend, i get new information, new ideas to do somethings, i hope you will share again, i keep waiting for next post, thanks.
Friv 4
Kizi 3

ka maz said...

This is very informative site. I am totally pleased by your excellent work. Many thanks for sharing.
Friv 10

Friv4 Games Online said...

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

Zombies Juegos de Matar 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

XUKA said...

Thank you for sharing a great information and useful. it really necessary and timely for me at this time. I wanted to share this information with my friends on the social network facebook.!
Friv 10000

Jasmine Thompson said...

Just wanted to say that I read your blog quite frequently and I’m always amazed at some of the stuff people post here. But keep up the good work, it’s always interesting. See ya,
agario|agar io||agar|agario game|agario skins|agario extended|agario mods|agario|agar io

An Giang said...

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

Yepi said...

You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
Thanks you for sharing!
Friv Games

Man 3 Return 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

Retrica Camera said...

This article is really fantastic and thanks for sharing the valuable post.
Download retrica online includes more than eighty different filters with many different styles and include retrica indir , and zombie tsunami is the ideal game for anyone who loves the running game genre

tranbaongoc said...

You are stressed and tired, you need entertainment. Refer to our website. hope you get the most comfortable.
Kizi 4

Hieu Nguyen said...

you'd have time to look these kids active. Please visit our website and let us play the game interesting.
Thanks for sharing !
Friv 10
Kizi 10
Yepi 2

Br Agario said...

I found a lot of information here to create this actually best for all newbie here. Thank you for this information.
happy wheels , agario , happywheels , agar ,

Watergirl Fireboy said...

A good blog. Thanks for sharing the information. It is very useful for my future. keep sharing
fireboy and watergirl | super smash flash 2 , fireboy watergirl | ssf2

Le Bens said...

This is something special! never seen this before! thank you

Friv5 said...

You need to kill time, you need entertainment. Refer to our website. hope you get the most comfort.
Thanks for sharing !
Friv 5
Kizi 1
Yepi 3

Glass Garage Doors said...

This is really nice post I love read this kind of blogs about Garage Door thanks for the great information.

tranduyphong said...

New attractive game . I will play it every day
Friv 2

Friv4 said...

When you're tired, you want to relax after a stressful working hours, you need to have time to take care of the kids active.
Please visit our website and play exciting flash games.
Thanks you for sharing!
Friv 4

Friv100 said...

You want to relax after a stressful working hours. Refer to our website. hope you get the most comfort.
Thanks for sharing !
Friv 100
Friv 8
Friv 2

GirlsGoGames Dressup said...

You want to relax after a stressful working hours. Refer to our website. Hope you get the most comfort.
Thanks for sharing !
Kizi 100

Giải Trí Tổng Hợp said...

Welcomes to google terminal keep sharing such ideas in the future as well.
google snake this was actually EARN TO DIE
what i was looking for,and i am glad to came here! AGE OF WAR 2
Hi! I’ve been reading your blog for a while HAPPY WHEELS
I want you to thank for your time of this wonderful read!!! Slitherio
Amazing insight you have on this, Slither io This article always blew me BIG FARM

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

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

games2girls said...

You need to have time to take care of the kids active. Please visit our website and play exciting flash games.
Thanks you for sharing!
Kizi 1000
Friv 3

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

Game Kizi 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

Game Kizi said...
This comment has been removed by the author.
Alice Denny said...

The blog or and best that is extremely useful to keep I can share the ideas. Age Of War 2
Big Farm | Slitherio | Tank Trouble
Of the future as this is really what I was looking for, I am very comfortable and pleased to come here. Thank you very much.
Happy Wheels | Goodgeme Empire |

Post a Comment