Visitor Counter Using Arduino | Bidirectional

Here we make Bidirectional Visitor Counter using Arduino and IR sensor. You can also make automatic room light controller with visitor counter using Arduino.

In this blog, I will show you how to make your own visitor counter using Arduino at your home with easy step by step with video tutorials.

The system counts the number of people who entered the room, and it will turn on the room light. As that person leaves the room, room light is automatically off.

This information should be presented on a 16×2 LCD display, and with the use of the Arduino, the electronic part was greatly reduced, facilitating the installation of the project in a model.

If you are the beginner of Arduino projects and looking for this type of collection of Arduino projects than click here.

Parts Need for Visitor Counter

IR Sensor (Infrared Sensor)

You can see the basic hardware structure of the IR Sensor below.

IR Sensor Configuration for visitor counter using arduino

This IR Sensor is consist of two LED Lights. 

  • White: Transmit the IR rays
  • Black: Receive the IR ray

IR Sensor is Digital type sensor, so Its output is high or low.

How IR Sensor Works

As we give power to IR Sensor using Arduino at that time White LED light is transmitted the IR rays. This IR ray is strike with the object, it will reflect back and received at black LED light. As this phenomenon occur IR Sensor Produce Low or High Voltage at output pins. It depends on what type of sensor you choose. 

Your Programming is depended on which type of sensor you choose. So you need to check it out.

  • Active High Sensor: Output is High
  • Active Low Sensor: Output is Low

Condition for Working IR Sensor

  1. IR Sensor doesn’t work with Black color objects, because black color is absorbed the transmitted rays fully
  2. The object must pass in the range of IR Sensor, You can adjust the intensity of IR rays by distance adjust button
  3. IR Sensor doesn’t open directly to the sun

Circuit Diagram of Visitor counter using Arduino

Here is the Circuit diagram follow it.

Circuit Diagram for Visitor counter using Arduino

Coding

#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);
}

If you are confused to make it then you can see that below video tutorial for more visualization.

You have any doubt than comment it below. I will reply your answer.

Leave a Reply