Introduction: Open Your Garage Door From Anywhere Plus Security Cam!

Picture of Open Your Garage Door From Anywhere Plus Security Cam!

Hello everybody, here is a simple instructable makes your old phone a security camera you can view anywhere there is internet and also controls your garage door remotely with very few components!

It makes use of a free app called Alfred security IP cam,

By adding few electronic components, this security app can open and close your garage door from anywhere.

In fact, you can use this option to do whatever you want, like, turning lights on and of, watching another device and running it remotely.

Lets go!

Step 1: The Components.

Picture of The Components.

The few components required are:

1- Photocell.

2- 2 resistors.

3- An NPN transistor.

4- A diode.

5- A relay.

Step 2: Diagram and Components.

Picture of Diagram and Components.

The picture shows the diagram and the components for this project.

After building the circuit, put the photocell right on the phone's flash, tape it in place and cover very well. The cover will prevent outside light from triggering the device.

Connect your relay's normally open contacts to your garage switch.

Now, on your remote control device, which is normally your personal cellphone, open Alfred app and hit the flash light icon, this will turn the flash light on on your camera, turn it back off, your garage will either open or close.

Step 3: The Garage Through the Monitoring Phone.

Picture of The Garage Through the Monitoring Phone.

As you can see here, on your cellphone, open Alfred security app and connect to the camera in your garage.

Once connected, hit the flash light icon once, wait about a second and turn the flash off. The garage door will move.

Step 4: The YouTube Video

Here is the YouTube video.

As you can see on the video, the process is not difficult.

Just follow the instruction and you will get a great security cam with remote garage door opener.

This project can be modified to receive DTMF commands and this way will do more controls. I am just waiting on my components to arrive!

Please leave your comments/questions on this project and I will be more than happy to answer them.

I am planning on publishing another garage door remote control, but, with Arduino and blue tooth.

Thank you very much!


c808788 (author)2017-11-21


Any update

"This project can be modified to receive DTMF commands and this way will do more controls. I am just waiting on my components to arrive!"

zarkani (author)c8087882017-11-21

I did very little on this because I built my own app and esp8266 wifi.
If you think you can work with arduino and esp8266 I can send you my android app and and the arduino code.
Other than that I am willing to help you as much as possible.
I have limited time but will do my best even with dtmf.
Thank you!

EricZ26 (author)2016-06-03

Im confused. I got everything working well using the relay, resistor and photocell method. However, activating the relay renders my wired garage button dead. The backlight dies and the button doesnt work. How is the relay killing power to the button when its wired directly to the opener?

Really fun project nevertheless.

JosephW44 (author)EricZ262016-06-03

I used the door opener to power the instructable and placed the phone on top of the opener facing camera towards the door.

EricZ26 (author)JosephW442016-06-07

I like this idea, but i dont want to have to climb over my car every time the app force closes or the phone has a kernel panic and reboots. Are you just taking power and control from the switch terminals?

zarkani (author)EricZ262016-06-07


Why do you want to climb over your car?? Your phone should be close to the wall mounted switch and it has nothing to do with door opener mechanism.

You provide power to the device from the same charger you use to charge your phone, it works on 5 volts.

As in the other reply, connect the relay terminals to the switch terminals. Please measure the voltage first, because I do not know what kind of garage opener you use. Normally, the voltage at the switch between 14 to 17 volts and you shorten this voltage as you click the switch to open the door.

Thank you,

EricZ26 (author)zarkani2016-06-11

The way I read it, JosephW44 didn't use the garage door opener button at all and he just wired the relay and USB power from the door opener itself.

zarkani (author)EricZ262016-06-11

Both can be done. The two wires going to the wall switch, they both come from the door opener, you can connect to these wires at the opener itself or at the switch.

It is better to use the switch though.


zarkani (author)EricZ262016-06-03

Yes, that is how the switch works. The two wires bring about 14 volts, if you shorten them for a short time, 1 to few seconds, the door opens, at this time, you kill the voltage at the switch. All you need is to connect in parallel the relay terminals and the switch terminals. I use it all the time and it works always.
Please let me know if you have any questions.

EricZ26 (author)zarkani2016-06-07

Thanks for the reply. I know just enough to make me dangerous. Whats the best method to connect the relay terminals in parallel?

zarkani made it! (author)EricZ262016-06-07


Just run two wires from the relay terminals, the common and the normally open ones, connect them to the two points your wall mounted switch closes when clicked.

Thank you,

EricZ26 (author)zarkani2016-06-08

I've already ran those wires. Thats how I initially set it up, but the relay is somehow killing power to the button. Could the NO and NC terminals on the relay be labeled wrong?

zarkani (author)EricZ262016-06-08


When the relay is ON, the normally open terminals close, as they close this kills the power to the switch and that is how it works. Can you hear a click sound as the relay goes ON and OFF? if not, then your relay is always ON and you need to review your circuit!

The relay should only go ON when there is light on the photo sensor.

The sensor must be covered and not exposed to external light.

If you have any questions, Please do not hesitate asking, would be very useful if you add photos.

Thank you,

EricZ26 made it! (author)zarkani2016-06-11

As it turns out, the picture on my relay is slightly different than your relay. I had the wires from the door button wired to what I thought was the normally open position. Turns out it was the normally closed position. I switched the wires to the normally open terminal and it works great! Sorry for the confusion.

zarkani (author)EricZ262016-06-11

Glad it works now! It is useful.

Thanks for letting me know!

JosephW44 made it! (author)2016-06-03

It's done now to install it and see if my work payed off.

zarkani (author)JosephW442016-06-03

Smart guy! Thanks for letting me know that you made it!

instructable06 (author)2016-01-07

Would you provide part numbers and place where you bought your items please

zarkani (author)instructable062016-01-07

Yes, the transistor is 2n3904 or similar:

resistors 1.2 k ohm and 68 k ohm, both are not critical and the 68 k can go up to 100 k, the 1.2 k can go down to 470 ohms.check this:

5 volts relay, does not require high current.

photocell or photo resister check ebay:

Very cheap!

A diode to protect against relay's back emf, can be :

Thank you!

Paxman5 (author)zarkani2016-01-31

Just placed orders for all the components! :-) I choose this relay:

Hope it will work.

One more question, since I'm such a electronics noob: the diode, is it in your schematic? I have identified all the other stuff but I can't see the diode. I did a copy of your schematic in Sketchup. This way it's easier for me to understand and follow the signals. Does it look correct or have I missed/missunderstood anything?

zarkani made it! (author)Paxman52016-01-31


It will work. It is not difficult and very useful.

With the relay you are buying, you do not need the diode because you are buying a relay with its driver. you, however, need to modify the circuit a bit. Follow the one attached, I modified your nice schematic using MS Paint!

If you have any questions, please let me know.

My original design works directly on any rely, like this one from ebay:

The one you bought works too, I, only do not know if it requires positive or negative on the (IN) pin to work, the circuit attached works on one negative driven which is what I believe the one you bought uses.

If not, just let me know and will give you the required circuit which will not be very different.

Paxman5 (author)zarkani2016-02-01

Thank you so much zarkani! You are so helpful and positive, not at all like the guys on an electronics forum here in Sweden that I asked about another project I wanted to try. They were really condescending. :-(

The reason I didn't buy the first relay you linked to is that they didn't ship to Sweden. Same with the one you linked to now. Dp you think this is the same?

I notice it does not say "type EVV" but it looks identical. I might as well buy one that works with your original design if there is any problem with the relay I first bought. We have a saying i Sweden: "Don't let your stinginess fool your wisdom"! :-) These components are so cheap that it dosen't matter if you buy a few things you don't need.

zarkani (author)Paxman52016-02-01


You are very welcome.

I have good news for you!

I recently got a relay set similar to the one you ordered but it has 4 relays instead of one. I did some experiments on it and found out that you do not need other than the photocell and one resistor in the range of 3.3 k ohm to 33 k ohm.

Just wire your circuit as in the picture attached.

Please do not hesitate asking. I will do my best!

Thank you,

BobS118 (author)zarkani2016-02-03

Sorry for being naive but in this set up, where do you connect the VCC, GND, and garage door switch?


zarkani (author)BobS1182016-02-04

Hi, vcc is your positive 5 v frm your power supply and ground is the negative. For the garage switch, it is the switch on the wall you hit to open and close your door. Look in the comments, you will find more info.

BobS118 (author)zarkani2016-02-04

Sorry I wasn't very clear in my question. I modified the diagram with the fancy relay. Is this correct?


zarkani (author)BobS1182016-02-04

Yes, this is correct. Just make sure that the normally open part of the relay is used.

See the attached picture

BobS118 made it! (author)zarkani2016-03-09

Works like a charm!

Thanks for your help!

zarkani (author)BobS1182016-03-09

very glad it works, thank you very much for the feedback!

Paxman5 (author)BobS1182016-02-04


If you are talking about the relay I ordered (the one with the LEDs in the picture zarkani attached), the VCC and GND is printed on the board. The garage door switch is connected to the blue block with screws on the right side if the relay. At least that's as far as I understand. :-)

Paxman5 (author)zarkani2016-02-01

Really? :-)

So, just to be sure: I won't need the NPN transistor? Only the photocell, the relay I ordered and one resistor (in the range of 3.3 k to 33 k Ω)? That's it? Well the iPhone 4S obviously...;-)

zarkani (author)Paxman52016-02-01

Yes, that is it. Use the attached diagram which I already checked and it works very well. Make sure the phone you get runs the app.

Paxman5 (author)zarkani2016-02-01

Sweet! I can't wait for my components to arrive! :-) I guess it will take some time since China Post is not the fastest carrier but then I have time to find a phone. My daily phone is a iPhone 4S and I already have Alfred installed on it. It seems to work fine and I have read that people are running it on the 4S.

I will report back here when I'm doing any progress.

zarkani (author)Paxman52016-02-01

Let me know when you get the components and we will make it together.

Paxman5 (author)zarkani2016-02-15

Now I have sourced a cheap iPhone 4S and the surveillance part is up and running! :-) Eagerly awaiting for the components to arrive...stupid Chinese New Year...:-/ No, really Happy New Year to all you Chinese people! ;-)

DawidD3 (author)2016-02-18

Hey, any chance you can post a detailed back/front picture of the completed circuit? Also, what sort of power supply does this need?

I'm having a bit of trouble getting this all together, but I love the concept.

zarkani (author)DawidD32016-02-18

What components you have now?
The power supply I use is the phone charger, connect the positive to Vcc and the negative to ground.
You can use the same charger you charge your phone with to power the relay.
I cut the charger wire and identified the positive and the negative, then took two wires from there to supply the relay.
Some, as you find in the comments, bought different relay. They bought a relay with its driver, which means there is no need for a transistor in this case.
Please let me know what components you have now and I will do my best. It is a simple project and I use it all the time.
Here is a link to a relay the others bought:
Thank you,

DawidD3 (author)zarkani2016-02-19

Bought the ebay components you listed. I'm using the radioshack relay found here:, Since i had one lying around for some reason.

Could you also show me a picture of the power line splice?

zarkani made it! (author)DawidD32016-02-19

Here is a picture, Sorry if it is not clear, the device in a difficult to reach spot.

The relay you have should work, it is similar to the one I got.

Please see the picture.

You can use separate power sources, 2 phone chargers for example, one for the phone and the other for the relay circuit.

You can also find more information in other's comments.

Please let me know if you have other questions.


DawidD3 (author)zarkani2016-02-24

Any chance you have a clean schematic for the build with the radio shack relay? I can't make sense of the one in your pictures - it seems to be missing a resistor.

Also, what pins on the relay should I be attaching bits to?

zarkani made it! (author)DawidD32016-02-24


The schematic is attached.

The relay normally open contacts go to the garage door switch. The coil terminals go between the positive and the collector of the transistor.

Resistors are not critical, we can even omit 68k resistor, but it is there to guarantee that the transistor will turn off if there is little or no light on the photocell.

Thank you,

BobS118 (author)2016-01-31

I am a complete noob (took electronics class in high school 25 years ago). I am a little confused with the relay. There are a numerous relay options with varying number of connectors. Do you have a specific part number for the relay with how many connectors and how they are connected? Also the VCC and ground is connected to what?


And I apologize in advance if my questions sound clueless. I can follow instructions but just need a little more detail.

zarkani (author)BobS1182016-01-31


Any 5 v relay should work, normally the relay has at least 4 connections, two for the relay coil and two for the normally open connection on the relay, but most relays have 5 or more connections like this relay from ebay:

The Vcc and the ground are the positive and negative of your power supply ( normally the 5 v supply) which can be a phone charger, you cut the wire, identify the positive and the negative. The positive will be your Vcc and the negative is the ground.

If you have any questions, please let me know.

Thank you!

Paxman5 (author)2016-01-31


I'm thinking of building this wonderful gadget! I have one question before I start looking for an old iPhone: is Alfred able to use the "selfie"-cam as the security cam on the iPhone together with the flash? The reason I ask is that I already have an iPhone (3GS) as my garage phone and I have it in a charger so I can use the display for playing music and such. If Alfred can use the "selfie"-cam function and still trigger the flash I can trash the old phone.

zarkani (author)Paxman52016-01-31

I am not sure what you mean by " selfie"-cam!
If you mean the front facing cam, then with Alfred, you can remotely switch between front and back facing cams on your phone.
The flash works only when you use the back facing cam, you, however, can switch to the back camera, hit the flash and then go back to the front camera, which will turn the flash off.
From the comments here, I know that Alfred may need higher operating system than what iphone 3GS!

Paxman5 (author)zarkani2016-01-31

Yes, you are correct! I was talking about the front facing cam. With the functions you mention all is good so I can start looking for a 4S to replace my old 3GS. Thank you!

zarkani (author)Paxman52016-01-31

Just make sure the app runs on the phone you are about to buy.

GRUBDUDE (author)zarkani2016-01-31

can't you just use a flashlight app instead? Then you can use whatever camera you wanted.

Paxman5 (author)GRUBDUDE2016-01-31

Well, simplicity is always preferred. I want to be able to operate my garage door remotely and have surveillance of the garage itself wherever I am in the world. Motion detection would be great too and I think I have read that Alfred have that. If one app have all I want, why would I want two different apps?

zarkani (author)2016-01-31

In fact, we can even use the microphone on the app to send any sound to the camera and that sound can trigger a relay to control something else.

About This Instructable




Bio: I am a Mechanical Engineer with lots of hobbies. I love electronics and have been working with electronics for decades. I love astronomy too, specially ... More »
More by zarkani:Bluetooth door opener/ monitorOpen Your Garage Door From Anywhere Plus Security Cam!
Add instructable to: