loading

The Garage Genie is a car automation Arduino gadget. Click on the two images above to see the animated explanation. It aims to do a few things:

1. The “traffic lights” tells you when you’ve inched your car up close enough when parking. The lights are control by an Arduino using an ultrasonic distance sensor.

2. The ultrasonic distance sensor tells the system whether a car is parked in the stall or not. Using iPhone or Android app, you can check whether or not someone’s car is in the garage.

3. Non-invasive remote open/close operation of the garage door via smart phone app. I'm using a spare garage door remote so that you don't need to cut into existing wiring.

4. Webcam view of garage if you have a webcam in the garage.

5. Notification when car arrives, either via email or audible announcement

The Garage Genie is part of my series of Instructables for Arduino devices based on an awesome, open source home automation platform called OpenHAB.


Here is how the pieces of the Garage Genie fit together. Continue on for a step-by-step of how it's built.



Don't know if it'll amount to anything. But I'm in the Instructables Contest, if you want to vote. Thanks!

Step 1: Parts List and Initial Hardware Prep

Here's the parts list.

  1. Ultrasonic distance sensor (less than $4)
  2. Arduino Uno clone ($9)
  3. Arduino prototype shield ($4)
  4. Arduino ethernet shield ($8)
  5. Relay module ($6)
  6. Color LEDs
  7. Dupont cables
  8. 5V AC adapter (like from a smart phone / USB charger)

The initial hardware preparation involves putting the Arduino together and getting the garage door remote ready for wiring. I've combined these tasks into this step.

Once you have the parts, assemble the Arduino components (Arduino, ethernet shield, prototype shield) into a stack like this. Pretty simple.



Next, we'll be using the relay module to actuate the button on the spare garage door remote. To do this, we need to prepare the remote. First, remove the circuit board and solder wires to one of the buttons. This following series of pictures should give you a good idea of what to do.


Here's the circuit board removed from the remote housing.


Next, decide which button corresponds to the garage door open button. Use a multimeter to determine which two pads/legs on the button are shorted when the button is pressed. Solder a few inches of wire to these two legs. You should take the batteries out of the remote so you don't accidentally operate the garage door.


If you measure the continuity across the two wires, it should be an open circuit. Once the wires are installed, try to open garage by touching the two wires together. It won't work because the batteries aren't installed. Put in the battery and try again.

Ok, next!

<p>So cool! I'm happy to see that you've responded to commenters from your other automation project. The fact that this project is so adaptable for other sensors and outputs makes it all the better. </p>
<p>Hey, thanks. Yeah, this stuff is really exciting. The more people get into it, the more cool, creative stuff we'll get to see. Love internet of things.</p>
<p>Hi electronichamsters,</p><p>I have built this and the LED's change colour OK and the door button in openhab operates the relay but my icon does not change in openhab to show if the car is in the stall or not..</p><p>I get this in the serial log from arduino when moving in front of the ultrasonic sensor ...</p><p>starting MQTT send<br>MQTT connected OK from MQTT Send<br>4122<br>4123<br>4124<br>finished MQTT send</p><p>Have renamed the icons you uploaded to mycarstall-OFF and mycarstall-ON</p><p>Only the mycarstall-OFF icon shows at all times.</p><p>Please tell me where I have gone wrong</p>
great instructable, I wonder you can give me some hints on connecting tonmqqt broker when arduino is outside the LAN. I connect but no success with publish our subscribe.
<p>Hello, please I have the code for arduino for this particular project..thanks</p>
<p>Hi, I am 69 years old trying this nice project. Now my mobile app to openhab link is OK and arduino serial port also shows the MQTT is connected, but no data exchange takes place. I am not sure about openhab.cgf file and mosquitto.conf file, can some one share these two configuration files, please.</p>
<p>For anyone who may be going through the nightmare that I did trying to make this work with a different 5V Relay and no LED's or Ultrasonic Sensor here is what I did to make the program work.</p><p>I attached an W5100 Ethernet Board generic to the Arduino Uno R3 and the 5V Relay I bought has Two Relays on it and is configured with an Optoisolator which caused me major problems in wiring up the relay based on the instructions here.</p><p>What finally worked is supply 5v power and ground to VCC and GND on the 4 pin connections labeled VCC - IN1 - IN2 -GND </p><p>LEAVE THE JUMPER ON the two VCC pins on the isolator</p><p>Connect the Ethernet shield to the relay board at IN1 from Digital Pin 9</p><p>Change Sketch to identify pin 9 as the garage button pin</p><p>(Pin 4 is used by the ethernet board to control SD card slot)</p><p>Once this was done everything worked out perfectly!</p><p>Thank you very much for this instructable. I am looking forward to configuring it to work with a presence rule so that it will be trigger automatically on arrival and departure from home!</p>
<p>When I run the command, i get an Error Message:</p><p>mosquitto_sub.exe - Ordinal Not Found.<br>The Ordinal 285 could not be located in the dynamic link library SSLEAY32.dll</p><p>I installed OpenHab and mosquitto on My Win 7 PC.</p><p>Any help is highly appreciated.</p>
<p>Hi friend. First I have to say that I loved your projects. I woul like to know if its possible to use more than one Arduino to send/receive instructions in the network? Thank you.</p>
​So I found the issue.. just dont know how to fix it. I ended up installing a java app called mqtt-spy https://code.google.com/p/mqtt-spy/ <br><br>I connected to my server them under topic i entered 4132 and pressed publish and the relay went off. So my issue is with OpenHab. I copied and pasted your coding right into so I am kind of confused. <br><br>I am going to keep messing around with it. Any ideas would be nice.<br><br>Thanks.
<p>In the mosquitto.conf file did you remove the # in from of the port 1883 ?</p><p># Default listener</p><p># =========================================================</p><p># IP address/hostname to bind the default listener to. If not</p><p># given, the default listener will not be bound to a specific </p><p># address and so will be accessible to all network interfaces.</p><p># bind_address ip-address/host name</p><p>bind_address 192.168.0.50</p><p># Port to use for the default listener.</p><p>port 1883</p>
I kind of feel stupid... lol.. I forgot to add the mqtt java files to openhab. <br>I have it working now and it is awesome!
<p>Thats great you got it working. I am still waiting for parts from China, tracking says they are now in Chicago so I should have them soon.</p>
<p>Nice project, have you also an example how to configure mosquitto for the communication with OpenHub ?</p><p>You make a realy good job, thanks</p><p>Bert</p>
Thats my problem I think. When press the door button on the website the relay does not activate. I know the relay works because when I power on the relay the door opens. See the commit I just post that enplane more. I am at a total lost right now.
<p>Hi has anyone tried using the internal garage door opener instead of <br>the remote opener? I am thinking about this project... While waiting on <br>part from China :(</p>
<p>I am going to hook one up to my garage door opener, but I too am waiting for parts from China.</p>
I got my parts last week and setup everything. To me everything it talking correctly but when I press the open button on OpenHab the relay does not click. I dont have it connect to the door opener but still thought it would make a clicking noise. Maybe I have it setup correctly but i dont know.
<p>Use a volt meter where the relay output is. Before concluding it's the relay, make sure your Arduino really is turning on the output.</p>
<p>I hocked up the relay to the wire for the button to open the boor. It only works when I power of the replay. I think there is a issue with OpenHab. I am using the command mosquitto_sub -h localhost -t # to watch communication from the Arduino and I get </p><p>hello world<br>43.0<br>88.0<br>0000</p><p>Also openhab is connection to masquitto I see it in the logs. </p><p>Just when I press the door button on the webpage it seams like the command is not working even though I see below in the logs. </p><p>2015-01-17 18:31:36.259 [INFO ] [runtime.busevents ] - itm_park_gara<br>ge_btn received command OFF<br>2015-01-17 18:31:36.264 [INFO ] [runtime.busevents ] - itm_park_door<br>_mqtt_act received command OFF</p>
<p>If you put an ohm meter across the relay contacts that will go to the garage door, you should get a brief short when you activate the relay.</p>
<p>I like your project! Very educative ;)</p><p>A lot of the parts needed for this project can be purchased for cheap on this webstore:</p><p><a href="http://voltatek.com/en/" rel="nofollow">http://voltatek.com/en/</a></p>
<p>I've got all the parts now so I have a couple more questions.</p><p>Are the car icon files really supposed to be named something normal? Save-as from above makes them into a really funky name. Can you point me to the logic that chooses which icon to display?</p><p>Basic question on the network, does the .cfg file need to be modified to subscribe to MQTT in general or is this just handled item by item? I assume the password is not required for this to work.</p><p>Thanks, Scott</p>
<p>1. OpenHAB is using the icon in the /images folder. The name of the icon it's expecting is defined in the item definition for itm_park_car_present in the greater and less than sign. It's looking for that name appended with &quot;-ON&quot; or &quot;-OFF&quot;. I didn't realize OpenHAB changes the file names. I'll fix that later.</p><p>2. The .cfg file's MQTT section is edited so OpenHAB knows the IP address of the MQTT broker. The specific MQTT topic name is defined in the individual item definition in the .item file.</p><p>3. Mosquitto is setup to not use password by default.</p>
<p>I assume we set the MQTT transport in the config file the same as the wireless project. After doing that I still don't think OpenHAB is communicating with Mosquitto. I confirmed Mosquitto is subscribe/publish working but if I subscribe to 4132 per the example above I cannot see a command for the door relay through the broker. Is the below normal?</p><p>Launching the openHAB runtime...<br>osgi&gt; 02:06:29.322 INFO o.o.c.internal.CoreActivator[:61] - openHAB runtime has been started (v1.5.1).<br>02:06:50.020 INFO o.o.i.t.mqtt.MqttService[:106] - MQTT Service initialization completed.<br>02:06:50.029 INFO o.o.i.t.m.i.MqttBrokerConnection[:112] - Starting MQTT broker connection 'mymosquitto'</p>
<p>It seems like OpenHAB is connecting to Mosquitto OK. Only thing I can think of is something is wrong with the item definition, and you're not really subscribing to the topic you think you are? When you force publish MQTT topics, do you see the OpenHAB shell report these items? Also try refreshing your browser?</p>
<p>Thanks for sticking with me Eric. For some reason I had a hand full of bindings in the addons folder but apparently not the ones I needed. Did you try Abouillot's RFM on RPi yet? My 3.3v uno is due any day and I don't want to jack up my RPi now.</p>
<p>Great!!!</p><p>I want to copy this project. hahaha!! </p><p>Thank you for your sharing.... </p><p>- Korean engineer</p>
<p>Very cool project!</p>
<p>I get an error opening the .ino file. This is the first portion:</p><p>&quot;Exception in thread &quot;AWT-EventQueue-0&quot; java.lang.ArrayIndexOutOfBoundsException: 0</p><p>at processing.app.Sketch.setCurrentCode(Sketch.java:1182)</p><p>at processing.app.Sketch.load(Sketch.java:220)</p><p>at processing.app.Sketch.&lt;init&gt;(Sketch.java:142)</p><p>at&quot;</p><p>What am I missing?</p>
Any chance to get your private email to communicate offline? Would like to discuss with you on a project I would to hire someone to speed up things
Hi, the links for the openhab part returns empty, any chance to update them ?
<p>Seems to work for me. Temporary glitch perhaps?</p>
<p>Great project. Nice intro to Openhab. I've been playing with MQTT on Arduino and Piface for a while, this project really helped me put the pieces together. Thanks</p>
<p>I know what you mean. So much of this type of automation is about finding the right tools to piece together. A lot of stuff I've seen required writing your own website...that's great if you're good at it, but you have to take care of security and authentication, and OpenHAB does all of that and SO MUCH MORE - it can control Sonos speakers and z-wave stuff and all kinds of things. It's a much more polished setup. I haven't even begin to scratch the surface. Hope to dig into it more.</p>
<p>Great project but I'm curious why you are putting the relay closure across the switch on the remote instead of going directly to the closure input on the garage door opener itself.</p>
<p>For flexibility, I used a relay closure across a remote instead of the hard-wired wall opener. Some newer garage door systems have a circuit board on the wall-mounted opener because the wall opener also controls lights and displays back-up battery status on the wall-mounted unit. There's some kind of comm protocol for that unit, it's not a simple open/close circuit. And you don't have to re-run that pair of wires.</p><p>Also, some people might just want to utilize the opener portion of this tutorial. They could put the relay and Arduino inside the house next to their router.</p>
<p>Nice!<br>Do you have a brand name for that garage door? Trying to decide what type of door to use on new garage and never seem one like that before. Thanks</p>
<p>Well, I have a Sears brand garage door opener. I used a Chamberlain garage door remote. But it doesn't matter what kind of garage door you have, just the remote. All the garage door remotes I've ever used worked the same way - make contact closure with a button. So this method should be pretty universal.</p>
<p>My question was about the garage door, since as stated -- NEVER SEEN one like that before. Thought others might be curious as well.</p>
<p>Great project! Now go find some lube for that clanky garage door. :-)</p>
I'd suggest you look into UL325; a good read up is here: http://suretycam.com/control-your-garage-door-remotely/<br><br>Basically to remotely control a garage door opener without being present, it's recommended (and required by law in Nevada) to meet these requirements. The primary ones being a safety device to ensure no one is under the door (laser sensors that most doors already have), but you also must have audible and visual warning for 5 seconds before the door activates
Am I missing something. Don't garage door openers handle sensing obstructions on their own?
Most of the newer ones do, using the photoelectric beams mounted about shin high. <br><br>However there's two additional requirements to meet UL325, which is 5 seconds of audible/visible warning before the door closes. I was just suggesting the additions of that, shouldn't be too hard with the arduino to make some beeping sounds through a speaker and flash some bright white LED's or something. I've wanted to make this for myself, and this is an awesome instructable, so I might figure that part out myself if I get time :-)
<p>Thanks for the pointer about the new regulation. I think this highlights the strength of Arduino solutions. Where as the commercial solution takes years to come up with, Arduino users just need to add three lines of code and utilize another of the relays on the 4 channel relay and add a buzzer. Love Arduinos.</p><p>digitalWrite(buzzerPin, LOW); //active low</p><p>delay(5000);</p><p> digitalWrite(buzzerPin, HIGH);</p><p>//rest of remote switch code</p>
Woah! Nice!! ...if only I had a garage.... XD
Great stuff. Keep it up.
<p>Thank you for your nice instructable.</p><p>Rima</p>

About This Instructable

78,474views

801favorites

License:

Bio: I love home automation. I hate home automation.
More by electronichamsters:Gingerbread Home Automation Tweeting Pregnancy Test Physical Home Automation Interface 
Add instructable to: