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

Arduino-Based Visitor Counter and RFID Access Control System with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino-Based Visitor Counter and RFID Access Control System with LCD Display

Circuit Documentation

Summary

This circuit is designed to manage a visitor counter system using multiple IR sensors, relays, an LCD display, and an Arduino UNO. The system also includes an RFID reader for access control and a servo motor for physical actuation. The circuit is powered by a 12V battery and includes various LEDs and a buzzer for visual and auditory feedback.

Component List

  1. IR Sensor

    • Description: Infrared sensor used for detecting objects.
    • Pins: out, gnd, vcc
  2. 12V Single Channel Relay

    • Description: Relay module used for switching high voltage devices.
    • Pins: NC, COM, NO, IN, GND, VCC
  3. 16x2 I2C LCD

    • Description: LCD display for showing information.
    • Pins: GND, VCC, SDA, SCL
  4. Arduino UNO

    • Description: Microcontroller board used for controlling the circuit.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  5. 12V Battery

    • Description: Power source for the circuit.
    • Pins: -, +
  6. 12V Blue LED

    • Description: Blue LED for visual indication.
    • Pins: GND, VCC
  7. Fan

    • Description: Fan for cooling or ventilation.
    • Pins: GND, 5V
  8. RFID-RC522

    • Description: RFID reader for access control.
    • Pins: VCC (3.3V), RST, GND, IRQ, MISO, MOSI, SCK, SDA
  9. Micro Servo 9G

    • Description: Servo motor for physical actuation.
    • Pins: GND, +5V, PWM
  10. LED: Two Pin (red)

    • Description: Red LED for visual indication.
    • Pins: cathode, anode
  11. LED: Two Pin (orange)

    • Description: Orange LED for visual indication.
    • Pins: cathode, anode
  12. Buzzer

    • Description: Buzzer for auditory feedback.
    • Pins: PIN, GND

Wiring Details

IR Sensor

12V Single Channel Relay

16x2 I2C LCD

Arduino UNO

12V Battery

12V Blue LED

Fan

RFID-RC522

Micro Servo 9G

LED: Two Pin (red)

LED: Two Pin (orange)

Buzzer

Documented Code

Arduino UNO (Visitor Counter System)

#include <LiquidCrystal_I2C.h>
#include <Servo.h>  
Servo myservo;
LiquidCrystal_I2C lcd(0x27, 16,2); 
#define sensorPin1 7
#define sensorPin2 8
#define sensorPin3 9
#define sensorPin4 12
#define relay1 4
#define relay2 5
#define relay3 6
#define SERVO_PIN 3
int sensorState1 = 0;
int sensorState2 = 0;
int sensorState3 = 0;
int sensorState4 = 0;
int count=0;
int count1=0;

void setup()
{
  myservo.attach(3);
  pinMode (sensorPin1, INPUT_PULLUP);
  pinMode (sensorPin2, INPUT_PULLUP);
  pinMode (sensorPin3, INPUT_PULLUP);
  pinMode (sensorPin4, INPUT_PULLUP);
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
  pinMode(relay3, OUTPUT);
  pinMode(SERVO_PIN, OUTPUT); 
  digitalWrite(SERVO_PIN, HIGH);  
  
  lcd.begin(16,2);
  lcd.backlight();
  lcd.setCursor(4,0);
  lcd.print("COUNTER");
   lcd.setCursor(0,1);
  lcd.print("No Visitors     ");
  delay(200);
}

void loop()
{  
  sensorState1 = digitalRead(sensorPin1);
  sensorState2 = digitalRead(sensorPin2);
  sensorState3 = digitalRead(sensorPin3);
  sensorState4 = digitalRead(sensorPin4);

  if(sensorState1 == LOW){
    count++; 
    delay(500);
  }

  if(sensorState2 == LOW){
    count--; 
    delay(500);
  }
  if(sensorState3 == LOW){
    count1++; 
    delay(500);
  }

  if(sensorState4 == LOW){
    count1--; 
    delay(500);
  }
  
   if(count<=0)
  {
    digitalWrite(relay1, HIGH); 
    myservo.write(-180);
    lcd.setCursor(0,1);
    lcd.print("No visitors    ");
  }
  else if (count>0 && count<100){  
    digitalWrite(relay