An ESP32-based RFID access control system using the PN532 NFC reader with LCD display output and FPGA integration.
- RFID/NFC Card Reading: Uses Adafruit PN532 reader (I2C interface)
- LCD Display: 16x2 character LCD for status feedback
- WiFi Connectivity: Network support for cloud integration
- FPGA Communication: Serial communication with external FPGA for access control logic
- Firebase Support: Ready for Firebase Realtime Database integration (currently commented out)
- ESP32 Development Board
- Adafruit PN532 NFC/RFID Reader Module
- 16x2 LCD Display (HD44780 compatible)
- External FPGA (for access control validation)
- Connecting wires and breadboard
- PlatformIO - Primary build system
- PlatformIO Core (CLI) or PlatformIO IDE (VS Code extension)
The following libraries are automatically installed via PlatformIO:
espressif32platformarduinoframeworkArduino_MFRC522v2(v2.0.1)Firebase Arduino Client Library for ESP8266 and ESP32(v4.4.17)LiquidCrystal(v1.0.7)Adafruit PN532(v1.3.4)
Via VS Code:
# Install VS Code, then install the PlatformIO IDE extensionVia CLI:
pip install platformiogit clone https://github.com/joe3925/ESP32-RFID.git
cd ESP32-RFIDCreate an include/env.hpp file with your WiFi and Firebase credentials (if using Firebase):
#ifndef ENV_HPP
#define ENV_HPP
#define WIFI_SSID "your_ssid"
#define WIFI_PASSWORD "your_password"
// Firebase (optional)
#define API_KEY_REAL "your_firebase_api_key"
#define DATABASE_URL_REAL "your_database_url"
#define EMAIL "your_email"
#define PASSWORD "your_password"
#endifRefer to include/const.hpp for pin definitions. Key connections:
- PN532 NFC: I2C (SDA/SCL) + IRQ pin
- LCD: Standard 4-bit mode connections
- FPGA: Serial2 (RX/TX)
General --> Build --> Upload and Monitor --> Check Serial Monitor For Inputs
- Power on the ESP32
- Wait for "Ready" message on LCD
- Present an RFID/NFC card to the PN532 reader
- System validates card via FPGA and displays "Approved!" or "Not auth"
ESP32-RFID/
├── include/ # Header files
├── src/ # Source files
│ ├── main. cpp # Main application logic
│ ├── fpga.cpp # FPGA communication
│ ├── wifi.cpp # WiFi management
│ └── util.cpp # Utility functions
├── platformio.ini # PlatformIO configuration
└── README.md # This file