Monitoring and controlling your garage door from afar with an IP camera

remote-control-garage-door

Last year, [Mark Simonelli’s] wife asked him if he could design something that would allow her to remotely check if their garage door had been left open. [Mark] jumped at the chance to tinker with electronics and designed a system around an old TrendNet IP camera. When remotely connected to the camera using IP Cam Viewer Pro for his Android phone, [Mark] could watch the video stream and also trigger the garage door opener via a small relay circuit he built.

His remote opener worked well, but his camera unfortunately lacked any sort of IR vision/low light capabilities. Since his camera wasn’t very useful in the dark, he decided that he needed to add some way to trigger a light when remotely monitoring his garage. He figured the best way to do this would be to control a power strip-connected light using a circuit similar to the one he built to open the garage door itself.

He stopped by the hardware store and picked up a cheap power strip, disassembling it and removing the power toggle once he got home. He fitted it with a small 5v relay, which he connected to the camera’s terminal block. While he admits that it might not be the absolute safest solution, he can easily control both the light and the garage door with a simple swipe of his phone’s screen.

Continue reading to see his remote controlled power strip in action, and be sure to swing by his site to see more details about his camera-controlled garage door opener.

[youtube=http://www.youtube.com/watch?v=GhQDw3Gr34Q&feature=player_embedded&w=470]

Comments

  1. Andrew says:

    Or he could have used a microswitch or reed switch.

    • Mark says:

      Andrew,

      Doesn’t a reed switch need a magnetic field? How would you have used it?

      The point of my circuit was to send a pulse on a positive edge. If the relay stays energized (or if the switch stays closed), then the switch at the door won’t work.

      The Cam Viewer Pro app on my Droid has a garage door function that toggles the relay (which is cool), but this doesn’t assure that control from the IP camera web page will work.

      • Andrew says:

        Since you ask…

        Yes, a reed switch needs a magnetic field to work. The magnetic field is provided by a magnet. Attach a reed switch to the door frame. Attach a magnet to the door such that it is next to the switch when the door is closed. Connect the one end of the reed switch to a PC serial port input line such as CTS, and the other end to GND. Now write a tiny program to monitor the state of CTS and send it to the internet.

        If you use a microswitch, positioned so that it is closed when the door is closed, you don’t need a magnet.

      • Andrew says:

        Ah, that’s only half of the problem.

        Hook up your relay circuit to a serial port output (such as RTS) and write a program to pulse this line to activate the garage door.

        Naturally I am assuming you have a PC connected to the internet somewhere in the house. I am also assuming that the original project was to detect if the door was open, however, feature-creep has turned it into ‘detect if the door is open and allow it to be closed remotely, plus, take a picture of the inside of the garage and let me turn the light on if it’s dark so I can see’.

    • XOIIO says:

      And how would that work from over an internet connection? I think you failed to grasp the concept that this is REMOTE. He can’t move a magnet to a reed switch when he isn’t there.

      • cutandpaste says:

        The movement of the door engages the switch. The hack reads the status of the switch, via the camera, which (if equipped with relays) also typically includes logic inputs.

    • XOIIO says:

      Yes, but then the light will be on when it doesn’t need to be, wasting power, and I don’t know about the camera but it seems like you would need an arduino as well, using more power.

      • cutandpaste says:

        Which part of “Last year, [Mark Simonelli’s] wife asked him if he could design something that would allow her to remotely check if their garage door had been left open” involves using a light?

    • XOIIO says:

      What part of your brain can’t see the text and video that shows he added one so he could see at night because the camera doesn’t have IR?

      • cutandpaste says:

        What part of written English does not involve including a synopsis as beginning of the first paragraph?

        Stated project goal: Design a system so that the wife can tell whether the door is open or not.

        Mark devised something that does this, but it is rather far-reaching. A switch would do the same thing.

    • XOIIO says:

      Ahh, so you think an LED on wired would be good enough to remotely check, say, if she was shopping or at work? I don’t think so. And if you exclude parts of something and don’t take it all into consideration you really need to rethink that. Why focus on one small, and useless thing rather than what the project is now.

    • XOIIO says:

      Figures that’s how it would go, saw it a mile away. Anyways, seeya.

    • Whatnot says:

      Yes indeed cutandpaste has a point, a reed switch+magnet at the door’s edge that was read and fed into the cam’s logic input would also work to tell if the door was closed, and perhaps later mark will go for that option since I understand the cam only has two outputs so if he comes with another idea that needs output then the light thing can be sacrificed then and those outputs re-used.

      But for now this works too and it’s sort of neat to be able to turn on the lights you have to admit, and it keeps away the burglars too.

      come to think of it, you could also use the combined outputs of the cam to multiplex and create a selector and emulate many more outputs, use one output to select which relay and the second to switch the selected relay, while the cam sees what is selected at any point.

  2. Jay says:

    Should have spent the money he saved on PAINT.

    • You are right. My wife may have said that too, but all I heard was “I would like to know if I left he garage door is up.” The “painting” part just blew right past me.

  3. Rhyno says:

    Just be sure to update your firmware… There was a major security flaw in these things discussed
    here.

    • Rhyno says:

      Rhyno: Thanks for the heads up, but that security flaw is an issue for the newer TrendNet cameras. My camera is so old I don’t even know when I bought it.

  4. Splashy says:

    Nice work.

    I picked up an Axis P1343 for an absolute song on eBay (obviously, the guy didn’t know what he had) and wired up something similar. In my case, I bypassed the SMD push button on the direct-powered remote and replaced the contacts with two wires on the GPIO relay out. To turn the light on without opening or closing the door, I wrote a 2-line script that toggles the output twice in about 300ms.

    My door opener instantly activates the light but waits ~1000-1500ms before actuating the drive motor, so I guess that I was able to cheat on that part, too.

    Additionally, the camera has an IR Cut Filter with an effective night mode and the ability to perform on-device cross-line detection. While the (actually decent) The cross line detect is great for catching shots of neighborhood cats when my SO forgets to close the door.

    On the Axis, running embedded Linux on the onboard ARM with nice API is helpful, but it would also cost more if I paid retail.

    Either way, good job on the build.
    Why buy a dedicated device with an expensive monitoring/remote access subscription when you can roll your own far cheaper?

    Great work.

    Also, a coworker uses a setup similar to mine, though he uses onboard the Axis API to perform object detection and ID which car is in the garage. He has a three-car setup, three cameras and three daughters with different colored cars. Regardless of which bay they pull into, the camera identifies the color and sends a different email with an image cap so that he knows who returned home when. A bit anal, but nifty, I suppose.

    Keep up the good work!

    • JOsh says:

      Do you have any more info how you did this? I just picked up an older Axis camera and am looking to do something similar.

      –JOsh

  5. MrBishop says:

    I think an Arduino is over kill. A TI Launchpad with a serial Bluetooth connection would be plenty to operate the door. Then simply get a DD-WRT enabled router with a serial port (maybe a few USB even). Hook up a second serial bluetooth dongle (in master mode, with alternative firmware). Setup a simple ssh/telnet/php service on the router to login and control if from any number of already made apps.
    Bluetooth: http://www.goodluckbuy.com/serial-bluetooth-rf-transceiver-module-rs232.html
    TI LaunchPad: http://www.ti.com/tool/msp-exp430g2#buy
    serial+2 usb 2.0 port DD-WRT router: http://www.geeks.com/details.asp?invtid=F7D7301&cat=NET
    So thats 2 Bluetooth modules, 1 TI LaunchPad and a Belkin router with a total price of: $62.85 excluding tax’s and possible shipping fees.

    Not a bad price for a start out home automation system with plenty of room to expand for cheap.
    Of course if you could manage to get your hands on a Raspberry Pi that could substitute the router and a Bluetooth module, not to mention give a processing/RAM/Ports boost over the router. you would end up saving even more.
    home automation is getting cheap enough for anyone to afford it.

    I really love this post because it gets me excited about the future. Thanks for all the work!

  6. Chas says:

    Rmoving the IR filter behind the lens will allow the camera to see reasonably well in minimal lighting.

  7. Hirudinea says:

    I’ed be worried somebody would hack the door open, and now even more so after its appeared on Hack a Day!

  8. cutandpaste says:

    Is the goal really to detect door-up or door-down? If so, Mark needs to discover the beauty of roller switches. Or reed switches. Or…

    If so: All this hack, to save the expense of a switch.

    If the goal is to see in the dark: The CCD may or not have an IR filter in front of it. Aim an IR remote at it, see if detects sees bright flashes, and then add a few meager Watts of IR LEDs to illuminate the garage.

    If it does have an IR filter, remove it, and add LEDs as above.

    Optionally: Switch LEDs on/off using camera’s contact closures.

    No big deal, and better/simpler/maybe even cheaper than switching visible light(s) on which will scare the hell out of any intruder to such an extent that you’ll never see a clear shot of their face.

    End of hack.

    • Tod says:

      If you’ve ever been involved in one of the ad hoc “what I need” projects, you’ve probably seen that the original goals sometimes change as the project evolves. In this case, I think Mark was wise to use a piece of hardware he had laying around (unused) to fill a need. Such is the essence of Hackaday!!

      Are there better solutions? Sure. Is his solution best for others? Maybe, maybe not. But it works and it meets a need and it does it in a gloriously hacky way. Most of all, he was willing to share it with us.

      Congratulations, Mark.

      • ksmith says:

        ^^^^ This.

        I’m sure MacGyver’s life would have been a whole lot easier if he could have ordered the exact parts he needed from digikey, but that would have made for some boring TV. Use what you’ve got!

    • Whatnot says:

      This also tells his wife if he’s a secret muslim mole though 😉

  9. DangerDan says:

    Is it taboo to state this companies name? I started reading the over complicated ideas, I’m not saying this is best solution, but its by far the easiest.

    X10, they have a garage door opener system. I use it and it works fine, the open/close sensor leaves a lot to be desired, so pick up one of their wifi cameras, not sure how much it would cost, but its sub $200. Might be worth it, depending on how valuable your time is.

    I don’t use their application, I wrote a php page to do the same thing, except the sensor because it never seems accurate for me.

  10. Peter says:

    ZoneMinder on Linux with a 4-port NTSC card. Standard video cameras are cheaper. One machine, which can be used for other things as well (FTP, alarm system, whatever).

  11. tomas316 says:

    I have a wireless camera. i hated that i couldnt tell if it was up or down at night with the light off. So i put two bycycle reflectors on the door and the IR from the camera bounces back very well from the reflectors. it may be a dark picture, but there are two very distinct white dots(b&w camera) in the middle of the screen. that way i know the door is down even with the lights out.

  12. LifeSizeActionFigure says:
  13. Paul says:

    Is it secure? I haven’t looked at IP cameras in a while but they used to all use http. In other words your password (as well as the video stream) is wide open to anyone with the widely available (and free) software to sniff a tcp stream.

  14. Rich says:

    I did’nt read every comment, so don’t know if this was addressed, but my Garage door opener wallswitch has a button just for the light. I suppose you could cycle this just as you do the open’ close switch, if you just want the light while looking with the camera. Thanks for posting this useful device.

Speak Your Mind

*

Related Hacks in home hacks

  • Arduino compatible home automation for smart phone or voice control
  • The trials of working with brushless DC motors for the first time.
  • Golden spiral chicken coop
  • A much easier take on an Android garage door opener
  • Hackaday Links May 9th 2012