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

Arduino and NodeMCU Based RFID Smart Attendance System with WiFi Connectivity

View and Edit Project In Cirkit DesignerImage of Arduino and NodeMCU Based RFID Smart Attendance System with WiFi Connectivity

Circuit Documentation

Summary

The circuit is designed to create an RFID-based smart attendance system. It integrates various components including an RFID reader, a servo motor, an LCD screen, a real-time clock (RTC), and a microcontroller with WiFi connectivity. The system reads RFID tags, displays attendance information on the LCD, and sends data to an online server. The Arduino UNO serves as the primary controller, interfaced with the NodeMCU V3 ESP8266 for network connectivity.

Component List

Electrolytic Capacitor

7805 Voltage Regulator

NodeMCU V3 ESP8266

RFID-RC522

Tantalum Capacitor

Servomotor MG995

LCD screen 16x2 I2C

DS3231 RTC

Arduino UNO

Wiring Details

Electrolytic Capacitor

7805 Voltage Regulator

NodeMCU V3 ESP8266

RFID-RC522

Tantalum Capacitor

Servomotor MG995

LCD screen 16x2 I2C

DS3231 RTC

Arduino UNO

Documented Code

/*
 * RFID Based Smart Attendance System
 * This code interfaces with an RFID reader, a servo motor, an LCD screen, and
 * connects to a WiFi network to send attendance data to an online database.
 * Components:
 * - RFID-RC522 connected to Arduino UNO
 * - Servo motor connected to Arduino UNO
 * - LCD screen 16x2 I2C connected to Arduino UNO
 * - DS3231 RTC connected to Arduino UNO
 * - NodeMCU V3 ESP8266 for WiFi connectivity
 */

#include <SPI.h>
#include <MFRC522.h>
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

// RFID
#define SS_PIN 10
#define RST_PIN 9
MFRC522 rfid(SS_PIN, RST_PIN);

// Servo
Servo myServo;

// LCD
LiquidCrystal_I2C lcd(0x27, 16, 2);

// WiFi credentials
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

// Server
const char* serverName = "http://yourserver.com/attendance.php";

void setup() {
  Serial.begin(9600);
  SPI.begin();
  rfid.PCD_Init();
  
  // Servo setup
  myServo.attach(4);
  myServo.write(0);  // Initial position

  // LCD setup
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("RFID Attendance");

  // Connect to WiFi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  Serial.println("Connected to WiFi");
}

void loop() {
  // Look for new cards
  if (!rfid.PICC_IsNewCardPresent() || !rfid.PICC_ReadCardSerial()) {
    return;
  }

  // Show UID on serial monitor
  Serial.print("UID tag: ");
  String content = "";
  for (byte i = 0; i < rfid.uid.size; i++) {
    content.concat(String(rfid.uid.uidByte[i] < 0x10 ? "0" : ""));
    content.concat(String(rfid.uid.uidByte[i], HEX));
  }
  content.toUpperCase();
  Serial.println(content);

  // Send UID to the server
  sendUIDToServer(content);

  // Display on LCD
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("ID: ");
  lcd.print(content);

  // Simulate attendance by moving the servo
  myServo.write(90);
  delay(1000);
  myServo.write(0);

  delay(3000);
}

void sendUIDToServer(String uid) {
  if (WiFi.status() == WL_CONNECTED) {
    HTTPClient http;
    String serverPath = serverName + "?id=" + uid;

    http.begin(serverPath.c_str());
    int httpResponseCode = http.GET();
    if (httpResponseCode > 0) {
      String payload = http.getString();
      Serial.println(payload);
    } else {
      Serial.print("Error on sending POST: ");
      Serial.println(httpResponseCode);
    }
    http.end();
  }
}

This code is designed to be uploaded to an Arduino UNO microcontroller. It initializes the RFID reader, servo motor, LCD screen, and WiFi module, and contains the main loop that reads RFID tags, moves the servo, displays information on the LCD, and sends data to a server.