This is the repository for an automatically unlocking door. This allows a door to automatically unlock once a one of the permissioned users get near the door.
Raspberry Pi
- Continually checks every device loccated in the authorized client list if the device is connected to the local network or not.
- If a device connects to the network and is not already in the connected list the door will unlock automatically.
- The door will automatically locks once the door is shut after unlocking. If the door had not been opened with in 20 seconds of the unlock it will automattically lock again.
- Allows direct override of locking and unlocking of the door using commands from the Android app.
- Determines if the door is locked or unlocked, and if the door is open or closed.
- Manages all socket connections made by the Android app and verifying users credidentials.
- Will email the list of admins when a user has logged in or failed to log in via the Android app.
- Monitors information recived from the Arduino
Android App
- Requires an authorized username and pin.
- Will remember username but after exiting the app the pin must be entered again.
- Display the current state of the door (Locked, Unlocked, Open, Closed)
- Allow locking and unlocking from anywhere.
Arduino
- Initiate servo moter to lock/unlock the door.
- When requested by the PI send a signal to the PI telling if the door is unlocked/locked
- Manage the information from the proximity sensor to automatically unlock the door when leaving from the inside.
Parts
- Raspberry Pi - http://amzn.com/B009SQQF9C
- Wireless dongle - (Optional) http://amzn.com/B003MTTJOY
- Power cable - Micro USB
- Arduino - http://amzn.com/B006GX8IAY
- Usb cable - For power and serial comunication (Check if Mini, micro, etc..)
- Prototyping wires - To connect to the auxilarary components http://amzn.com/B007RTD8FG
- Servo motor - https://www.sparkfun.com/products/11965
- Proximity sensor - I used this one but I am sure others will work. http://amzn.com/B007OCGLVY
- Magnetic door sensor - http://www.adafruit.com/products/375
0. Pre-install
This tutorial is based on a Raspberry-PI running Raspbian. If need to install Raspbian you can get it here
http://www.raspbian.org/FrontPage
All devices must have static ip addressing for the door to automaticaly unlock when they connect to the internet. Google your router for specific instructions on setting static IPs. Usally this setting is under Nat or DHCP settings.
1. Installing
sudo apt-get update; sudo apt-get upgrade; sudo apt-get install git pyhton-mysqldb mysql-server tmux apache2 arduino-mk
git clone https://github.com/quinnsam/Autodoor.git
sudo ./installer
2. Arduino Setup
Frist you will need to get the ide for the Arduino
http://arduino.cc/en/Main/Software
Next you wil need to install the Autodoor sketch to the Arduino you will find the sketch in the Serial_Prox folder named "Serial_Prox.ino"
Pin Layout:
D11 --> +Vcc LED Connected to digital PWM pin 11
D9 --> +Vcc Servo Digital pin to control the servo
A0 --> Servo Potentiometer Analog pin used to connect the potentiometer
D2 --> Door Switch Digital pin for door switch
Proximity Sensor:
Red --> +5V
White --> I2C SDA (pin-A4)
Black --> GND
Grey --> ISC SCL (pin-A5)
Set Dip switches on the proximity:
1 --> OFF
2 --> OFF