Project showcase
Automatic Room Light Controller with Bidirectional Visitor

Automatic Room Light Controller with Bidirectional Visitor © Apache-2.0

When at least one person enters the room, the light and fan turn ON. When everyone exits the room, the light turns OFF.

  • 4,235 views
  • 3 comments
  • 9 respects

Components and supplies

Apps and online services

About this project

The project of “Digital visitor counter” is based on the interfacing of some components such as sensors, motors etc. with Arduino microcontroller. This counter can count people in both directions. This circuit can be used to count the number of persons entering a hall/mall/home/office in the entrance gate and it can count the number of persons leaving the hall by decrementing the count at the same gate or an exit gate, and that depends upon sensor placement in the mall/hall. It can also be used at gates of parking areas and other public places.

This project is divided into four parts: sensors, controller, counter display and gate. The sensor would observe an interruption and provide an input to the controller which would run the counter increment or decrement depending on the entering or exiting of people. And counting is displayed on a 16x2 LCD through the controller.

Code

Source codeArduino
#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++;
    if(count>=10)
    {
      count=10;
      }
    lcd.clear();
    lcd.print("Person In Room:");
    lcd.setCursor(0,1);
    lcd.print(count);
    delay(1000);
}
void OUT()
{
    count--;
    if(count<=0)
    {
      count=0;
      }
    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);
  
}

Custom parts and enclosures

Circuit Digram
Visitor counter circuit1 afke0tbxua

Comments

Similar projects you might like

RFID Based Automatic Door System

Project showcase by Robodia Technology

  • 35,760 views
  • 20 comments
  • 97 respects

DHT22 Applied To Automatic Irrigation

Project showcase by CristianColweb

  • 2,254 views
  • 3 comments
  • 11 respects

Automatic Fan Control System

Project tutorial by Muhammad Sheraz

  • 2,943 views
  • 0 comments
  • 3 respects

Get notified via Mobile, when your room light turned ON!

Project showcase by Nabeeh Talaat

  • 2,883 views
  • 1 comment
  • 9 respects

Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

  • 24,826 views
  • 17 comments
  • 75 respects

Smart Garden

Project showcase by patel Dipen

  • 22,279 views
  • 15 comments
  • 59 respects
Add projectSign up / Login