Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino Mega 2560-Based Access Control System with RFID, Ultrasonic Sensing, and Visual Feedback

Image of Arduino Mega 2560-Based Access Control System with RFID, Ultrasonic Sensing, and Visual Feedback

Circuit Documentation

Summary

This document provides a detailed overview of a circuit designed to interface various components with an Arduino Mega 2560 microcontroller. The circuit includes an RFID-RC522 module for RFID reading, an HC-SR04 Ultrasonic Sensor for distance measurement, an OV7670 camera module for image capture, a 12V Solenoid Lock for locking mechanisms, a 12V Single Channel Relay for controlling high power devices, and an LCD TFT screen ILI9488 HD for display purposes. The circuit is powered by a 12V power supply, and the Arduino Mega 2560 serves as the central processing unit, controlling the interactions between the components.

Component List

  • Arduino Mega 2560: A microcontroller board based on the ATmega2560, with numerous digital and analog I/O pins.
  • 12V Solenoid Lock: An electromagnetic lock that operates at 12V.
  • RFID-RC522: An RFID reader/writer module.
  • HC-SR04 Ultrasonic Sensor: A sensor for measuring distance via ultrasonic waves.
  • 12V Single Channel Relay: A relay module for controlling high voltage/current devices.
  • OV7670: A camera module capable of capturing images.
  • LCD TFT screen ILI9488 HD: A high-definition LCD screen for display purposes.
  • 12V Power Supply: A power source for the circuit, providing 12V.

Wiring Details

Arduino Mega 2560

  • 3V3 connected to RFID-RC522 VCC (3.3V)
  • 5V connected to HC-SR04 Ultrasonic Sensor VCC and LCD TFT screen ILI9488 HD VCC (3.3~5V)
  • GND connected to HC-SR04 Ultrasonic Sensor GND, RFID-RC522 GND, OV7670 DGND, and LCD TFT screen ILI9488 HD GND
  • D21/SCL connected to OV7670 SCL
  • D20/SDA connected to OV7670 SDA
  • D4 PWM connected to HC-SR04 Ultrasonic Sensor ECHO
  • D5 PWM connected to RFID-RC522 RST
  • D6 PWM connected to HC-SR04 Ultrasonic Sensor TRIG
  • D7 PWM connected to 12V Single Channel Relay IN
  • D8 PWM connected to LCD TFT screen ILI9488 HD D/C
  • D9 PWM connected to LCD TFT screen ILI9488 HD RST
  • D10 PWM connected to LCD TFT screen ILI9488 HD CS
  • D11 PWM connected to LCD TFT screen ILI9488 HD SDI(MOSI)
  • D12 PWM connected to LCD TFT screen ILI9488 HD SDO(MISO)
  • D13 PWM connected to LCD TFT screen ILI9488 HD SCK
  • D52 connected to RFID-RC522 SCK
  • D50 connected to RFID-RC522 MISO
  • D53 connected to RFID-RC522 SDA
  • D51 connected to RFID-RC522 MOSI
  • D32 connected to OV7670 VS
  • D30 connected to OV7670 PLK
  • D28 connected to OV7670 D6
  • D26 connected to OV7670 D4
  • D24 connected to OV7670 D2
  • D22 connected to OV7670 D0
  • D33 connected to OV7670 HS
  • D31 connected to OV7670 XLK
  • D29 connected to OV7670 D7
  • D27 connected to OV7670 D5
  • D25 connected to OV7670 D3
  • D23 connected to OV7670 D1

12V Solenoid Lock

  • - connected to Arduino Mega 2560 GND
  • + connected to 12V Single Channel Relay NO

RFID-RC522

  • VCC (3.3V) connected to Arduino Mega 2560 3V3
  • RST connected to Arduino Mega 2560 D5 PWM
  • GND connected to Arduino Mega 2560 GND
  • SCK connected to Arduino Mega 2560 D52
  • MISO connected to Arduino Mega 2560 D50
  • MOSI connected to Arduino Mega 2560 D51
  • SDA connected to Arduino Mega 2560 D53

HC-SR04 Ultrasonic Sensor

  • VCC connected to Arduino Mega 2560 5V
  • TRIG connected to Arduino Mega 2560 D6 PWM
  • ECHO connected to Arduino Mega 2560 D4 PWM
  • GND connected to Arduino Mega 2560 GND

12V Single Channel Relay

  • IN connected to Arduino Mega 2560 D7 PWM
  • VCC connected to 12V Power Supply +
  • GND connected to 12V Power Supply -
  • NO connected to 12V Solenoid Lock +

OV7670

  • SCL connected to Arduino Mega 2560 D21/SCL
  • SDA connected to Arduino Mega 2560 D20/SDA
  • VS connected to Arduino Mega 2560 D32
  • PLK connected to Arduino Mega 2560 D30
  • D6 connected to Arduino Mega 2560 D28
  • D4 connected to Arduino Mega 2560 D26
  • D2 connected to Arduino Mega 2560 D24
  • D0 connected to Arduino Mega 2560 D22
  • HS connected to Arduino Mega 2560 D33
  • XLK connected to Arduino Mega 2560 D31
  • D7 connected to Arduino Mega 2560 D29
  • D5 connected to Arduino Mega 2560 D27
  • D3 connected to Arduino Mega 2560 D25
  • D1 connected to Arduino Mega 2560 D23

LCD TFT screen ILI9488 HD

  • D/C connected to Arduino Mega 2560 D8 PWM
  • RST connected to Arduino Mega 2560 D9 PWM
  • CS connected to Arduino Mega 2560 D10 PWM
  • SDI(MOSI) connected to Arduino Mega 2560 D11 PWM
  • SDO(MISO) connected to Arduino Mega 2560 D12 PWM
  • SCK connected to Arduino Mega 2560 D13 PWM
  • BL connected to Arduino Mega 2560 5V
  • GND connected to Arduino Mega 2560 GND
  • VCC (3.3~5V) connected to Arduino Mega 2560 5V

Documented Code

Arduino Mega 2560

File: sketch.ino

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

File: documentation.txt

(No additional documentation provided for the code)

This concludes the documentation for the circuit. The wiring details provide a clear guide for connecting the components, and the code section provides a template for further development of the firmware to control the circuit's functionality.