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

Arduino and ESP8266 RFID Access Control System with Servo Gate Operation

View and Edit Project In Cirkit DesignerImage of Arduino and ESP8266 RFID Access Control System with Servo Gate Operation

Circuit Documentation

Summary

The circuit in question appears to be a security or access control system utilizing RFID technology for identification and authorization. It includes two Arduino UNO microcontrollers, two EM-18 RFID reader modules, two buzzers, two red LEDs, two green LEDs, two servo motors, and an ESP8266 NodeMCU module. The system is designed to read RFID tags, verify if they are authorized, and then control gates (represented by servo motors) and signal with LEDs and buzzers based on the tag's authorization status.

Component List

Microcontrollers

RFID Reader Modules

Actuators

Indicators

Wiring Details

Arduino UNO

EM-18 RFID Reader Module

Buzzer

LED: Two Pin (red)

LED: Two Pin (green)

Servo

ESP8266 NodeMCU

Documented Code

Arduino UNO Code (Instance 1)

#include <SoftwareSerial.h>
#include <Servo.h>  // Include Servo library

#define EM18_TX_PIN 2  // Connect to the TX pin of the EM18 RFID reader
SoftwareSerial rfidReader(EM18_TX_PIN, -1);  // EM18 RFID reader (TX only)

// Servo motor setup
Servo gate_1Servo;
Servo gate_2Servo;  

// Struct to hold entry information for each tag
struct TagEntry {
  String tagValue;
  unsigned long entryTime;
  bool entryActive;
};
TagEntry tagEntries[10];  // Array to store entries for up to 10 tags
int currentTagCount = 0;  // Current number of tags stored

const unsigned long MIN_TIME_GAP = 10000;  // Minimum time gap in milliseconds

// List of authorized tags
String authorizedTags[] = {"4D008C7710A6", "4D0089D37166", "4D0089DAF9E7", "4D0089D66072", "4D0089051706"};
int numAuthorizedTags = 5;  // Number of authorized tags

int gate_1Servopin = 4;  // Pin to control the servo motor
int gate_2Servopin = 12;  // Pin to control the servo motor
int led1 = 6;
int led2 = 8;
int buz = 10;

// Setup function
void setup() {
  // ... (initialization code)
}

// Main loop function
void loop() {
  // ... (main loop code)
}

// Additional functions
// ... (helper functions such as readRFID, isAuthorized, etc.)

Arduino UNO Code (Instance 2)

The code for the second instance of the Arduino UNO is identical to the first instance and is therefore not repeated here for brevity.

ESP8266 NodeMCU Code

The code for the ESP8266 NodeMCU is not provided in the input. If it is required, it should be documented similarly to the Arduino UNO code, with appropriate setup and loop functions, and any additional helper functions.


This documentation provides an overview of the circuit, including a description of each component, wiring details, and the embedded code for the microcontrollers. The code is structured to include initialization in the setup() function, the main logic in the loop() function, and additional helper functions for tasks such as reading RFID tags, checking authorization, and controlling gates.