The project describes automatic room light controller with bidirectional visitor counter with the help of Arduino Uno

Summary:

The project describes an automatic room light controller with a bidirectional visitor counter with the help of Arduino Uno

About Project

This project's Digital visitor counter relies on communicating few components likewise sensors, motors, etc. with Arduino microcontroller. 

This counter can calculate people in both directions. This circuit can be utilized to calculate the number of a person going in a home/office in the entry gate and it can calculate the number of persons leaving the hall by decreasing the count at the same gate or exit gate and it relies upon sensor placement in the hall. It can also be utilized at gates of parking areas and more public places.

This project is distributed into four parts such as sensors, controller, counter display as well as the gate. The sensor notices an interruption and gives input to the controller which would drive the counter increment or decrement depending on entering or exiting of the person. And the respective counting is displayed on a 16x2 LCD via the controller.

When any person enters the room, the IR sensor will get scattered by the object then another sensor will not operate due to we have added a delay.

Know more about the Internet of Things Solutions

        #include<LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);

#define in 14
#define out 19
#define relay 2

int count=0;

void IN()
{
    count++;
    lcd.clear();
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}

void OUT()
{
  count--;
    lcd.clear();
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}

void setup()
{
  lcd.begin(16,2);
  lcd.print("Visitor Counter");
  delay(2000);
  pinMode(in, INPUT);
  pinMode(out, INPUT);
  pinMode(relay, OUTPUT);
  lcd.clear();
  lcd.print("Person In Room:");
  lcd.setCursor(0,1);
  lcd.print(count);
}

void loop()
{  
  
  if(digitalRead(in))
  IN();
  if(digitalRead(out))
  OUT();
  
  if(count<=0)
  {
    lcd.clear();
    digitalWrite(relay, LOW);
    lcd.clear();
    lcd.print("Nobody In Room");
    lcd.setCursor(0,1);
    lcd.print("Light Is Off");
    delay(200);
  }
  
  else
    digitalWrite(relay, HIGH);
  
}
    
rasika Joshi
hIoTron offers an End-to-End IoT Training with live use cases using IoT hardware kit.

Categories