Smart Garage Door Opener (5)

Go to a previous part of the smart garage door opener project

Step 21. Mount the Components on Plexiglass [optional]

Shutdown the Raspberry Pi and remove power:

$ sudo shutdown -h 0

Mount the components on a small sheet of plexiglass (3-1/4x6inches).

  • Drill holes

  • Use M2.5 size hex nuts, standoffs and bolts


Step 22. Trim Wires to length

I am only going to describe one set of wires. The others can be done the same way.

Cut a red and a black 5mm heat shrink tube in half.

Cut off the fan female header pins, and strip 1/4inch from the red and black wires.

Cut to length a red and black female jumper cable, and strip 1/4 inch from one end.

Slip half the shrink tube over the wire. Solder together two wires of the same color.

Slide the heat shrink tube in place and with the side of the the soldering iron gently go over the tube until it shrinks

I don't have enough head room for the female jumper pins to plug into the header pins and still close the book. So, I very gently broke off the black plastic covering over the female end of the wires. I slipped the other half of the shrink tube over the female connector, and then bent the female connector at a 90 degree angle. Finally, i lightly heated the tube so it shrunk to fit.

Secret Book Opened

Secret Book

Wire to SECO-LARM

Step 23. Put the Garage Door Opener in a Case

My house has is a built in desk and cabinets by the garage door. The desk has several books on it. So, I chose to put the Raspberry Pi, Relay and Remote in a secret book. I got the secret book at Michael’s for about $7. I cut some small holes for the wires and the power cord. I also drilled a 1inch hole on the pages for the fan.

You can put the smart garage door opener in anything you would like.

In the photo above,

  • The four blue dots are from the battery, which is on the bottom

  • Next is a sheet of of plexiglass with the three major components, which from top to bottom are:

      • Remote Control

      • Relay

      • Raspberry Pi Zero WH

  • The devices are connected to the plexiglass so they don't move around

Be very careful with any heat around the battery. They are extremely flammable. Carefully, I put some small dabs of hot glue to keep the battery and plexiglass in place.

Step 24. Replace 12v Battery with 12v Wall Wart

Login to the Raspberry Pi and shutdown it down

$ suo shutdown -h 0

Remove the battery and disconnect all the power supplies

Get a 12v AC to DC power adapter. Do NOT plug it in.

Cut off the 12v adapter's barrel-plug connector

The power cord on my adapter is relatively thick rubber. Using an Xacto knife I made a shallow cut about 2 inches long. Making much shorter cuts, I deepened the cut while peeling back the rubber covering, until the full 2 inches of red and black wires were exposed. I cut off the rubber covering

Strip 1/4 inch from the end of each wire.

Solder the wires to the appropriate battery terminals (see bottom picture. The black end of the battery is positive. On my adapter, the red wire is positive.

Plug in the 12v adapter. Press the garage door button to see if it works. If not, unplug the adapter, flip the wires around and try it again.

When it works, cover both terminals with hot glue. (Provides minimal protection from accidentally shocks)

Reconnect all the power cables.

And check the garage door opens and closes through the Raspberry Pi.

Step 25. Try it out

The project is done. Try it out and ensure it works.

References:

Raspberry Pi Garage Door Opener by quartarian

My original garage door instructable

SunFounder 2 Channel 5V Relay Shield Module for Arduino UNO 2560 1280 ARM PIC AVR STM32

  • 5V 2-Channel Relay interface board, and each one needs 15-20mA

  • Driver Current Equipped with high-current relay, AC250V 10A ; DC30V 10A

  • Standard interface that can be controlled directly by microcontroller (Arduino , 8051, AVR, PIC, DSP, ARM, ARM, MSP430, TTL logic)

  • Indication LED's for Relay output status Link to download the document: https://app.box.com/s/tn34l4ub64ndeo1mb0ec

Troubleshooting:

directories or paths

The github repository shows the directories where the files should be stored

email and text message issues

If you are having issues, then try this:

$ echo "test" | sendmail -v ♣your-gmail-account♣@gmail.com

If email is setup correctly, then you should get an email in your gmail account.

If you get an authentication failure:

You may need to lower security on your account. However, lowering security is NOT recommended. Google will send an email with a link to lower security setting.

You can switch from your current email reader to use www.gmail.com to access your account (recommended) or change your settings at https://www.google.com/settings/security/lesssecu... so that your account is no longer protected by modern security standards.

I do not recommend lowering your security standards.

If you get an Authorization failure:

The most probable cause of this is that you have specified a wrong username or password for your gmail account in the /etc/ssmtp/ssmtp.conf file. Double check the values of the AuthUser and AuthPass fields.

If you get connection lost in the middle of processing:

Chances are you specified the wrong port for the Google smtp somewhere in /etc/ssmtp/ssmtp.conf or in /etc/ssmtp/revaliases.

Check the last lines of your logs. There should be some relevant error messages in there:

$ tail /var/log/mail.log

$ tail /var/log/syslog

Garage Door won’t open

If everything was working and it just stops, then try restarting. If that doesn't work, try

$ sudo shutdown -h 0

Then pull the power cord from Raspberry Pi, and then restore power. The Raspberry Pi should reboot in less than 2 minutes and everything should work fine. This is generally caused by a loss of power to a home Gateway or Wi-Fi Access Point.

GPIO

If anything goes wrong, then the best way to see what is happening is with the gpio commands:

$ gpio readall

Logs

If something goes wrong, check these logs for errors, warnings or other issues.

$ cat /var/log/messages

$ cat /var/log/syslog

$ cat /var/log/dmesg

Raspberry Pi home directory

$ pwd

/home/pi

Raspberry Pi hostname

$hostname

hostname = ♣hostname♣

Raspberry Pi IP

♣raspberry-pi-ip♣ = 192.168.1.93

SECO-LARM stops working

In the old implementation, after two years of use, the SECO-LARM stopped working. To say this correctly, the sensor pin on the Raspberry Pi stopped detecting the 3.3v input. I tried 3.3v physical pins 1 and 17, and both were still outputting 3.3v. I switched from the original sebsor pin to another pin and it started working again. So, there is nothing wrong with the SECO-LARM. The problem seems to be with the Raspberry Pi GPIO.

The is a very good post on how to test GPIO pins.

I was not sure why the GPIO pin stopped working. Here are possible reasons:

  • I have the Seco-larm sensor mounted so when the door is closed it outputs 3.3v. The garage door is closed more often then it is open. Perhaps, the GPIO pin cannot take a more-or-less constant input of 3.3v.

  • The failure coincided with a power loss, perhaps there was a power spike.

  • I did not use the Raspberry Pi's built-in resistors (the issue has not repeated since I did this)

Potential Future Changes:

  • Replace remote with the original doorbell click as an option

  • Replace remote with something that replaces the entire doorbell. Power RPi from doorbell wiring

  • Create custom case

  • Create iPhone app

Go to a previous part of the smart garage door opener project