VISITOR COUNTER WITH AUTOMATIC LIGHTING

Introduction

In this project “Visitor Counter With Automatic Lighting“, we’ll combine the functionality of an Arduino microcontroller, a 16*2 LCD display, and an IR sensor to create a visitor counter system with automatic lighting. The system will count the number of visitors passing through a specific area while automatically illuminating the room using LEDs if there is at least 1 person in the room.

Bill Of Materials

SNCOMPONENTS NAMEQUANTITYALIEXPRESS LINKAMAZON LINK
1Arduino Nano1ALI-EXPRESS BUYAMAZON BUY
3LED'SSomeALI-EXPRESS BUYAMAZON BUY
4LCD Display 16*21ALI-EXPRESS BUYAMAZON BUY
5IR sensors2ALI-EXPRESS BUYAMAZON BUY
6Connecting WiresSomeALI-EXPRESS BUYAMAZON BUY
7Bread Board 1ALI-EXPRESS BUYAMAZON BUY

Block Diagram

Here’s an explanation of the block diagram for the Visitor Counter with Automatic Lighting system using Arduino, a 16*2 LCD, and an IR sensor:

  • The IR sensor detects the presence of visitors passing by.
  • Upon detection, the Arduino increments the visitor count and updates the LCD display to reflect the new count.
  • Simultaneously, the Arduino triggers the relay module to activate the lighting source providing illumination in the area.
  • After a brief delay, the system is ready to detect the next visitor, ensuring accurate counting and efficient lighting control.

PCB Manufacturer

PCBWAY is a highly skilled company specializing in PCB manufacturing. They offer their services at incredibly low prices, such as providing 10 PCBs for only $5. Additionally, new members receive a $5 bonus. The website allows customers to upload their Gerber Files and place orders.

ORDER LINK

PCBWAY is known for producing PCBs of exceptional quality and maintaining high standards, which is why many people trust them for their PCB and PCBA

Below are some of my PCB’S manufactured by PCBWAY and I am fully satisfied by their Quality of service they provide

Circuit Diagram

Here’s the circuit diagram for your project:

  • The IR sensor modules are connected to analog pins A3 and A2 of the Arduino for their data pins.
  • The LCD display is connected to the I2C pins of the Arduino (SDA to A4, SCL to A5).
  • The LED is connected to digital pin 12 (D12) through a resistor to limit the current.

Program or Source Code

int count = 0;
float t1, t2, tf;
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
  // put your setup code here, to run once:
  pinMode(2, INPUT);
  pinMode(3, INPUT);
  pinMode(12, OUTPUT);
  Serial.begin(9600);
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Automatic Light ");
  lcd.setCursor(0, 1);
  lcd.print("& visitorCounter");
  delay(2000);
  lcd.clear();

}

void loop() {
  // put your main code here, to run repeatedly:

  if (digitalRead(2) == 1)
  {
    t1 = millis() / 1000;
    delay(50);
  }
  if (digitalRead(3) == 1)
  {
    t2 = millis() / 1000;
    delay(50);
  }

  // Serial.print(t1);
  // Serial.print(",");
  //Serial.println(t2);

  if ((t1 == 0) && (t2 == 0))
  {
    Serial.print("");
  }
  else
  {
    tf = t1 - t2;
    if (tf > 0)
    {
      Serial.println("person out");
      lcd.setCursor(0, 0);
      lcd.print("person out");
      count--;
      if(count<=0)
      {
        count=0;
      }
      Serial.print("count:");
      Serial.println(count);
      lcd.setCursor(0, 1);
      lcd.print("count:");
      lcd.print(count);
      if (count < 10)
      {
        lcd.setCursor(7, 1);
        lcd.print(" ");
      }
    }
    else if (tf < 0)
    {
      Serial.println("person in");
      lcd.setCursor(0, 0);
      lcd.print("person in ");
      count++;
      Serial.print("count:");
      Serial.println(count);
      lcd.setCursor(0, 1);
      lcd.print("count:");
      lcd.print(count);
      if (count < 10)
      {
        lcd.setCursor(7, 1);
        lcd.print(" ");
      }
    }
    delay(1000);

  }
  t1 = 0;
  t2 = 0;

  if (count != 0)
  {
    digitalWrite(12, HIGH);

  }
  else
  {
    digitalWrite(12, LOW);

  }


}

Connection Diagram

Manufacturing Files

Order Directly from PCB WAY

I have already uploaded all these required manufacturing files in PCBWAY website. You can easily go to the below link and place you order, and get your Own  Home Automation PCB manufactured from one of the best pcb manufacturer PCBWAY

ORDER NOW…….

Conclusion

In conclusion, a visitor counter with automatic lighting offers a host of benefits ranging from energy efficiency and convenience to enhanced security and data-driven insights. With careful planning, implementation, and ongoing maintenance, this system can significantly enhance the functionality and user experience of various indoor environments while promoting sustainability and efficiency.

Recommended For You

About the Author: admin

Leave a Reply

Your email address will not be published.