Keys are an antiquated technology. Imagine the ability to unlock doors with any RFID card already in your possession. For those of us on campus, a PennCard is the most likely candidate. We developed an Arduino based electronic door lock. Using a connected RFID sensor, access cards can be easily added/removed. The device uses a servo to turn an existing deadbolt. This makes installation easy and removes safety and fire code concerns since the existing lock/unlock mechanism will still be available as a backup.

The idea came about after leaving my keys in the car. I had to walk all the way across campus back to my parking spot simply to open the front door. In the 21st century, this should simply not be the case. A door should be able to be unlocked with a key, phone, or any other card you happen to carry with you.

The main loop on the Arduino Uno first reads from the RFID card. This is a blocking call, meaning the loop with pause until a card is actually read. Once we read the card number, we compare it to an authorized list of cards. If a match is found, the unlock method is called, a blue light is displayed, and the output wire goes high for 10 seconds. After 10 seconds, all lights will turn off and the output wire will go low again. If the card number is not found in the authorized list, a red light will illuminate and the device will be unable to read any cards for 10 seconds. This prevents brute force attacks against the device.

The MKR1000 reads the output wire above as an input to control the servo. If the wire is high, the servo will unlock the door. If it’s low, the servo will lock (or stay locked). The MKR1000 also monitors an interrupt pin. The button is connected to this pin and will force the door to remain in an unlocked state until the button is pressed again. An output pin from Blynk is also connected to this same interrupt pin, creating a logical OR circuit. This means pressing the button on Blynk will have exactly the same effect as pressing the physical button located on the device.

Many iterations occurred throughout. The main trouble was with interrupt pins. We did not realize the RFID reader needed two interrupt pins to operate correctly. Since the Arduino Uno only has two, this left us without any additional pins to work with. Since we don’t want to constantly poll for a button press (wasting electricity and potentially having no action if pressed at the wrong moment) we needed an interrupt pin available. At this point, we believed the MKR1000 could replace the Arduino Uno entirely -- it has WiFi, is supported by Blynk, and has an abundance of interrupt pins. We had great difficulty, however, getting the RFID reader to play nicely with the MKR. This is the reason our final solution uses two separate boards, communicating through GPIO.

On the mechanical side, the iteration started with a consideration for how to position the servo to turn the lock. Initially the servo was going to be placed below the handle, and would be geared to turn the lock. This was later altered so the servo shaft was concentric with the lock and could directly turn the lock.

This project could be turned into a real product with a few changes. One would be the housing for the motor. Currently the housing is made from laser cut parts, but as a product these parts would likely be injection molded, for a nicer finish and more durability. Another chance would be having different lock adaptors. The current version works for the type of lock we had, but other doors may have a different lock, which would require a different, likely easily changeable adaptor. Lastly would be the mounting for the device. Currently the device is affixed to the MDF frame for the door knob, as a product this would not be feasible. An alternative for a product would be easily removable adhesive, such as command strips.

Before release, we would need to reduce the number of controllers. Using two devices to control a single product wastes a lot of battery -- which would be an important consideration in a device such as this. In addition, a formal security review would be highly recommended considering it will secure people’s personal homes. Finally, a custom web interface/app would need to be developed, having customers use Blynk would be unprofessional -- not to mention this new interface would provide an easy way to add/remove access without changing constants in the code.

Improvements that could have been made include a more robust housing for the device.


System Design

Sensor Description
RFID Reader Authenticating the access cards
Push Button Unlocking/locking from the inside
Part Description
Servo To turn the lock
RFID reader To read access cards
3D printing For the enclosure

Connectivity: WiFi connectivity can be used to remotely monitor the state of the door and issue lock/unlock commands.

Bonus: If time allows, a speaker can be added to play theme music upon entering/exiting.


Edward Atter atter@seas.upenn.edu, Michael Gigante mgigante@seas.upenn.edu

Built With

Share this project: