Introduction: DoorMe: Smartphone Controlled Keyless Entry for Dorm Rooms
This project is for you if...
A) you have ever accidentally locked your keys in your dorm room or apartment, much to the frustration of your personal pride and/or roommate and/or locksmith.
B) you are looking for an inexpensive keyless entry system.
C) your dorm/apartment building (like many) doesn't allow you to tamper with the existing locks and handles (as most keyless entry systems require.)
D) you are looking for a fun beginner/intermediate Arduino project.
E) you want to impress your friends/family/hallmates.
F) all of the above.
I did a LOT of searching on the Internet (starting with Instructables of course) to see if anyone had solved the problem. Some people had come up with crude, Arduino-powered keyless entry systems but few of them were smartphone controlled and none that I could find were well documented or explained. I had no Arduino experience prior to this project and it required a lot of learning along the way. My final product is by no means perfect but hopefully it will be enough to help others along in their quest to build a dorm-ready keyless entry system.
So here's how DoorMe works.:
The Arduino will be hooked into your Wireless network through an Ethernet connection. It will constantly be waiting for incoming commands. When it receives the right command (sent over WiFi from your smartphone) it will rotate a servo 180 degrees. When attached to a door handle or twist lock this can unlock a door. It also has a sensor which senses if the door has been opened and lets you access that information from your phone.
This is my first Instructable, so go easy on me. ;)
Step 1: Materials and Tools
For the circuit I used:
- 1 Arduino Uno (I used a clone circuit)
- 1 mini Breadboard
- 9 Jumper cables
- 1 high torque servo (must be strong enough to pull your handle. I used a Hiltec HS-645MG)
- 1 Hall effect sensor
- 2 small neodymium magnets
- 1 Arduino Ethernet shield (also a clone)
- 1 10k ohm resistor
- 1 Ethernet cable (long enough to reach from the door to a wireless router or Ethernet jack)
- 1 Arduino to USB cable (long enough to reach from the door to a power source)
For the casing I used:
- 1 sheet of acrylic
- 1 small metal hinge (Walmart $1)
- 8 small screws and nuts (Walmart)
- some foam
To attach DoorMe to the door I used:
- Scotch permanent mounting tape (double sided)
- electrical tape
- Arduino software
- soldering iron and solder
- hot glue gun
- exacto knife
- laser cutter
Step 2: Building the Circuit
This is the schematic that I used.
Originally it was just a simple servo circuit, but I decided to add the hall sensor to sense when the door opens. If you didn't use the hall sensor, I suppose the circuitry would be much smaller, as it wouldn't have the breadboard and extra cables and sensor and such.
Step 3: Modifying/Uploading the Software
Attached is the Arduino code used.
Open it in the Arduino software.
Set your password, following the in-code instructions.
To find the IP address your DoorMe will be using, plug your computer into the Ethernet port or router you will be using, then check your network settings for the IP.
Set the IP address that your DoorMe will be plugged into in the Arduino code.
Once everything is set, plug your Arduino into the USB and upload the code.
Then plug your Arduino Ethernet shield into your Ethernet port/router.
Step 4: Testing/Using DoorMe
This code uses a network protocol called "telnet" to set up a chat between the Arduino and your computer or smartphone. It will only be acessible by a device on your Wifi network. In other words you can't access DoorMe from somewhere other than your home / dorm. I am using mine on a college campus, which has all of the WiFi on campus networked together, so I can access my DoorMe from anywhere on campus, as long as I am connected to campus WiFi. This isn't necessary though. As long as you have a WiFi signal that reaches outside your door you will be good.
FINDING YOUR IP:
To access the Arduino, you will need to know it's IP address.
It should be the address entered on the last step but just to make sure, there is section built into the DoorMe code that will find the IP address and display it on the serial monitor.
To access this from within the Arduino software, click on the magnifying glass on the top right hand of the screen.
CONTROL FROM COMPUTER
Start by opening up Command Prompt on your PC (Terminal on Mac).
Type in the word "telnet" followed by a space and then enter the IP address of the port you want to access.
If DoorMe welcomes you, you are in!
Follow the on-screen instructions.
CONTROL FROM SMARTPHONE
You should be able to follow these exact same steps using a command prompt app on an Android using a Command Prompt application.
On an iPhone it is a bit more involved, but not too complicated.
You will need to download an app which supports telnet, such as the one pictured, which is called "vSSH lite". The free version will suffice for this use.
Once you install the vSSH app you will start a new connection, specify the parameters like I have done in the photos above, and connect to your Arduino.
It should then work the same as the PC or Android applications from then on out.
Step 5: Building a Case
I laser cut a case out of a sheet of acrylic and hot glued it together. I suppose you could use wood or something else, but since I had access to a laser I used that. ;)
I used foam core hot glued together to hold the arduino in place.
I cut a door into the top to give me easy access to the breadboard later because I am considering adding a buzzer and/or lights for when I walk in the room.
I screwed the servo into the acrylic for stability, as it will have a lot of strain on it when unlocking the door.
I drilled a hole in the side for the hall effect sensor to string through, because it needed to stick out.
Step 6: Mounting It to Your Door
One of the biggest goals for this project was to make sure that it didn't require screws or nails to attach to the door (as most dorms and some apartments don't allow this).
So I attached the box to the door using the double sided wall mounting tape (and lots of it!).
I used electrical tape to mount the neodymium magnets to my door frame in such a way that the hall sensor would be touching them when the door was closed, and would disconnect from them when the door opened.
I positioned the hall magnet sensor and attached it with electrical tape as well.
The servo is just attached to the door handle with some rope that I had lying around. My current servo wheel/pulley was scrapped together very quickly. In the future, I hope to 3D print a better pulley. If anyone has an idea of a better way to attach the servo to the door please let me know or build one and show pictures. :)
Step 7: Enjoy DoorMe (conclusion)
Enjoy and be sure to comment and post pictures / suggestions if you make one!
Plus here is a cheesy video I made. Happy hacking!
We have a be nice policy.
Please be positive and constructive.