Hardware Setup
This section describes the hardware components required for the NFC Access Control System and provides detailed wiring instructions.
Required Components
Core Components
Arduino Nano (ATmega328P)
Microcontroller board based on ATmega328P
Operating Voltage: 5V
Digital I/O Pins: 14
Analog Input Pins: 8
PN532 NFC Module
NFC/RFID controller
Operating frequency: 13.56 MHz
Communication: SPI mode (with IRQ support)
Support for Mifare Classic, Mifare Ultralight, NTAG
16x2 LCD Display
Alphanumeric LCD with 16 columns and 2 rows
HD44780 compatible controller
4-bit parallel interface mode
Backlight: LED (optional)
Push Buttons (4 pieces)
Momentary tactile switches
Used for: UP, DOWN, SELECT, BACK navigation
Relay Module
5V single-channel relay
Used to control door lock or strike
Supports both NO and NC configurations
Additional Components
Breadboard or custom PCB
Jumper wires (male-to-male, male-to-female)
10kΩ resistors (4 pieces) for button pull-downs
220Ω resistor for LCD backlight (if needed)
10kΩ potentiometer for LCD contrast adjustment
5V power supply (capable of 500mA minimum)
Pin Configuration
PN532 NFC Module (SPI Mode)
Connect the PN532 module to the Arduino Nano as follows:
PN532 Pin |
Arduino Pin |
Description |
|---|---|---|
VCC |
5V |
Power supply |
GND |
GND |
Ground |
SCK |
D13 |
SPI Clock |
MISO |
D12 |
SPI Master In Slave Out |
MOSI |
D11 |
SPI Master Out Slave In |
SS |
D10 |
SPI Chip Select |
IRQ |
D2 |
Interrupt Request |
RST |
D3 |
Reset |
Important: Ensure the PN532 module is configured for SPI mode by setting the appropriate DIP switches or solder jumpers on the module.
LCD Display (4-bit Parallel)
LCD Pin |
Arduino Pin |
Description |
|---|---|---|
VSS |
GND |
Ground |
VDD |
5V |
Power supply |
V0 |
POT |
Contrast (connect to potentiometer) |
RS |
D4 |
Register Select |
RW |
GND |
Read/Write (tied to ground for write-only) |
E |
D5 |
Enable |
D4 |
D6 |
Data bit 4 |
D5 |
D7 |
Data bit 5 |
D6 |
D8 |
Data bit 6 |
D7 |
D9 |
Data bit 7 |
A |
5V |
Backlight anode (via 220Ω resistor) |
K |
GND |
Backlight cathode |
Relay Module
Relay Pin |
Arduino Pin |
Description |
|---|---|---|
VCC |
5V |
Power supply |
GND |
GND |
Ground |
IN |
A4 |
Control signal |
Wiring Diagram
Hardware Connection Diagram
Note
A complete wiring diagram in Fritzing format is available in the
hardware/ directory of the project repository.
Power Considerations
The complete system draws approximately 200mA under normal operation
Peak current during relay activation can reach 300mA
Use a stable 5V power supply rated for at least 500mA
If using USB power, ensure your USB port can supply sufficient current
For production use, consider an external 5V power adapter
Assembly Tips
Test Components Individually: Before final assembly, test each component separately to ensure they work correctly.
Use a Breadboard First: Prototype on a breadboard before creating a permanent solution.
Check Connections: Double-check all wiring before applying power, especially power and ground connections.
PN532 Mode Configuration: Verify the PN532 is in SPI mode before connecting.
LCD Contrast: Adjust the contrast potentiometer so LCD text is clearly visible.
Button Debouncing: The software includes debouncing, but clean button contacts improve reliability.
Troubleshooting Hardware Issues
LCD Not Displaying
Check power connections (VDD and GND)
Adjust contrast potentiometer
Verify data pin connections (D4-D7)
Check RS and E pin connections
PN532 Not Detected
Verify PN532 is in SPI mode
Check SPI connections (SCK, MISO, MOSI, SS)
Ensure power supply is adequate
Try resetting the module (RST pin)
Relay Not Activating
Check relay control pin connection
Verify relay power supply
Test relay module independently
Check if relay is configured correctly (NO vs NC)