Automatic Garage door opener through GPS-phone and IP
Posted: Sun Oct 18, 2009 12:56 am
Hi Everybody,
I thought I'd post some information about a quite geeky project I've almost completed this weekend.
First, I bought a house.
Then I needed a door to my parking area. There were no doors available, which could close an opening of 4.2 meter width while parking in 2.3 meters width - so I built a door and equiped it with an electric opener (modified Einhelll BGT 63)
No that's not exactly home automation. Automatic doors are not worth mentioning anymore. However...
I became quite annoyed with having to wait 17 seconds in fornt of the door before could drive into my house so I decided to automated not just the opening of the door, but also the pressing of the "open" button.
The concept:
I have a smartphone with built-in GPS (Nokia E71). Using GPS, the phone knows when I'm approaching my home by car and opens the door 300 meters before I'm at home. The door is open when I reach my house and I don't need to wait on the side of the road anymore.
Furthermore I can check whether the door is open and open/close it from wherever I am.
How did I do it?
The Nokia phone is programmed using pyhton. The python program talks via an internet connection (any data connection GPRS, EDGE, UMTS, WLAN whatever is selected as access point) to the DSL router in my house which forwards the connection to a neat, simple and cheap (27) Ethernet to Input/Output card (Avr NetIO from Pollin Electronics).
Two of the digital inputs of the board are "sniffing" the voltage open/close contacts of the door, two analog inputs measure the voltage on the two pins of the door motor and one digital output is connected to a transistor which acts as external IO siwtch.
-----
The software development environment:
The phone (Nokia E71) runs Symbian 3rd Edition FP2 as operating system and has GPS installed.
The door opener is programmed in Python. I chose Python over C++ or Java for ease of development. It's really the fastest way to get things done on a Symbian Mobile Phone. (generate a file "import audio; audio.say("Hello World") " start it - and you've got synthetic voice output - nice, isn't it? ). If you google for Pyhton S60 you'll find plenty of links to get you started.
---
The statemachine
The statemachine is work in progress. At the moment GPS is always on and the behaviour of the software is simple: It continously measures the distance from my house. If I get nearer the 300 meters and If I'm faster than 30km/h it assumes opens the door.
In future I want to extend the statemachine in order to save battery on my smartphone. GPS consumes a lot of battery, but you can easily find the approximate location by simply asking for the current GSM/UMTS cell identification code.
So what is plan to do: GPS is generelly not active. The software finds out that I left home when I'm not in one of the GMS cells which are close to home. Once I've left home it waits until I reach one of the "home cells" again. If that's the case GPS is activated so the phone can exactly find out where I am and when it should open the door. As soon as it has opened the door, it will switch off GPS and wait until I leave the "home cell" again.
The software runs in Background - so you don't notice it normally.
-- The infrastructure --
This is the easy part:
Nokia E71 => The Ether => DSL Router => Cable => AVR NetIO => Door opener Electronics
For the Phone application I preselect my acess point so I don't get annoying popups when the app needs to connect to my door.
The DSL router does port forwarding to the IP Address of the AVR Net IO board. Luckily (not only by chance), I've got a fixed IP Address from my provider for my router.
The AVR Net IO uses a fixed IP Address.
-- The Hardware --
When building the door I bought a cheapo door opener, because I thought the cheapter, the easier to modify.
The Einhell BGT 63 is an extremly simple design. The motor runs of 24V, switched by relais. The open/close end contacts are simply contacts to GND, pulled to internal 5V with a 1k Resistor.
The external open/close switch is also referenced to GND.
This design makes interfacing with the AVR netio really simple.
7 Resistors, one Transistor and 4 capacitors is all you need.
I used a resisitive divider with a smoothing capacitor (82k/10k / 1uF) to feed the voltage from the motor pins to the analog inputs of the board. The transistor is directly connected (Digital Output - Resistor - Transistor) to the switch.
I added a first order Low pass (R-C Filter 100k 1u) to the digital inputs just to be safe.
The AVR Netio board is supplied with an old mobile phone charger (nokia) The Einhell and AVR NetIO GNDs are connected, so I don't worry about galvanic isolation.
Open Points:
I still need to get an IR "curtain" to stop the door movement if something is close to it. At the moment this automatism is a real safety threat to children (although the door stops when 150 Netowns more than usual are required to move the door). The door is prepared for that already - so it's just a matter of selecting the right parts and installing them.
So that's it.
I took me about 4 days to design the door, 3 days to build it.
About 3 nights to get the grips on pyhton on the mobile phone (first time python programmer)
About 3 nights to get the phone running
About 1 day to install the AVR netIO board.
Total cost:
door: 550 Euro (the door itself, the metal, the wood, the concrete, the bearings, the cables)
door automation: 35 Euros. (27 Euro AVR Netion, Rest: cables and small bits and pieces)
Yeah - geeky - isn't it.
[img]uploaded/insaneLX/2009101821238_AVRNetio.jpg[/img]
This is the AVR NetIO
A video of the door opening:
I thought I'd post some information about a quite geeky project I've almost completed this weekend.
First, I bought a house.
Then I needed a door to my parking area. There were no doors available, which could close an opening of 4.2 meter width while parking in 2.3 meters width - so I built a door and equiped it with an electric opener (modified Einhelll BGT 63)
No that's not exactly home automation. Automatic doors are not worth mentioning anymore. However...
I became quite annoyed with having to wait 17 seconds in fornt of the door before could drive into my house so I decided to automated not just the opening of the door, but also the pressing of the "open" button.
The concept:
I have a smartphone with built-in GPS (Nokia E71). Using GPS, the phone knows when I'm approaching my home by car and opens the door 300 meters before I'm at home. The door is open when I reach my house and I don't need to wait on the side of the road anymore.
Furthermore I can check whether the door is open and open/close it from wherever I am.
How did I do it?
The Nokia phone is programmed using pyhton. The python program talks via an internet connection (any data connection GPRS, EDGE, UMTS, WLAN whatever is selected as access point) to the DSL router in my house which forwards the connection to a neat, simple and cheap (27) Ethernet to Input/Output card (Avr NetIO from Pollin Electronics).
Two of the digital inputs of the board are "sniffing" the voltage open/close contacts of the door, two analog inputs measure the voltage on the two pins of the door motor and one digital output is connected to a transistor which acts as external IO siwtch.
-----
The software development environment:
The phone (Nokia E71) runs Symbian 3rd Edition FP2 as operating system and has GPS installed.
The door opener is programmed in Python. I chose Python over C++ or Java for ease of development. It's really the fastest way to get things done on a Symbian Mobile Phone. (generate a file "import audio; audio.say("Hello World") " start it - and you've got synthetic voice output - nice, isn't it? ). If you google for Pyhton S60 you'll find plenty of links to get you started.
---
The statemachine
The statemachine is work in progress. At the moment GPS is always on and the behaviour of the software is simple: It continously measures the distance from my house. If I get nearer the 300 meters and If I'm faster than 30km/h it assumes opens the door.
In future I want to extend the statemachine in order to save battery on my smartphone. GPS consumes a lot of battery, but you can easily find the approximate location by simply asking for the current GSM/UMTS cell identification code.
So what is plan to do: GPS is generelly not active. The software finds out that I left home when I'm not in one of the GMS cells which are close to home. Once I've left home it waits until I reach one of the "home cells" again. If that's the case GPS is activated so the phone can exactly find out where I am and when it should open the door. As soon as it has opened the door, it will switch off GPS and wait until I leave the "home cell" again.
The software runs in Background - so you don't notice it normally.
-- The infrastructure --
This is the easy part:
Nokia E71 => The Ether => DSL Router => Cable => AVR NetIO => Door opener Electronics
For the Phone application I preselect my acess point so I don't get annoying popups when the app needs to connect to my door.
The DSL router does port forwarding to the IP Address of the AVR Net IO board. Luckily (not only by chance), I've got a fixed IP Address from my provider for my router.
The AVR Net IO uses a fixed IP Address.
-- The Hardware --
When building the door I bought a cheapo door opener, because I thought the cheapter, the easier to modify.
The Einhell BGT 63 is an extremly simple design. The motor runs of 24V, switched by relais. The open/close end contacts are simply contacts to GND, pulled to internal 5V with a 1k Resistor.
The external open/close switch is also referenced to GND.
This design makes interfacing with the AVR netio really simple.
7 Resistors, one Transistor and 4 capacitors is all you need.
I used a resisitive divider with a smoothing capacitor (82k/10k / 1uF) to feed the voltage from the motor pins to the analog inputs of the board. The transistor is directly connected (Digital Output - Resistor - Transistor) to the switch.
I added a first order Low pass (R-C Filter 100k 1u) to the digital inputs just to be safe.
The AVR Netio board is supplied with an old mobile phone charger (nokia) The Einhell and AVR NetIO GNDs are connected, so I don't worry about galvanic isolation.
Open Points:
I still need to get an IR "curtain" to stop the door movement if something is close to it. At the moment this automatism is a real safety threat to children (although the door stops when 150 Netowns more than usual are required to move the door). The door is prepared for that already - so it's just a matter of selecting the right parts and installing them.
So that's it.
I took me about 4 days to design the door, 3 days to build it.
About 3 nights to get the grips on pyhton on the mobile phone (first time python programmer)
About 3 nights to get the phone running
About 1 day to install the AVR netIO board.
Total cost:
door: 550 Euro (the door itself, the metal, the wood, the concrete, the bearings, the cables)
door automation: 35 Euros. (27 Euro AVR Netion, Rest: cables and small bits and pieces)
Yeah - geeky - isn't it.
[img]uploaded/insaneLX/2009101821238_AVRNetio.jpg[/img]
This is the AVR NetIO
A video of the door opening: