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

Arduino Mega 2560 Controlled Security System with RFID, Ultrasonic Sensor, and Camera

Image of Arduino Mega 2560 Controlled Security System with RFID, Ultrasonic Sensor, and Camera

Circuit Documentation

Summary

The circuit is designed to interface various components with an Arduino Mega 2560 microcontroller. The components include a 12V Solenoid Lock, RFID-RC522 module, HC-SR04 Ultrasonic Sensor, a single-channel 12V relay, an OV7670 camera module, a 12V power supply, a ST7796 3.5" touchscreen module, and multiple buck converters for voltage regulation. The circuit is likely intended for a security or access control system, utilizing RFID for identification, a solenoid lock for physical control, and an ultrasonic sensor for distance measurement or presence detection. The touchscreen provides a user interface, while the camera module can be used for image capture. The Ethernet module suggests network connectivity for remote access or data transfer.

Component List

  • Arduino Mega 2560: A microcontroller board based on the ATmega2560, with numerous digital input/output pins, analog inputs, and a variety of power and ground pins.
  • 12V Solenoid Lock: An electromagnetic lock that operates on 12V to control access.
  • RFID-RC522: An RFID reader/writer module for contactless communication using radio frequency.
  • HC-SR04 Ultrasonic Sensor: A sensor for measuring distance via ultrasonic sound waves.
  • 12V Single Channel Relay: An electromechanical switch that allows control of a high-power circuit by a low-power signal.
  • OV7670: A camera module capable of capturing images and video.
  • 12V Power Supply: Provides a 12V power source for the components requiring higher voltage.
  • ST7796 3.5ips Module Touchscreen: A 3.5-inch touchscreen display module for user interface.
  • Buck Converters: Voltage regulators that step down the input voltage to a lower output voltage.
  • Module Ethernet W5500: A network module that provides Ethernet connectivity.

Wiring Details

Arduino Mega 2560

  • 3V3 connected to RFID-RC522 VCC (3.3V)
  • 5V connected to HC-SR04 VCC, ST7796 touchscreen VCC, and ST7796 touchscreen LED
  • GND connected to HC-SR04 GND, RFID-RC522 GND, 12V Single Channel Relay GND, and Step down Buck converter OUT - GND
  • VIN connected to Step down Buck converter OUT +
  • D21/SCL connected to ST7796 touchscreen CTP_SCL and OV7670 SCL
  • D20/SDA connected to ST7796 touchscreen CPT_SDA and OV7670 SDA
  • D4 PWM connected to HC-SR04 ECHO
  • D5 PWM connected to RFID-RC522 RST
  • D6 PWM connected to HC-SR04 TRIG
  • D7 PWM connected to 12V Single Channel Relay IN
  • D52 connected to RFID-RC522 SCK and ST7796 touchscreen SCK
  • D50 connected to RFID-RC522 MISO, ST7796 touchscreen SOI(MOSI), and ST7796 touchscreen SOO(MOSI)
  • D38 connected to ST7796 touchscreen CPT_INT
  • D36 connected to ST7796 touchscreen CTP_RST
  • D34 connected to ST7796 touchscreen LCD_CS
  • 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
  • D53 connected to RFID-RC522 SDA
  • D51 connected to RFID-RC522 MOSI
  • D37 connected to ST7796 touchscreen LCD_RS
  • D35 connected to ST7796 touchscreen LCD_RST
  • 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 12V Single Channel Relay COM
  • - connected to Arduino Mega 2560 GND

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

  • NC not connected
  • COM connected to 12V Solenoid Lock +
  • NO connected to 12V power supply +
  • IN connected to Arduino Mega 2560 D7 PWM
  • GND connected to Arduino Mega 2560 GND
  • VCC connected to 12V power supply +

OV7670

  • 3.3V connected to Buck converter OUT+
  • DGND connected to Buck converter OUT-
  • D0 to D7 connected to Arduino Mega 2560 D22 to D29 respectively
  • PLK connected to Arduino Mega 2560 D30
  • XLK connected to Arduino Mega 2560 D31
  • VS connected to Arduino Mega 2560 D32
  • HS connected to Arduino Mega 2560 D33
  • SCL connected to Arduino Mega 2560 D21/SCL
  • SDA connected to Arduino Mega 2560 D20/SDA

ST7796 3.5ips Module Touchscreen

  • VCC connected to Arduino Mega 2560 5V
  • GND connected to Arduino Mega 2560 GND
  • LCD_CS connected to Arduino Mega 2560 D34
  • LCD_RST connected to Arduino Mega 2560 D35
  • SOI(MOSI) connected to Arduino Mega 2560 D50
  • SCK connected to Arduino Mega 2560 D52
  • LED connected to Arduino Mega 2560 5V
  • SOO(MOSI) connected to Arduino Mega 2560 D50
  • CTP_SCL connected to Arduino Mega 2560 D21/SCL
  • CTP_RST connected to Arduino Mega 2560 D36
  • CPT_SDA connected to Arduino Mega 2560 D20/SDA
  • LCD_RS connected to Arduino Mega 2560 D37
  • CPT_INT connected to Arduino Mega 2560 D38

Buck Converters

  • IN+ and IN- connected to 12V power supply + and -, respectively
  • OUT+ and OUT- connected to various components requiring regulated voltage

12V Power Supply

  • + connected to 12V Single Channel Relay NO, VCC, Buck converter IN+, and Step down Buck converter IN +
  • - connected to Buck converter IN-, and Step down Buck converter IN - GND

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 content provided for documentation.txt)

This concludes the documentation for the provided circuit design and code.