This project implements an RFID-based access control system using NodeMCU (ESP8266) microcontroller, allowing you to control access to secure areas using RFID cards/tags.
- Overview
- Prerequisites
- Hardware Setup
- Web Interface
- NodeMCU - RC522 Connection
- Node.js API Setup
- Usage
- License
This project aims to provide a cost-effective and customizable solution for access control using RFID technology. It combines the power of NodeMCU with the RC522 RFID module to securely manage access to a designated area.
- Basic knowledge of Arduino programming.
- Familiarity with NodeMCU and the Arduino IDE.
- RC522 RFID module.
- Access to the Arduino IDE and a compatible USB cable for NodeMCU.
Follow these steps to set up the hardware:
- Connections: Connect the components as shown in the following Fritzing diagram:
- Assembly: Assemble the components into the access control system, ensuring proper connections and power supply.
The web interface allows you to configure authorized RFID cards/tags and view access logs. Here's a preview:
The table below shows the pin connections between NodeMCU and the RC522 RFID module:
NodeMCU | RFID-RC522 |
---|---|
D4 | SDA |
D5 | SCK |
D7 | MOSI |
D6 | MISO |
NOT CONN | IRQ |
GND | GND |
D3 | RST |
3V | 3.3V |
- Clone the repository to your local machine.
- Navigate to the "API" folder.
- Install the required npm packages by running
npm install
in the "API" folder. - Edit the "index.js" file to configure your MySQL connection.
- Create a MySQL database and two tables using the following queries:
CREATE DATABASE mydatabase;
USE mydatabase;
CREATE TABLE rifds (
id varchar(100)
);
CREATE TABLE usedata (
id varchar(100),
datetime varchar(100)
);
Start the Node.js API by running node index.js
in the "API" folder.
- Upload the Arduino code to the NodeMCU using the Arduino IDE.
- Configure the system using the web-based interface as explained above.
- Connect the RFID reader and electronic lock/gate to the NodeMCU as outlined.
- Start managing access to your secure area!
This project is licensed under the MIT License.