Skip to main content

Visitor Counter

This Arduino project will automate the lights of the room and also count the person in the rooms 

it also have self-intelligence that if there is no body in the room it will turn of the light
for example if 3 person enters the room then three person should exit also to turn the lights off

  Material needed:-
  • Arduino board
  • 2 IR sensor 
    IR sensor
  • Jumper wire
  • Chassis (optional) 

Connect the IR sensor output on pin 14&19 (I am using Arduino Mega that's why I have connected  it to 14&19 you can change it as your needs in the program)

and the connect led or Relay module on pin 2 (you can change this also as per your need)

Then upload the code 
#define in 14//defining the in sensor
#define out 19//defining the out sensor 
#define led 2//you can connect led module also
int count=0;

void IN()
    Serial.print("Person In Room:");                  //it will print 
    Serial.println(count);                            //+1 if a person enter in the room

void OUT()
    Serial.print("Person In Room:");           //it will print 
    Serial.println(count);                    //-1 if a person exit out the room
void setup()
  Serial.begin(9600);                      //start Serial moniter
  Serial.println("Visitor Counter");     //print the title of te project
  delay(2000);                          //as serial moniter starts
  pinMode(in, INPUT);                 //describe the
  pinMode(out, INPUT);               //pins 
  pinMode(led, OUTPUT);             //as OUTPUT or INPUT
  Serial.print("Person In Room:");//it will first
  Serial.println(count);         //print the 0 number of member
void loop()
  if(digitalRead(in))       //it works very
  IN();                    //simply if anybody 
  if(digitalRead(out))    //enters the room it will +1
  OUT();                 //and if anybody exit it -1
  if(count<=0)         //if there is anybody is in the room
    digitalWrite(led, LOW);//the led will light up  
  else                          //and if nobody in the room 
      digitalWrite(led, HIGH);//led will be turned off

It will look like this 

.Now use Chassis to make it look good

keep it at the door and use the automated light and visitor counter


Popular posts from this blog

TFT Game by Areeb

if you are fond of doing paint and want to make something related to that. So Here is the project for you. This Project is a Painting Software Based on TFT touchscreen
This project have Many Feature like:- Various Color Choices Can Change pensizeDifferent games layout like | i}tic-tac-toe | ii}Word Game | ii}Complete LOGO Different Pen Shape like |i}line | ii}Circle | ii}SquareHelp Button For New User 
  Material needed:- Arduino UNO(can use mega also)Arduino TFT touchScreen Sheild (buy it here)How To Make :-This Project is Very Easy to make Just You Have To Fit the TFT shield on the Arduino And Then Just upload the code  /* * Arduino TFT Paint * by Areeb-ur-Rub * FaceBook Page:- */// Don't Change These information #include<Adafruit_GFX.h>#include<MCUFRIEND_kbv.h>MCUFRIEND_kbvtft;#include<TouchScreen.h>#ifdefined(__SAM3X8E__)#undef__FlashStringHelper::F(string_literal)#defineF(string_literal)string_literal#endif// These are the pins for some typical…

diy relay module

I If you want a relay module and you are thinking that you will buy it online here is a link : relay module
but as you see it is expensive i will tell you a very cheap DIY

material needed:-

vero board/prototyping boardrelay 12vdiode 40001 or 40007bc558 transistor9volt batterymale header pin or simple wire for connectingstep1:-
place all the thing on the veroboard as shown in picture or in schematic or in video
breadboard view
schematic picture

connect signal to desired pin of arduino 
and ground to ground pin of arduino
and don't forget to connect 9volt battery


if it is not working check the diode position and transistor position and also see ground connections