RFID Door Opener for Quick Access

by Z3_R0 in Circuits > Gadgets

5035 Views, 41 Favorites, 0 Comments

RFID Door Opener for Quick Access

PXL_20251204_170740419.jpg

I am an engineering student, and I enjoy using technology to solve problems. One day, my dad told me that he was tired of constantly taking time to unlock his office door with a key. Apparently, it is quite the process for him to dig the keys out of his pocket, find the correct one, and stick it in the lock the right way. Furthermore, his office door locks automatically, leaving him out of luck if he forgets his keys in the office.

Therefore, to streamline the door-opening process, I developed a system that uses an RFID key (like an ID card or fob) to grant access through the door. The system was designed to adhere to the following requirements:

  1. No major modifications to the door can be made (e.g. holes)
  2. The device must be completely housed behind the door
  3. RFID signal must be received though the door
  4. The device must allow for the door to still be opened with traditional key
  5. The device must be called "The D'Opener"

Supplies

Here is a mostly complete list of supplies for this project:

Equipment

  1. Soldering iron
  2. 3D printer

Parts

  1. Arduino
  2. Arduino perf board shield (optional)
  3. DC barrel jack and 12V brick (or hard wire to 12V source)
  4. 12V-5V DC converter (link)
  5. Relay breakout board (link)
  6. Parallax RFID serial module (link)
  7. Bosch Seat Motor (link) or other right-angle gear motor of your choice
  8. (2) limit switches
  9. (2) pushbutton switches
  10. Toggle switch
  11. RFID card or fob compatible with the Parallax RFID module
  12. A bit of rope (~1/4" dia. ~12" length)
  13. Various wire and hardware

Idea

Screenshot 2026-03-01 172453.png
PXL_20250130_174552830.jpg

To accomplish this task, I devised a unit that would sit directly below the door handle. The unit would have an RFID reader on the backside to scan a key card or fob through the door. A motor would be used to turn a spool. The spool would wind a rope that is affixed to the end of the door handle, thus pulling down the handle and opening the door from the inside. Limit switches would be used to set stops for the motor rotation. The unit would also be mounted directly to the door handle to avoid drilling into the door.

Mechanical Design

Screenshot 2026-03-01 171010.png
Screenshot 2026-03-01 171127.png
Screenshot 2026-03-01 171028.png
Screenshot 2026-03-01 171318.png

I designed the entire system to be primarily 3D printed. The box is affixed to the door by the clamp around the door handle on the top of the box (while still allowing rotation of the handle). To prevent rotation of the unit during operation, I added a small shim along the edge of the door. You may need to adjust for your door geometry.

The spool is fixed to the motor's hex shaft with a set screw. There are many holes around the circumference of the spool. These are intended to accept small screws that will contact the limit switches behind the spool. The user can "program" how far the motor turns by placing the screws in different holes.

The RFID module is placed on the back of the box, right against the door. The inside of the box contains the motor and all of the electronics. The box uses M3 hardware with some holes using threaded inserts for strength.

I printed all the mechanical parts in PLA with default settings. There are four bodies in the "DoorOpener" STL file that can be split apart in the slicer.

In addition, I modeled a small handle grip piece to slip on the end of the door handle. I printed this in flexible TPU. You may need to adjust for your door handle shape.

Electrical Design

Screenshot 2026-03-01 142959.png

I designed this circuit to be powered from a single 12V barrel jack. The 12V is then connected to a DC-DC buck converter module via an inline power switch. A linear regulator (LM7805) could also likely be used instead of the buck converter as the current draw on the 5V rail is relatively low.

The 5V powers the Arduino and all the other logic-level circuitry. None of the analog ports are needed and the Arduino has an internal pullup resistor on the reset pin so that can be left unconnected as well.

The motor is controlled via the relay shield. The shield contains two SPDT relays controlled by the outputs of Arduino pins D2 and D7. With this configuration, the motor can be operated in one direction with D2 high and D7 low. Likewise, the motor will turn the other direction if D2 is low and D7 is high. The motor will not turn if D2 and D7 are both high or both low.

The Parallax RFID module communicates to the Arduino via a software serial port. The serial out pin connects to pin D5, which serves as the RX pin. A TX pin is not needed (although assigned in software to D4) because the Arduino does not need to transmit any information to the RFID module. The enable pin, D3 is held low to enable.

I included a small piezo buzzer to play a tone upon RFID scan.

Switches 2 and 3 are each limit switches that define the travel of the spool element. They are wired in the normally open configuration.

Switches 4 and 4 are illuminated pushbuttons. The "Exit" button is used to momentarily trigger the door opener from inside the room. The "Hold" button is used to toggle the door opener to a locked or unlocked state.

Programming

I did not have any previous experience using the Parallax RFID module, so I set out to find some resources online. Luckily, I came across a fabulous Instructable by Kev_MacD, titled "Wiring and Programming the Parallax RFID Serial Card Reader for the Arduino", which is exactly what I was trying to do. Much of my code is adapted from this source code.

I will now walk through the code. The preprocessor directives are simple pin definitions and including the software serial library.

// Firmware v1.1 for D'OPENER
// by Z3-R0
// Includes source code from Kev_MacD: "Wiring and Programming the Parallax RFID Serial Card Reader for the Arduino"

#include <SoftwareSerial.h>
//Parallax RFID Reader
#define RFIDEnablePin 3 //Pin that enables reading. Set as OUTPUT and LOW to read an RFID tag
#define RFIDSerialRate 2400 //Parallax RFID Reader Serial Port Speed
#define RxPin 5 //Pin to read data from Reader
#define TxPin 4 //Pin to write data to the Reader NOTE: The reader doesn't get written to, don't connect this line.
//#define LedPin 13 //Pin to user led
#define Relay1Pin 2 //Relay 1 to motor
#define Relay2Pin 7 //Relay 2 to motor
#define PiezoPin 6 // buzzer
#define Limit1Pin 11
#define Limit2Pin 12
#define ExitButtonPin 8
#define ToggleButtonPin 10
#define ToggleLedPin 9

Here is where you will hard code the RFID numbers that correspond with your keys. More about how to obtain the numbers later. You can add as many numbers as you like as long as they have unique names.

#define CardNumber "XXXXXXXXXX"
#define FobNumber "XXXXXXXXXX"

Just some more setup, enabling the RFID reader and the Arduino's hardware serial port to your computer.

SoftwareSerial RFIDReader(RxPin, TxPin);
String RFIDTAG = ""; //Holds the RFID Code read from a tag
String DisplayTAG = ""; //Holds the last displayed RFID Tag

void setup() {
// RFID reader SOUT pin connected to Serial RX pin at 2400bps
RFIDReader.begin(RFIDSerialRate);

pinMode(RFIDEnablePin, OUTPUT);
pinMode(ToggleLedPin, OUTPUT);
pinMode(Relay1Pin, OUTPUT);
pinMode(Relay2Pin, OUTPUT);
pinMode(PiezoPin, OUTPUT);
pinMode(Limit1Pin, INPUT_PULLUP);
pinMode(Limit2Pin, INPUT_PULLUP);
pinMode(ToggleButtonPin, INPUT_PULLUP);
pinMode(ExitButtonPin, INPUT_PULLUP);

digitalWrite(RFIDEnablePin, LOW); // LOW=enable
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Hello world!"); // prints hello with ending line break
motor(false, false); // motor off
}

In loop, the RFID reader is called to retrieve the tag number if one is available. Then, if the tag number matches one of the pre-programmed numbers from the snippet above, the door will unlock. If you have more tags, you can simply add more conditions to the "if (DisplayTAG==...)" statement. Finally, loop then checks the buttons and handles them accordingly. Pushing the toggle (hold) button will toggle the door lock. Pushing the exit button momentarily toggles the door lock but locks again after one second. I added a "double check" for each button because I was observing some nuisance button signals.

void loop() {
if ((RFIDReader.available() > 0)) // If data available from reader
{

ReadSerial(RFIDTAG); //Read the tag number 10 digit serial number
DisplayTAG = RFIDTAG;
Serial.println(RFIDTAG);


if ((DisplayTAG == CardNumber) || (DisplayTAG == FobNumber)) // correct ID read
{
tone(PiezoPin, 800, 1000);
door_open();
delay(1000);
door_close();
clearBuffer();
}
}
if (!digitalRead(ToggleButtonPin)) //Red button pressed to unlock
{
delay(5);
if (!digitalRead(ToggleButtonPin)) //Red button pressed to unlock (debounce)
{
door_open();
digitalWrite(ToggleLedPin, 1);
while (digitalRead(ToggleButtonPin)) {
//wait till pressed
}
door_close();
digitalWrite(ToggleLedPin, 0);
}
}
if (!digitalRead(ExitButtonPin)) //Green button pressed to exit
{
delay(5);
if (!digitalRead(ExitButtonPin)) //Green button pressed to exit (debounce)
{
door_open();
delay(1000);
door_close();
}
}
}

The ReadSerial function is reused directly from Kev_MacD's Instructable linked above. It basically just retrieves the 10-digit RFID tag number and writes it to a global variable for use in loop.

void ReadSerial(String &ReadTagString) {
int bytesread = 0;
int val = 0;
char code[10];
String TagCode = "";

if (RFIDReader.available() > 0) { // If data available from reader
if ((val = RFIDReader.read()) == 10) { // Check for header
bytesread = 0;
while (bytesread < 10) { // Read 10 digit code
if (RFIDReader.available() > 0) {
val = RFIDReader.read();
if ((val == 10) || (val == 13)) { // If header or stop bytes before the 10 digit reading
break; // Stop reading
}
code[bytesread] = val; // Add the digit
bytesread++; // Ready to read next digit
}
}
if (bytesread == 10) { // If 10 digit read is complete

for (int x = 0; x < 10; x++) //Copy the Chars to a String
{
TagCode += code[x];
}
ReadTagString = TagCode; //Update the caller
while (RFIDReader.available() > 0) //Burn off any characters still in the buffer
{
RFIDReader.read();
}
}
bytesread = 0;
TagCode = "";
}
}
}

The clearBuffer function gets rid of the tag number after it reads the tag so as to not scan multiple times in a row.

void clearBuffer() {
while (RFIDReader.available() > 0) {
RFIDReader.read();
}
}

The motor function controls the logic to the two relay inputs.

void motor(bool run, bool dir) { //control motor output pins
if (!run) {
digitalWrite(Relay1Pin, LOW); // motor off
digitalWrite(Relay2Pin, LOW);
} else {
if (dir) {
digitalWrite(Relay1Pin, LOW); // motor on CW
digitalWrite(Relay2Pin, HIGH);
} else {
digitalWrite(Relay1Pin, HIGH); // motor on CCW
digitalWrite(Relay2Pin, LOW);
}
}
}

Finally, the door_open and door_close functions use the limit switches to perform the opening and closing operation.

void door_open() {
motor(true, true);
while (digitalRead(Limit2Pin)) {
//wait until limit hit
}
motor(false, false);
}

void door_close() {
motor(true, false);
while (digitalRead(Limit1Pin)) {
//wait until limit hit
}
motor(false, false);
}



The full code is attached here as well.

Assembly

PXL_20250216_150742966.jpg
Screenshot 2026-03-13 113552.png
PXL_20250216_150625954.jpg
PXL_20251125_193135508.jpg
PXL_20260304_200538068.jpg
PXL_20260304_200544394.jpg
PXL_20260304_200507447.jpg
PXL_20260304_195713154.jpg
PXL_20260304_195707186.jpg
PXL_20260304_195426467.jpg

For convenience, I used an Arduino shield as a breakout board for organizing circuitry to my peripherals. Everything can be wired as shown in the schematic above. The connector on my motor had four wires: two thicker and two thinner. Use the two thicker wires as the thinner ones are for an encoder or feedback, which we are not using. Be sure you are correctly identifying the proper connections to normally open, com, and normally closed pins of the switches and relays. Also, don't forget to wire up the RFID module, which is on the back of the box.

I have made a diagram showing the connections on the Arduino shield made to each of the peripheral connectors. the exact layout on the perf board is not critical as long as you wire correctly underneath.

Gradually test the unit along the way. If your motor is turning the wrong direction, simply swap the leads at the relay breakout board. Your limit switches may also be swapped. Use the "hold" button to toggle the operation of the motor before you attach the rope to the door handle for testing.

Finally, add the screws in the spool that act as stops and tie the rope to the spool. It may take a couple tries to get it just right. You don't want the rope to be too tight as it may rip the unit right off the door. However, if it is too loose, it may not pull the handle far enough to unlatch the door.

I also added a small shim in the side of the door for stability. Nobody will ever notice that tiny screw hole, right???

Adding an RFID Key

Now that the unit is installed, it is time to add RFID functionality.

It is likely that you do not know the RFID tag number associated with the card or fob you are using. It would be rather insecure to simply print the number right on the key. However, the Arduino code above writes every scan to its hardware serial port.

Therefore, to determine your RFID number, connect your computer to the Arduino via USB. Open the serial monitor in Arduino IDE (or other serial port software) and set the baud to 9600. Upon device reset, you should receive the message "Hello world!" Then, scan your RFID tag and observe the result printed to the serial monitor. Record this number and substitute it into the #define in the code and re-upload to the Arduino. Then verify that your RFID tag unlocks the door!

Project Complete (Almost)

PXL_20260304_201031499.TS.gif
PXL_20260304_201116326.jpg

At this point I thought I was done. Unfortunately, there were a couple bugs in the system (as with any engineering project).

  1. Not all RFID tags are created equal. Many newer RFID cards contain extra security features that do not work with this specific RFID reader. My dad's company ID card has RFID for building access but is not recognized by my door opener. Thus, he carries another card for the door opener. Not much I can do about that.
  2. I had issues with the RFID reader sensing through the door properly in the final assembly. The reader worked fine when it was not in the case. I decided this must be due to the large motor sitting directly behind the sensor. The bug hunk of metal must interfere with the signals. Therefore, I separated the RFID module from the main unit, and it works fine (although it doesn't look as nice)...

Fixing the RFID Location

PXL_20260310_184052240.jpg
PXL_20260312_162731593.jpg

Although it is still a bit of a hack, I attempted to at least make a cover for the RFID and mount it as a "sidecar" to the main unit. I did not want to have to print the whole case again as well. The STL attached here has the new cover included.

Project Complete

PXL_20260310_184138734.TS.gif

Congratulations on your new door-unlocking assistant that optimizes door entry for speed! I learned a lot in developing this project, especially about RFID technology and its limitations.

Hopefully you learned something in this Instructable and are now prepared to create your own D'Opener. Be ready to flex on the poor saps still using keys to open their doors!