A DIY RFID-based access control system for office/building security. This university project eliminates the need for physical keys by using RFID cards for employee access, providing enhanced security and access logging.
- RFID Card Authentication: Secure access using registered RFID cards
- Web Interface: Manual door control and key validation via web UI
- Real-time Logging: Track all access attempts and successful entries
- Multiple Control Methods:
- RFID card scanning
- Physical button override
- Web-based remote control
- Manual key input validation
- Database Integration: Employee and access logging with PostgreSQL/MSSQL support
- WiFi Connectivity: ESP8266-based wireless communication
- Automobile Lock Integration: Uses automobile lock drivers for door mechanism
The system consists of three main components:
- Arduino RFID Scanner: Hardware interface for card reading and door control
- ESP8266 WiFi Module: Wireless communication bridge
- Python Flask Server: Main control server and web interface
- Node.js Backend (Optional): Database management and API services
- Arduino Uno/Nano - Main microcontroller
- ESP8266 WiFi Module - Wireless communication
- MFRC522 RFID Reader - Card scanning module
- RFID Cards/Tags - Employee access cards
- Automobile Lock Driver - Door locking mechanism
- LED Indicator - Visual feedback
- Push Button - Manual override
- Breadboard & Jumper Wires - Connections
- 12V Power Supply - For lock driver
- Magnetic door holder
- Servo-controlled locks
- Electric strike plate
Arduino Uno Connections:
βββββββββββββββββββ
β Arduino β
β β
β D2 ββ LED β
β D7 ββ Button β
β D9 ββ RST β ββ MFRC522
β D10 ββ SS β ββ MFRC522
β D11 ββ MOSI β ββ MFRC522
β D12 ββ MISO β ββ MFRC522
β D13 ββ SCK β ββ MFRC522
β β
β 3.3V ββ VCC β ββ MFRC522
β GND ββ GND β ββ MFRC522
β β
β TX ββ RX β ββ ESP8266
β RX ββ TX β ββ ESP8266
βββββββββββββββββββ
ESP8266 Network Configuration:
- Static IP: 192.168.1.145
- Gateway: 192.168.1.1
- Server: 192.168.1.100:5000
- Connect components according to the wiring diagram above
- Upload the Arduino code to your Arduino board
- Configure ESP8266 with your WiFi credentials
- Connect automobile lock driver to door mechanism
# Clone the repository
git clone <your-repo-url>
cd rfid-access-system
# Run setup script
chmod +x setup.sh
./setup.sh
# Or manual installation:
pip install -r requirements.txt
# Run the Flask server
python flask_server/app.pycd node_server
npm install
npm startconst char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";String registeredCards[] = {
"46:0C:C8:0A",
"46:0C:C8:0F", // Employee Name
"YOUR_CARD_ID"
};cards = {
"46:0C:C8:0F": "gulbahar",
"26:B8:3C:1E": "mike",
"YOUR_CARD_ID": "employee_name",
}rfid-access-system/
βββ arduino_codes/
β βββ esp8266_rfid.ino # ESP8266 WiFi module code
β βββ esp8266_web.ino # ESP8266 with web interface
β βββ rfid_scanner.ino # Arduino RFID scanner code
βββ flask_server/
β βββ app.py # Main Flask application
β βββ templates/
β βββ index.html # Web control interface
βββ node_server/
β βββ src/
β β βββ constants.js # Database configuration
β β βββ sequelize.js # Database connection
β β βββ models/ # Database models
β βββ package.json
βββ requirements.txt # Python dependencies
βββ setup.sh # Installation script
βββ README.md
GET /- Server statusGET /esp/door/- ESP8266 communication endpointGET /door_action/- Remote door controlGET /ui_control/- Web control interface
GET /api/resources/- Get all resourcesGET /api/attendances/- Get attendance recordsPOST /api/resource- Add new resource
- PostgreSQL (default)
- Microsoft SQL Server
Update node_server/src/constants.js to switch database types.
- Device authentication key:
rfid_secret - Web validation key: configurable in ESP8266 code
- Network isolation: Static IP configuration
- RFID not reading: Check wiring connections and power supply
- WiFi connection failed: Verify credentials and network connectivity
- Door not opening: Check lock driver connections and power supply
- Server not responding: Ensure Flask server is running and accessible
- Monitor Arduino Serial output (9600 baud)
- Check Flask server logs
- Verify ESP8266 connection status
The system logs all access attempts including:
- Timestamp of access
- RFID card ID used
- Employee name
- Access result (granted/denied)
Access the attendance records via the Node.js API or database directly.
- Authentication: Multi-layer security with device keys and RFID validation
- Access Control: Only registered cards can open doors
- Audit Trail: Complete logging of all access attempts
- Network Security: Static IP configuration and device authentication
- Physical Override: Manual button for emergency access
- Mobile app integration
- Face recognition backup
- Real-time notifications
- Advanced reporting dashboard
- Multiple door support
- Time-based access restrictions
- Integration with existing security systems
This is a university project for educational purposes. Feel free to modify and improve upon the design.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request