Raspberry PI Zero Garage Door Opener Using Blynk




Techie by trade, but hobbyist woodworker and metal fabricator to the core. I document my projects...

Ever lose a garage door opener and looked for a replacement on Amazon? The replacements for my garage door were $20-$30. I figured I'd make one using a $10 pi zero (Ok for like $30 after all accessories) but at least I can use it to control my garage from anywhere I am connected to the internet.


PI Zero Wireless and all accessories (power supply, gpio header, case, etc)

4 channel Relay (you can use a 1 ch or 2 ch, but the price difference for 4 ch was very little so I bought the 4 ch)

Blynk app (App store and http://www.blynk.cc/ )

If you can follow instructions and have some linux/unix experience, you should be able to do this pretty easily.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Setting Up Software Raspberry Pi

Software on Raspberry Pi:

There are many different combinations that will work, I tried to be clear but also not too specific as there are many variables, if you have questions just ask. Also, if be sure to check out my video for additional help.

1. Install latest Raspian OS from here (or any other Linux OS)

2. Double check to make sure WiringPi is installed. Instructions here: http://wiringpi.com/download-and-install/

3.Follow Instructions for Manual Node.js installation; Check your Node.js and npm installation; and then Install Blynk globally found here http://help.blynk.cc/hardware-and-libraries/node-...

**Note: When you get to the "Run default Blynk client", there is a reference to authentication token. This will be emailed to you when you setup a project on the blynk app on your mobile device in a later step.

4. In order for blynk to start automatically after reboot, I edited the /etc/rc.local file as such:

- in terminal type this: sudo nano /etc/rc.local
- add: "sudo blynk-client &" after: fi

- then Control+X to exit, confirm save.

- test it with sudo /etc/rc.local start

Step 2: Wiring 4 Ch Relay to Raspberry PI

First step is to solder a GPIO header to your Pi zero (assuming it doesn't have one, mine didn't). I have a video of this here or you can find other videos on how to do this. https://www.youtube.com/watch?v=gtCwC4VAQZo&t=4s

Next, reference the pin diagram to find the pins you need for the project. For this project, we need 1 5v (pin 4) 1 ground (pin 6) and 2 gpio pins which will control 1 garage door switch each (pin 3 and pin 5).

Then connect each pin to respective pin on the 4 ch relay. They are clearly labeled on the relay.

GND = ground (pin 6)

VCC = 5V power (pin 4)

IND1 = garage door 1 (pin 3)

IND2 = garage door 2 (pin 5)

Now that is done, lets move on to the blynk app.

Step 3: Configure Blynk App

First you need to download the blynk app in the app store. You will be asked to create a profile after install.

Next, create a new project (very intuitive in the app). When you do this, blynk will email you an access code. Don't share this as this is how you will sync your phone to your raspberry pi. If you recall, back in step 1 you needed an access code to start the blynk client. This is that access code. Copy it from email and log in to your raspberry pi and paste it.

Now to configure your project:

-This blynk project will need 2 buttons, 1 to control each garage door as mentioned before. To add a button, click the + button on top right of the project. you will see option for button. Get 2 of these.

-Each button will need to be configured separately.

There are 3 things to configure:

Output - which is choosing the pin that the button will control

Mode - Push vs Switch, Push is a momentary switch which triggers the output while only as the button is pressed, when released, it will go back to the pre-pressed value. Switch is different, when pressed, switch will trigger the output and when release will stay on the triggered value and would need to be pressed again to switch back to pre-pressed value.

Labels - basically naming the button and the values.

Button 1 - output should be gpio 2 (pin 3) and set to push, I labelled mine Main Garage

Button 2 - output should be gpio 3 (pin 5) and set to push, I labelled mine Shop Garage

Step 4: Put It All Together

Before finishing the install, I suggest testing everything before spending the time putting all the final touches on the wiring to prevent from having to do it again.

So I wanted my garage door to function both with the physical switch and also the blynk app. My garage door open and close mechanism is triggered by shorting 2 terminals. Basically, the physical button does this when pressed and same with the relay when the virtual button is triggered on the app. The wiring is very simple and is better explained with pictures than with words. So please reference the pictures.

After you wire it up, install it,add power to the raspberry pi and you are all set. Enjoy!

Here is the video of the project also, between the instructable and the video I hope this helps you with your project. https://www.youtube.com/watch?v=gYN38XgH2fM If you have questions, please feel free to ask a question in the comment section.

Home Improvement Contest 2017

Participated in the
Home Improvement Contest 2017



    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    17 Discussions


    10 months ago

    Hi, Can you tell me how to do the wiring from the relay to the actual garage switch ?

    Solent Phil

    Question 11 months ago on Step 1

    Tried following the instructions in part 4 to get Blynk to start after reboot but although

    "sudo nano /etc/rc.local" appeared to take me to the right place, I couldn't add the specified text, any ideas what I might be doing wrong?

    2 answers
    lidsdadSolent Phil

    Answer 11 months ago

    I think you're in the wrong directory to do this.

    cd .. a couple of times and ls until you see "etc"

    then cd etc

    sudo nano /ect/rc.local

    I had to add the entire start routine to the rc.local file to get it to start up.

    I added

    export PATH=$PATH:/opt/nodejs/bin/

    unset NODE_PATH

    blynk-client YourAuthToken

    Solent Phillidsdad

    Reply 11 months ago

    Thanks I will give it a try, still learning.


    1 year ago

    In the Blynk app I didnt see an option for the board to be pi zero, I saw the other versions. What did you select? PI 3 B ?

    2 replies
    Solent Philxwania

    Reply 11 months ago

    I used Pi 2/A+B+ (WiFi) and it worked


    Question 1 year ago

    Is connecting the relay to the actual garage doors as easy as programming a new garage door remote?


    2 years ago

    I had trouble with the start after reboot. Instead of your line on the /etc/rc.local

    I used:

    /home/pi/blynk-library/linux/blynk --token=<your token> &

    3 replies

    Reply 2 years ago

    This edit worked for me as well. Thanks to you both for the information you both provided. However, there is a problem. When I simulate a power loss by disconnecting and then reconnecting the Pi's power plug, once the Pi boots, the relay light comes on automatically which suggests that a reboot will cause my garage door to open as a result of the reboot (I don't have anything connected to my garage opener yet). I have to press the button in the Blynk app to turn the relay off. Any suggestions on how to resolve this issue? Thanks!


    Reply 1 year ago

    I had the same problem, so I put the project aside for a while. When I was attempting to solve it, I read several forums with no luck. I am still on the search for the answer, but, I wanted to try another relay for an LED.

    The second relay won't turn on on startup, so I tried changing the pin for my garage door (or future garage door). Blink will always keep the first pin live on startup.

    So you may try adding two pins on blink, and add the door opener to the second one. Let me know if you find a solution for this.


    Reply 2 years ago

    do you have a close up of your wiring for your relay on the relay side? Make sure you don't have it wired for normally closed, which probably means you have the blynk app setup for normally open configuration, which gets triggered when you use the app causing the "normal" operation mode. Let's start there.


    2 years ago

    I also had trouble with setting up blynk, instead I followed instructions here


    1 reply

    Reply 2 years ago

    Im glad you were able to get your set up working! Can you help me understand where you were having trouble so i can clarify my instructable?