So, I’m finally back healthy enough to be coding in my free time, and I have made tremendous progress on the garage door opener. Here is how it currently works:
I’m using magnetic reed switches to sense the state of the doors, then send it over to the controller via rf (315 mhz).
When the garage door installers put the garage door opener in, they were nice enough to use Cat5 cable, and only used 2 pairs per safety sensor. That means I can use the other pairs to connect the reed switches without running additional wires. After I’m done, the door sensors will not even be noticeable!
Now to the arduino code…
I opted to use a 2 character code to represent the state of both doors.
- 00 represents both doors being open.
- 11 represents both doors closed.
- 10 represents door 1 being closed.
- 01 represents door 2 being closed.
I have updated the code on GitHub: https://github.com/dhysong
There are 2 arduino projects (an opener and a sensor), and a phonegap mobile app.
The opener receives the rf signal indicating the status, and in turn, serves a json result to web requests indicating the status of the doors. It also listens for web requests to open and close the doors.
The sensor sends the 2 digit code indicating the door status.
The phonegap app requests the door status every 10 seconds, and provides 2 buttons to open and close each door.