Project GateKeeper - How I Programmed a Door

2023-10-28

I know that the title doesn't make this blog sound very exciting, but trust me: it's pretty neat! As of writing this post, I am now one of two co-presidents of the Computer Interest Floor (CIF) at the University of Rochester. CIF is a special interest housing organization for students that have interests in computers, programming, engineering, digital media, video games, and more!

CIF has a computer lab which floor members and other lab members can access by swiping their student ID cards at the entrance. However, in the beginning of the Fall 2023 semester, the system stopped working. The system was quite old and there was evidence that parts of it had broken in the past, with only temporary fixes being applied as opposed to permanent ones.

Original Card Reader System

Original Card Reader System

An option given to us was to rely on the university for handling our card swipe system. However, CIF's board did not approve of this idea, instead opting to build our own system to maintain full access to our lab. That's where project GateKeeper comes in! Because CIF's program Cerberus was made for the old system, we decided to make a new program for handling swipes entirely from scratch using Python. Python was chosen for its ease of use, readability, and its extensive modules.

The Program

GateKeeper needs to do three things:

  • Swipe: Get the unique 8-digit ID number from a swiped ID card as well as the 2 digit LCC number.
  • Account: Check with CIF's IPA server (where we store lab member accounts) to see if the account associated with the swiped ID should be given access.
  • Strike: If the ID has proper credentials in our IPA server, unlock the door with the door strike.

The more technical details for these modules can be found on the Github repository's readme.

The First Prototype

Once GateKeeper was in a testable state, my good friend and fellow CIF board member Jack Andersen and I put together the first prototype. Here's what we used:

  • Raspberry Pi running Ubuntu Server 20.04 LTS
  • Arduino Uno
  • Breadboard and wires
  • IRFZ44N IRFZ44 N-Channel MOSFET Transistor
  • MODEL:ET-MSR90 ETEKJOY card reader

The "strike" (the thing that actually unlocks the door) requires 12V to activate. Our initial challenge was being able to programmatically send a signal from an Arduino or Raspberry Pi that could activate 12V. This was especially tricky because these devices can only send up to 5V. My good friend Alex Saunders, an engineering student at the University of Rochester, advised us to use a transistor to be able to let the 12V from an external power supply flow to the door strike. We accomplished this by referring to this diagram:

Circuit Diagram

And here's a video of the very first prototype working!

Image of the first prototype

Image of the first prototype

After this success, Jack implemented the code for using the Raspberry Pi's GPIO pins for striking the door. We then worked together to create a more permanent fixture on the wall for the working prototype:

Image of the second prototype

Of course, this is still just a working prototype, and we are continuing our efforts to create a permanent fixture that covers up the hole in the wall, has the connections soldered, and also locks the Raspberry Pi so no malicious actors can access it. Check back later for more progress on this developing project!

Credits

Programming

  • Fenway Powers '25
  • Jack Andersen '25
  • Craig McIlwrath '24

Prototyping

  • Fenway Powers '25
  • Jack Andersen '25

Consultation

  • Alex Saunders '25