TCard is a premium RFID access control system developed as a learning project at UNIFRAN (Universidade de Franca). It combines Arduino hardware with a modern web interface to create a feature-rich door access management solution.
The system's hardware component is built around an Arduino UNO microcontroller interfaced with an MFRC522 RFID reader module. The Arduino continuously polls for RFID card presence and communicates with the server via a serial connection at 9600 baud rate.
The system implements a bidirectional serial communication protocol between the Arduino and Node.js server:
- Arduino → Server: Sends
CARD:{UID}messages when cards are scanned - Server → Arduino: Returns
GRANTEDorDENIEDaccess commands
-
Backend: A Node.js/Express server that:
- Manages serial communication with Arduino
- Implements RESTful API endpoints for user management
- Persists data in SQLite3 through structured SQL queries
- Broadcasts real-time events using Socket.io
-
Frontend: A responsive single-page application using:
- Vanilla JavaScript with event-driven architecture
- CSS3 with Flexbox/Grid for responsive layouts
- WebSocket connections for real-time updates
- Local browser storage for user preferences
The SQLite database implements a structured user management system:
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
cardId TEXT UNIQUE NOT NULL,
role TEXT NOT NULL,
active INTEGER NOT NULL DEFAULT 1
);- 🎨 Elegant UI - Beautiful, responsive interface with light/dark modes
- 👤 Role-based Access - Different permissions for admins and users
- ⚡ Real-time Updates - Instant access notifications via WebSockets
- 📊 User Management - Easily add, edit and remove users
- 🔒 Security - RFID card-based authentication system
- 💻 Cross-platform - Works on any device with a web browser
| Component | Technologies |
|---|---|
| Frontend | HTML5, CSS3, JavaScript, Socket.io |
| Backend | Node.js, Express, SQLite3, Socket.io |
| Hardware | Arduino UNO, RFID-RC522 Module |
Connect the RFID-RC522 module to Arduino UNO:
| RFID-RC522 Pin | Arduino UNO Pin |
|---|---|
| SDA (SS) | 10 |
| SCK | 13 |
| MOSI | 11 |
| MISO | 12 |
| IRQ | Not connected |
| GND | GND |
| RST | 9 |
| 3.3V | 3.3V |
The Arduino sketch continuously polls for RFID cards using the MFRC522 library. When a card is detected:
- The UID is read and formatted as a hexadecimal string
- A
CARD:{UID}message is sent via serial to the server - The system waits for server response to grant/deny access
- Incoming card data is parsed from serial data buffer using string manipulation
- Card UID is validated against the database with prepared SQL statements
- Authentication result is transmitted to both:
- Arduino (for physical access control)
- Web clients (via Socket.io for real-time updates)
The server exposes a complete REST API for user management:
GET /api/users- List all usersPOST /api/users- Create new userPUT /api/users/:id- Update user detailsDELETE /api/users/:id- Remove a userGET /api/scan-card- Send a scan request to the Arduino
- Upload the sketch to your Arduino:
arduino/rfid_access_control/rfid_access_control.ino
-
Install dependencies:
cd server npm install -
Start the server:
npm start
-
Access the web interface:
http://localhost:3000
- Scan your RFID card to request access
- View your profile and access history
- Manage users (add, edit, deactivate, delete)
- Monitor access logs in real-time
- Configure system settings
This project was developed as part of the curriculum at UNIFRAN (Universidade de Franca) to demonstrate the integration of hardware and software technologies. It serves as a learning tool for:
- Full-stack web development
- IoT and hardware integration
- User interface design
- Database management
- Real-time communications
This project is licensed under the Creative Commons CC BY-NC-ND License.
Developed with ❤️ as a learning project at UNIFRAN
