Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino and ESP8266 RFID Door Lock System with WiFi Connectivity

View and Edit Project In Cirkit DesignerImage of Arduino and ESP8266 RFID Door Lock System with WiFi Connectivity

Circuit Documentation

Summary

The circuit in question is designed to integrate an Arduino UNO with an RFID-RC522 module, an ESP8266 ESP-12E WiFi module, a KY-019 Relay module, and a 12V solenoid lock, all powered by a 12V battery. The Arduino UNO serves as the central controller, interfacing with the RFID module for card reading capabilities and communicating with the ESP8266 for potential WiFi connectivity. The relay module is used to control the solenoid lock, which acts as an actuator in response to signals from the Arduino.

Component List

Arduino UNO

RFID-RC522

KY-019 Relay module 1 channel

12V solenoid lock

ESP8266 ESP-12E WiFi Module

Battery 12V

Wiring Details

Arduino UNO

RFID-RC522

KY-019 Relay module 1 channel

12V solenoid lock

ESP8266 ESP-12E WiFi Module

Battery 12V

Documented Code

Arduino UNO Code (sketch.ino)

#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10

MFRC522 mfrc522(SS_PIN);

void setup() {
  SPI.begin();
  mfrc522.PCD_Init();
  Serial.begin(9600);
}

void loop() {
  if (mfrc522.PICC_IsNewCardPresent()) {
    if (mfrc522.PICC_ReadCardSerial()) {
      Serial.print("UID:");
      for (byte i = 0; i < mfrc522.uid.size; i++) {
        Serial.print(mfrc522.uid.uidByte[i], HEX);
      }
      Serial.println();
    }
  }
  delay(500);
}

This code initializes the RFID-RC522 module and continuously checks for new RFID cards. When a card is detected, it reads the UID and prints it to the serial monitor. The SS_PIN is defined as pin 10, which corresponds to the SDA pin on the RFID-RC522 module. The SPI library is used for communication between the Arduino UNO and the RFID module.