Skip to content

Track status of a garage's open/closed state via door sensor and trigger a relay to close garage via web or after timeout.

License

Notifications You must be signed in to change notification settings

bigboxer23/PiGarage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PiGarage

This project runs on a raspberry pi. It utilizes GPIO pins to track status of a magnetic sensor mounted to a garage door, and a relay used to open/close the door. It will trigger the garage door to close after a defined amount of time being left open. Additionally, it runs a small webserver which has REST service urls to trigger closing/opening the door and checking status. Additionally there's a dyp-me003 motion sensor wired up to reset the auto close timeout if motion detected. A temperature and humidity sensor can be attached to allow measurements to be fetched via REST url

Ties together these two projects:
Magnetic Sensor
Opener

Wiring devices to the pi
Sensor for status:
Seco-Larm SM-226L
This is wired to Pin 9 and 13 (GPIO 2 by default).

SSR:
Solid State Relay
The solid state relay is wired to ground on pin 6, 5v on pin 2, and GPIO 7 on pin 7 by default

Motion Sensor:
PIR_Motion_Sensor_Module:DYP-ME003
The motion sensor wired up to GPIO3 (pin 15), 5v (pin 2), grd (pin 6)

Temperature/Humidity Sensor (DHT22):
DHT22
The temperature/humidity sensor wired up to GPIO10 (non Pi4J) (pin 10), 3.3v (pin 17), grd (pin 25)
Note: This sensor requires the adafruit dht driver be installed in a path accessible location.
Example:
git clone git://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
cd Adafruit-Raspberry-Pi-Python-Code/Adafruit_DHT_Driver
sudo cp Adafruit_DHT /usr/bin


There are multiple configurable properties that can be set at runtime:
log.location: Path to the file to log information about opener status, actions, etc.
status.path: URL to get status from (default is "/Status2")
close.path: URL to close garage door (default is "/Close")
open.path: URL to open garage door (default is "/Open")
close.delay: Number of milliseconds before closing the door once it's detected open (default is 10 minutes)
triggerDelay: How long to leave the switch active before turning off (how long you press the physical button) (default is 400ms)
GPIO.status.pin: Pin to use for the magnetic sensor (default is GPIO 2, pin 13)
GPIO.action.pin: Pin to use for the solid state relay (default is GPIO 7, pin 7)
GPIO.motion.pin: Pin to use for the motion sensor (default is GPIO 3, pin 15)
GPIO.temp.pin: Pin to use for the temperature sensor (default is GPIO (non Pi4J) 10, pin 19)

Setup on pi: create a new file at /etc/init.d called garageStartup copy the following into the file

#! /bin/bash cd /home/pi java -jar garage/Garage.jar

set executable (chmod 755)

About

Track status of a garage's open/closed state via door sensor and trigger a relay to close garage via web or after timeout.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages