DIY electronic RFID Door Lock with Battery Backup

DIY electronic RFID Door Lock

it surely does not.
Your door can be opened within a few seconds and you don't even notice that someone has entered while you were not at home, because there is no damage, neither at the door nor at the lock. Also your neighbours will not hear anything because lockpicking is absolutely silent.
As you have seen: Lockpicking is very easy.
A thief does not even need special tools. He can open your lock with two hairpins!
When you search for “lockpicking” on Youtube you will find 169.000 results.

With electrical vibrators (pick gun) it takes less than 10 seconds to open a lock as you see in this video.

Even for cross locks there are special lockpicking tools that open a lock in 10 seconds as you see in this video.

Better mechanical locks

There are better locks where the key has round holes instead of notches like this KESO 2000 key.

These locks are very expensive. Nevertheless they can also be opened by lockpicking, although it may takes 3 minutes to open them as you see in this video.

Finally locks can be broken with a big plier or opened with a drill as you see in this video.

Conclusion: You will not find a mechanical lock that is really safe.

Copying of keys

If you rent a flat, your tenant can make copies of the key and give them to other persons. So he can sublease your flat.
And if he leaves some day and you want to rent the flat anew, you have to change the lock because otherwise the previous tenant can still access the flat.

Electronic door locks

The advantage of an electronic door lock is that the above security issues do not apply.
It is much better to have a safe door lock which prevents that the thief can enter than to have an alarm system which makes noise when the thief is already in. Until the police arrives he will be gone and probably some precious things will be missing. Secure locks are always better than alarm systems or cameras.

What are the options on the market?
I searched for an electronic alternative, but what I found did not satisfy me:

  • There are fingerprint readers, but I did not find a waterproof one, so not usefull for outdoor installation. Additionally you expose an electronic device to the street which a malicious person might destroy easily.
  • There are these electronic door locks that you probably have seen in hotels, that open the door with a card.
    But these are for indoor installation only and they depend on a tiny battery in the lock that soon will expire.
  • None of the electronic solutions that I found will work when you have a power failure because they all lack a powerfull backup battery. A lock that does not open in case of a power failure is useless.
  • Mostly the electronic solutions are much too expensive.

My project

So I designed my own solution with the following characteristics:

  1. Designed for the main door of the building: No electronic device is exposed to the street or to the rain. You just mount an RFID reader on the inside of the door which reads the RFID card through the closed door.
  2. There is nothing visible from the outside of the door that could be manipulated by an intruder.
  3. A powerfull backup battery assures that the device is working even after a power failure of several days.
  4. The microprocessor manages charging the battery.
  5. Provides a very easy to use interface accessible through an USB cable with a terminal program which lets you add or remove users within a few seconds. Even a computer beginner can manage the user authorization quickly.
  6. You can store 64 users with their card ID's in the EEPROM of the microprocessor. More then 64 users are possible by modifying the source code.
  7. The access to the terminal interface can be protected with a password.
  8. If you or your tenant loses the RFID card or token, you can easily remove the old one and add the new one without changing the lock.
  9. I designed a layout for the board that can be soldered by an electronics beginner.
  10. The entire solution is cheap compared with commercial solutions.
  11. The entire project has been designed and tested by a very experienced hardware and software engineer.

RFID cards and tokens

What will replace your mechanic key?
You can either chose an RFID card or a token like these:


The tokens are more robust than the cards. The cards are sensible to bending and the antenna inside may break after a few months carrying them in your pocket.

Each RFID card or token has a unique ID number, which is assigned by the factory and which cannot be modified afterwards.
There are cards / tokens (e.g. Mifare Classic) that have a 4 byte ID which allows 2^32 possible ID's and there are other cards (e.g. MIFARE DesFire) which use a 7 byte ID which allows 2^56 possible ID's: far more than any mechanic key will ever have.

My project supports any 13,56 MHz cards or tokens that comply with the smartcard standards ISO 14443 A and B, or ISO 18092.
You can buy them in electronic online stores searching for “Mifare card” or “Mifare token“. The price is approx half a dollar.
More details in Wikipedia.

Maybe you already own a Mifare card, which are used in many countries for paying public transportation, parking, membership, university, health, rental, access management, etc.. If you have already such a 13MHz card you can use it with this project additionally to open your door.

In the next version my project will support DesFire EV1 cards which are much more secure.

The RFID reader

The PN532 breakout board from Adafruit (USD $40) has a chip from NXP (former Phillips).
When you order this board, it ships already with a white MIFARE card.
The board has a size of 12 cm x 5 cm and a thickness of 3 mm.
It works internally at 3,3V, but can be fed with 5V.

This board does not only read Mifare cards. It reads also your biometric passport, FeliCa cards and does NFC (Near Field Communication). It also communicates with Mastercard and Visa which have RFID integrated (PayPass, PayWave, ExpressPay), Calypso and many more…

The antenna is printed on the board.
Adafruit says that the antenna detects a card from a distance of up to 10 cm.
This is true for the white Mifare card that ships with the board.
But I have another card (from public transportation) that requires 7,5 cm to be detected.
And I have a token that requires 5,5 cm to be detected. (The antenna in the token is smaller than the antenna in a card)
So it finally depends on the thickness of your door which of them serves for you.

You mount the breakout board on the inside of your door.
You can mount a plastic or wooden box on top of it to protect it from mechanical damage.
Into that box you also mount a two-color LED (red / green) that always shows if the system is working properly.

For more detail: DIY electronic RFID Door Lock with Battery Backup

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
Scroll to Top