User Tools

Site Tools


DIY RFID system for access control

The idea is to build a simple RFID system to control the main door lock and the laser cutter for EB members/staff.


Server side exinting code for authentication (in php):

Server side proposal:

  • Django 2.1 + Python3 server backend
  • Bootstrap4 web UI
  • SQLite (or MariaDB)
    • resource = laser_cutter, main_door, lab_door etc
    • action = on, off (open, close)
    • pin = rfid ID
  • HTTP status codes:
    • A HTTP status of 405 will get sent if you have the wrong pin number.
    • A HTTP status of 406 will get sent if you have an invalid pin (ie: no pin provided)
    • A normal HTTP status of 200 will return if the pin is correct and the door has been triggered.
    • A HTTP status of 407 will get send if you have just been banned (ie: too many incorrect attempts)


  • SENS-26 MFRC522 NFC/RFID Controller Breakout Board
  • Arduino nano + Ethernet shield
  • Raspberry Pi 3
  • Ethernet hub/switch
  • Linux server (Raspberry Pi or similar)
  • Relays
  • Electronic door lock (ask Greg about those from aliexpress…)

UPDATE 14/02/2019

After many issues dealing with MFRC522 we moved to PN532. This one worked with an Arduino Nano without the Ethernet Shield. Once we connect the Ethernet shield it won't work via SPI. And via i2c it becomes very unstable. So we tried with a Raspberry Pi models 1 and 2. Didn't work either. Tried SPI, i2c and UART.

Finally we got the PN532 working with a Raspberry Pi 3 via i2c. So far it's been consistent. Here is a short documentation to get it working and integrated with Python3:

  1. Follow the instructions here on how to build&install the NFC library:
  2. git clone (use this one since I merged important PRs)
  3. sudo apt install python3-setuptools
  4. cd py532lib; sudo python3 install
rfid_access_system_door_lock_and_laser_cutter.txt · Last modified: 2019/02/14 10:55 by Tiago