UPDATE – I switched over to using the GPIO on the RaspberryPi and it seems to be working great

Let me start by giving the disclaimer that this is probably not the right way to do this task. I have been messing around with the Arduino and ordering random parts to see ‘what would happen’. My experience with hardware circuits is limited to 3-4 weekends. If you see something horrible or you know a better way – please comment.

Looking into garage door openers, it appears that they have gotten pretty complicated with the remotes and trying to fully duplicate a remote was more time than I wanted to spend on the project. I could have moved the project outside to short the wired circuit to close the garage door but the multiple trips in and out in the Texas heat to test it were not worth the trouble.

So I took apart the old Craftsman remote and the insides looked pretty simple. There are three push buttons and the first one is already programmed to the garage. I added two wires that would allow me to short out the button/replicate a button push.

Stepping back a bit, last week I ordered a Sainsmart 5v double relay from Amazon figuring it would be a fun learning experience. I played with it for a while with the simple blink application that comes with the Arduino so I could hear it click to the on position and play with the multimeter.

I took the two wires that I added to the remote and I plugged them in to the common and normally open side of the relay and I could get the garage door to move if I set my pin to HIGH for 3-5 seconds. At this point, Alison was not impressed and was wondering why I broke our working remote. She didn’t see the value in having to reset the Arduino in order to open/close the garage with a remote.

In order to impress her I needed to take it a step further. I decided why not allow any device on our network open the garage. Since our phones automatically connect to the wireless once we hit the driveway, this would be a huge win for dog walking time when we don’t want to carry anything more than our cellphones.

Since I already had an Ethernet shield for the Arduino, connecting it to the network was a non-issue. Again out of laziness, I hit the example code so I wouldn’t have to retype anything. Since I didn’t want to make another program that would sit on a web server (such as the Raspberry Pi I use to control Z-wave light switches and EtherRain sprinkler controller) and then connect to the Arduino, I used the simple ‘web server’ example. By default it opens a listening socket on port 80 and spits back the appropriate HTTP header and content to display the status of the analog pins. Since it reads in the request one character at a time, I just appended it to a string variable and when it was finished receiving the header, I evaluated the substring (the first 23 characters) of that string variable. If it matches what I think it should, I set the relay pin to HIGH and return the html saying the garage door should be moving.

Eventually, I would like to grab a breakout board for the Raspberry Pi and use the Pi’s GPIO to control the opening and closing. The main hesitation has been the challenge in replacing a fried Pi.

If this ends up being a permanent device, it would also be cool to monitor the state of the garage door so I could be notified if I left the door open, address some security/functionality concerns and be able to stop the door at different levels (for example, open 2-3 inches for air flow).

//added the following to the web server example that came with the Arduino Uno
         if(clientString.substring(0,22)=="GET /index.php?on=true")
            client.println("<h1>Door should move</h1>"); 
            digitalWrite(relay, HIGH);
            digitalWrite(relay, LOW);
          client.println("<h1>Door not moving</h1>Debug: " +  clientString.substring(0,22));

Leave a Reply