Automatic Room Light Controller with Bidirectional Visitor Counter

embedded

BySaddam 173

Arduino Based Visitor Counter with Automatic Light Control

Often we see visitor counters at stadium, mall, offices, class rooms etc. How they count the people and turn ON or OFF the light when nobody is inside? Today we are here with automatic room light controller project with bidirectional visitor counter by using Arduino Uno. It is very interesting project for hobbyists and students for fun as well as learning.

 

Components

  • Arduino UNO
  • Relay (5v)
  • Resisters
  • IR Sensor module
  • 16x2 LCD display
  • Bread Board
  • Connecting Wires
  • Led
  • BC547 Transistor

 

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 same gate or exit gate and it depends upon sensor placement in mall/hall. It can also be used at gates of parking areas and other public places.

 

This project is divided in 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 entering or exiting of the person. And counting is displayed on a 16x2 LCD through the controller.

When any one enters in the room, IR sensor will get interrupted by the object then other sensor will not work because we have added a delay for a while.

IR Transmitter Working

Circuit Explanation

There are some sections of whole visitor counter circuit that are sensor section, control section, display section and driver section.

 

Sensor section: In this section we have used two IR sensor modules which contain IR diodes, potentiometer, Comparator (Op-Amp) and LED’s. Potentiometer is used for setting reference voltage at comparator’s one terminal and IR sensors sense the object or person and provide a change in voltage at comparator’s second terminal. Then comparator compares both voltages and generates a digital signal at output. Here in this circuit we have used two comparators for two sensors. LM358 is used as comparator. LM358 has inbuilt two low noise Op-amp.

IR Sensor Circuit

Control Section: Arduino UNO is used for controlling whole the process of this visitor counter project. The outputs of comparators are connected to digital pin number 14 and 19 of arduino. Arduino read these signals and send commands to relay driver circuit to drive the relay for light bulb controlling. If you find any difficulty in working with relay, check out this tutorial on arduino relay control to learn more about operating relay with Arduino.

 

Display section:  Display section contains a 16x2 LCD. This section will display the counted number of people and light status when no one will in the room.

 

Relay Driver section: Relay driver section consist a BC547 transistor and a 5 volt relay for controlling the light bulb. Transistor is used to drive the relay because arduino does not supply enough voltage and current to drive relay. So we added a relay driver circuit to get enough voltage and current for relay. Arduino sends commands to this relay driver transistor and then light bulb will turn on/off accordingly.

 

Visitor Counter Circuit Diagram

The outputs of IR Sensor Modules are directly connected to arduino digital pin number 14(A0) and 19(A5). And Relay driver transistor at digital pin 2. LCD is connected in 4 bit mode. RS and EN pin of LCD is directly connected at 13 and 12. Data pin of LCD D4-D7 is also directly connected to arduino at D11-D8 respectively. Rest of connections are shown in the below circuit diagram.

Visitor Counter Circuit Diagram using Arduino

 

Code Explanation

First we have included library for LCD and defined pin for the same. And also defined input output pin for sensors and ralay.

define

Then given direction to input output pin and initialized LCD in setup loop.

void setup

In loop function we read sensors input and increment or decrement the counting depending upon enter or exit operation. And also check for zero condition. Zero condition means no one in the room. If zero condition is true then arduino turn off the bulb by deactivating the relay through transistor.

loop

And if zero condition is false then arduino turns on the light. Here is two functions for enter and exit.

enter and exit function

 

Recommended TI Whitepapers

Code

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

Video

Get Our Weekly Newsletter!

Subscribe below to receive most popular news, articles and DIY projects from Circuit Digest

Comments

  • sonu's picture
    sonu
    Nov 03, 2016

    did this project work i want the complete data of this project

  • Jonas Dautel's picture
    Jonas Dautel
    Nov 08, 2016

    hey i created a ne verison ofyour code just place it into your exciting code ..it will count the people WARNING the pins i used for the sensors ar 3 and 4 . 3 is the one you pass first wen you go in :
    boolean sensor1 = false ;
    boolean sensor2 = false ;
    int count = 0 ;

    void setup() {
    // put your setup code here, to run once:
    pinMode(3, INPUT);
    pinMode(4, INPUT);
    pinMode(2, OUTPUT);
    }

    void loop() {
    // put your main code here, to run repeatedly:
    delay (200);
    sensor();
    if (sensor1 == true) {
    S1();
    }
    //if (sensor2 == true){
    // S2();
    //}
    }
    void sensor() {
    if (digitalRead(3) == HIGH) {
    sensor1 = true;
    }
    else if (digitalRead(3) == LOW) {
    sensor1 = false;
    }
    if (digitalRead(4) == HIGH) {
    sensor2 = true;
    }
    else if (digitalRead(4) == LOW) {
    sensor2 = false;
    }
    else {
    loop();}
    }
    void S1() {
    while (sensor1 == true && sensor2 == false) {
    sensor();
    }
    if (sensor1 == false && sensor2 == false) {

    }
    else if (sensor1 == true && sensor2 == true) {
    S1S2();
    }
    else {
    loop();
    }
    }
    void S1S2() {
    while (sensor1 == true && sensor2 == true) {
    sensor();
    }
    if (sensor1 == false && sensor2 == true){
    S2F();
    }
    else if (sensor1 == true && sensor2 == false){
    S1();
    }
    else {
    loop();
    }
    }

    void S2F() {
    while (sensor2 == true && sensor1 == false){
    sensor();
    }
    if (sensor2 == false && sensor1 == false){
    count = count + 1;
    loop();
    }
    else if (sensor1 == true && sensor2 == true){
    S1S2();
    }
    else {
    loop();
    }

    }
    void S2() {
    while (sensor2 == true && sensor1 == false) {
    sensor();
    }
    if (sensor1 == false && sensor2 == false) {

    }
    else if (sensor1 == true && sensor2 == true) {
    S2S1();
    }
    else {
    loop();
    }
    }
    void S2S1() {
    while (sensor2 == true && sensor1 == true) {
    sensor();
    }
    if (sensor2 == false && sensor1 == true){
    S1F();
    }
    else if (sensor2 == true && sensor1 == false){
    S2();
    }
    else {
    loop();
    }
    }

    void S1F() {
    while (sensor1 == true && sensor2 == false){
    sensor();
    }
    if (sensor1 == false && sensor2 == false){
    count = count - 1;
    loop();
    }
    else if (sensor2 == true && sensor1 == true){
    S1S2();
    }
    else {
    loop();
    }

    }

  • hema's picture
    hema
    Jan 21, 2017

    do the same circuit sufficient for your new program???

  • Sananda's picture
    Sananda
    Feb 03, 2017

    Sir what exactly does your modified code do? And how did you implement it physically like did you place two sensors at the same door at some distance to track the count? Also, can the sensors be deployed vertically on the ceiling instead of horizontally?

  • Aswinth Raj's picture
    Aswinth Raj
    Mar 05, 2018

     And how did you implement it physically like did you place two sensors at the same door at some distance to track the count? 

    No the code is already fully functional. You just have to build it on your own

     

    Also, can the sensors be deployed vertically on the ceiling instead of horizontally?

    Yes you can mount it vertically also it will work. But it will not suit the application

  • SAMI ULLAH's picture
    SAMI ULLAH
    Feb 23, 2017

    i am aren't able to understand your code . please can you add the fuctionality of lcd so that the counted person can be displayed on lcd . please i neeed it as early as possible because i am giong to sumbit my project within this week at uni

  • Alvin Avarachan's picture
    Alvin Avarachan
    Nov 23, 2017

    Where is the program for LCD display

  • Ei Htwe's picture
    Ei Htwe
    Nov 09, 2016

    if two persons enter at the time, can this circuit count the correct number.

  • ebenezer's picture
    ebenezer
    Nov 09, 2016

    pls check and send the full program and step by step process in cricuit diagram how to fix in everything

  • Andrews's picture
    Andrews
    Nov 11, 2016

    Sir relay connections probs but i have given the conection for relay as u did but the lcd shows values correctly but led is not turning on and telay not working

  • BRAHMAREDDY's picture
    BRAHMAREDDY
    Nov 14, 2016

    IN RELAY NO OR NC WHICH IS GIVEN TO GROUND PLEASE GIVE ME REPLY URGENTLY

  • Abhishek's picture
    Abhishek
    Nov 21, 2016

    Hi, wonderful project idea and demonstration, I have bought all the required components, however I wish to use LED or an array of LEDs in stead of 220v AC bulb, what should I do to make it work? Like in your video I see a relay is attached to the breadboard, however I am bit confused about LED, should I directly connect LED in place of bulb(bad idea?) or relay?

  • May's picture
    May
    Nov 29, 2016

    hello guys
    is there is any way to set arduino to count when the sensor didnt get any signal

    I mean exactly On the contrary of this program when the IR module didnt get any IR signal instead of getting signal ?

    please help

  • goverdhan's picture
    goverdhan
    Nov 29, 2016

    explain about relay connection(where the relay pins are connectd)

  • arindam barat 's picture
    arindam barat
    Dec 04, 2016

    can i change ir to pir ?if i change then what need to change in ckt or programming/?

  • Remix23's picture
    Remix23
    Dec 12, 2016

    Hi there,

    Your project is really amazing. I would like to build it myself just to have some hands on experience.

    Could you please tell me what ohms are your resistors? and you have connected the circuit to the diagram as shown above?

    Thanks

  • harkishan's picture
    harkishan
    May 10, 2017

    use the variable resistor on lcd display on 3rd terminal

  • ajit's picture
    ajit
    Dec 13, 2016

    hi....am ajit ...i almost done this project according to your above details...but unfortunately there is a problem.i did not able connect the relay with load ....plz give some idea about it.

  • Maddy's picture
    Maddy
    Dec 17, 2016

    Please read all the previous comments before asking questions, we might have answered them already.
    Thanks

  • Abdulaziz's picture
    Abdulaziz
    Dec 26, 2016

    If you copied and pasted the code that is provided in this project and had a problem where the counter increases without any object passing through the ir module and when it passes the counter stope adjust the code like this:
    if(digitalRead(in))
    IN();
    if(digitalRead(out))
    OUT();
    // will be like this:
    while(digitalRead(in) == LOW){
    IN();
    break;}
    if(digitalRead(out) == LOW){
    OUT();
    break;}
    // define in as pin 3 and out as pin 4 on digital pins

  • Jaylord's picture
    Jaylord
    Jan 19, 2017

    thank you for this project sir. but i have a little bit of problem the counting that I saw is not stable it increases the original count and decreases immediately in every second..how will i fix it sir..thanks in advance...

  • Maddy's picture
    Maddy
    Jan 28, 2017

    Normally the range of IR LED is 2 meter, but it can be increased by using Lens.

  • namrata's picture
    namrata
    Feb 01, 2017

    why use ir sensor not proximity and pir sensor

  • Shekhar's picture
    Shekhar
    Feb 02, 2017

    Can you please give me a suggestion for how to make the same code for pic?

  • Deep kumar's picture
    Deep kumar
    Feb 11, 2017

    can you provide me a code and circuit diagram for atmega16

  • SAMI ULLAH's picture
    SAMI ULLAH
    Feb 22, 2017

    this program is not working its show error in compilation ????

  • SAMI ULLAH's picture
    SAMI ULLAH
    Mar 19, 2017

    I have created a new version on this project for my first semester final project. Intially idea i get from this web then worked on it finally i made it . My version is more sensible and i have used direct incidence of ir sensor . These direct incidence sensor could be made at home very easily . if any body want any help regarding this project he may ask.

  • T.V.SRINIVAS's picture
    T.V.SRINIVAS
    Aug 19, 2017

    Sir,
    As you expressed to help us,please provide your modified arduino code for automatic room light controller using arduino and seven segment display.
    thanks in advance. may god bless you

  • bura's picture
    bura
    Mar 20, 2017

    Sir I dont have IR sensor in protues simulation

  • elyse's picture
    elyse
    Mar 22, 2017

    i want to use 3 relays in a program to control more lights but i have used one relay and i want u help me to add them in program help me please
    the program is below
    #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);

    }

  • guettaf fouzi's picture
    guettaf fouzi
    May 02, 2017

    you must change command
    if(digitalRead(out))
    to
    if(digitalRead(out) && count>0)
    for void decrementation when you pass throug sensor 2 while count=0

  • harkishan's picture
    harkishan
    May 10, 2017

    please send me interfacing assemble video of this project

  • Jambulingam Hemanth's picture
    Jambulingam Hemanth
    May 15, 2017

    Sir I am in need of using the sensor range for about 3-10 ft for sensing range. So I have decided to use ultrasonic sensor for that range of measurement. Can i use ultrasonic sensor for this project? if not can you suggest me any other sensor?

  • Avigyan Roy's picture
    Avigyan Roy
    May 23, 2017

    while doing this experiment the problem that i am facing is in my lcd continuously no. of person is getting changed in absence of any input.
    That means when i bring my hands near to the either of the sensors it performs according to the porgram but the moment i am removing my hand(that means there is nothing to be sensed) lcd starts showing an infinite loop of 0 and 1 and it continues untill i again bring my hand near sensor.
    please give me the solution.

  • ash's picture
    ash
    Jun 08, 2017

    i have checked the connections .. they are correct..
    when i run the code , the screen displays 'no. of persons in the room',
    but when i give an input like move my hand across the sensor, the screen goes blank and comes back on when i remove my hand..

    plz tell me what to do..
    i have a week before i have to submit the project and its too late to change it.
    i appreciate all the help i can get.

  • munezero erienne's picture
    munezero erienne
    Jun 14, 2017

    how you can limit the peaple in the room for example if you want only 10 peaple in the room ,which code you can use it.

  • Karan's picture
    Karan
    Jul 14, 2017

    Hi. You've shown the connection of Sensors Output to Analog pins of Arduino. But in code, you've used digitalRead. Shouldn't it be analogRead because its connected to Analog pins. Thanks

  • Bader's picture
    Bader
    Jul 27, 2017

    I did it and it works very well.

    But the sensors you used are small range detector.

    How much Your sensors range can detect?

  • Seff's picture
    Seff
    Jul 28, 2017

    Please give the whole code for this project.

  • surmit chauhan's picture
    surmit chauhan
    Aug 16, 2017

    I have connected all the components as mentioned but there is a problem when i switch it on the circuit is not working and text displaying is fluctuating Person in room 0,1,0,1..... these 1 and 0 are coming and going again and again

  • sureka's picture
    sureka
    Aug 18, 2017

    what are the softwares used in this project

  • shaku's picture
    shaku
    Sep 20, 2017

    hello admin is this the correct code or we need to alter something??????
    reply soon plz

  • Subashini's picture
    Subashini
    Oct 08, 2017

    I am new to Arduino. I have given the same circuit connection and uploaded the program. but the counter is changing between 0 and 1 automatically. Where i have done mistake. how to find?

  • Allen Paul Antony's picture
    Allen Paul Antony
    Oct 09, 2017

    The Red led on my sensor module is always on standby. when we put our hands near the module the LED BLINKS AND AGAIN TURN ON. Some times the number of persons simply goes on increasing or decreasing. I doubt it is not working according to the sensor input.
    Please look into my problem, I want to submit the project within 2 days.

  • Adarsh Thomas's picture
    Adarsh Thomas
    Oct 11, 2017

    please send me the corrected code which worked for you.

  • Allen Paul Antony's picture
    Allen Paul Antony
    Oct 11, 2017

    The red colour led of my ir sensor module is always turned on, and when i move my hands infront the led blinks and again turn on. what change should i make in coding. Here is my 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);

    }

  • praneeth's picture
    praneeth
    Oct 12, 2017

    Output light keeps blinking even when there is no count... please help

  • praneeth's picture
    praneeth
    Oct 18, 2017

    I have connected a Led instead of the Relay but the Led Keeps blinking even when there is no count.
    When the count is one or more the Led blinks in a fast rate. Please help

  • Aaa's picture
    Aaa
    Oct 24, 2017

    What is the voltage of the chargable battery?

  • praneeth's picture
    praneeth
    Oct 25, 2017

    The count keeps varying ... When the count is 1 the arduino count keeps varying between 1 and 0 . So the output relay keeps turning ON and OFF. Same thing occurs when the count is two the count keeps varying between 2 and 1
    Please help!!

  • AISHA's picture
    AISHA
    Oct 25, 2017

    Hi Praneeth, the problem is most likely because your IR module is making a false trigger. Use the Serial monitor to check which creates a false trigger. Maybe a pull down resistor or 10K to the signal pin or IR module should solve the problem

  • NAMRATHA B RAJ's picture
    NAMRATHA B RAJ
    Oct 28, 2017

    Can we add PIR Sensor along with IR sensor to this project. IR sensor for counting the persons and PIR Sensor for turning on the light on particular area in a large area/hall. So can we use PIR And IR sensor in this project. If it is possible can you explain me how can we do it.

  • praneeth's picture
    praneeth
    Nov 07, 2017

    Thank you Aisha, Your idea was the solution, where the threshold of the IR input was crossing continuously. Adding 10 K resistor in series with the IR sensor worked.
    Thanks again
    by the way great project and thanks for everyone contributing to this.

  • Alvin Avarachan's picture
    Alvin Avarachan
    Nov 13, 2017

    Sir , i need the entire circuit of above showed video of automatic room light controller.
    Will u please say about the maximum distance provided between 2 ir modules.
    And also gave the connection to the 5v relay .
    I am waiting for ur reply

  • khalees's picture
    khalees
    Nov 19, 2017

    please is the IR the same thing with IR proximity sensor? i did search it online in our local electronic store that is what the are giving to me

  • Aswinth Raj's picture
    Aswinth Raj
    Nov 21, 2017

    Yes khalees you can also use an IR proximity sensor module it will work like the same

  • Francis obeng 's picture
    Francis obeng
    Jan 10, 2018

    please am using this as my project and won't to add a buzzer alarm so if the number in a room reach a certain number let say 100 it will sound to indicate room is full.pls can u help me with the cold. and the IR can u please give me the specific model

  • nagraj's picture
    nagraj
    Jan 21, 2018

    how can i send the data of no. of persons in the room using mobile phone?
    how can i add a limit for no. of persons to enter into the room and also voice alarm if count exceeds?
    Please reply me as soon as possible

  • AISHA's picture
    AISHA
    Jan 23, 2018

    Use a bluetooth module like HC-05 and send the data over to your phone. You can record a voice alarm audio into a SD card and play it from arduino when ever the count exceeds a particular value 

  • Anup kumar's picture
    Anup kumar
    Feb 07, 2018

    How to count bidirectional.......I.e. I count 12 then how to reduce 11 if I exit .....Because same LDR used to in or out.......

  • Aswinth Raj's picture
    Aswinth Raj
    Feb 08, 2018

    They are not LDR, it is IR sensor. Read the complete explanation patiently.

    The project could count bi-directional because the author has used two IR sensor. So based on the sequence we can tell is the person is entering the room or exiting the room

  • Ernzl Estrada's picture
    Ernzl Estrada
    Feb 21, 2018

    hay sir good day.. the arduino ide needs an drivers to run ??

  • Joash's picture
    Joash
    Mar 09, 2018

    Can u plz show the connection of relay

  • Amartya's picture
    Amartya
    Mar 10, 2018

    Can we use adruino nano to make this project

  • Aman Sahoo's picture
    Aman Sahoo
    Mar 26, 2018

    The code count the also update the person in negative value so try this code.
    #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)
    {
    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);

    }

  • Aravindhan's picture
    Aravindhan
    Mar 26, 2018

    my problem is... when (<=1) person enters the room , one led should lights up. when (<=2) person enters the room , two led should lights up...
    can anyone plz provide me code over this.......

  • Rahul's picture
    Rahul
    Mar 30, 2018

    I have trouble in output in LCD display plz advice me connection properly .
    And give me proper correct Codeing
    Plz help me sir

  • Mahesh Chavan's picture
    Mahesh Chavan
    Mar 31, 2018

    How to add IR Module in proteus software?

  • Rahul's picture
    Rahul
    Apr 16, 2018

    My lcd display is not getting output it is seen blank.not a seen count or any output in lcd display pls help me what is solution of this.

  • Rahul's picture
    Rahul
    Apr 16, 2018

    Problem in Lcd diplay output.nothing getting cursor in lcd.

  • Hiro_Hamada's picture
    Hiro_Hamada
    Apr 18, 2018

    Check your connection, may be the contrast of the LCD is not set properly. Many people get it wrong the first time 

  • Dev's picture
    Dev
    Apr 20, 2018

    I made this project but there some prblm...relay is not operated automatically ...and major prblm is that if we run the code then LCD will shows everything but there fluctuation in counting 1st count 1 and if are goes 2nd time it will show 2 but then 1 2 1 2 fluctuates please send perfect code ....i have a very less time ...to submit my project ...

  • Mayuresh's picture
    Mayuresh
    Apr 22, 2018

    I've made all proper connections and even the LED's and sensors are working perfectly, but the LCD doesn't show anything even though it is ON.

  • Harshil's picture
    Harshil
    May 04, 2018

    You have connected those input of ir sensor to analog pins in circuit diagram but according to your code explanation it should be connected to digital pins

  • Prakash's picture
    Prakash
    Jun 06, 2018

    Sir Send me the total components list with there values and how many components are need.

  • shravani's picture
    shravani
    Jul 06, 2018

    Can you post a video about all the connections in detail ?

  • Arpan's picture
    Arpan
    Jul 06, 2018

    This is my first Arduino project attempt. I've tried to reduce some part of the code to eliminate the LCD display part. Can anyone tell if the following code is correct?

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

    int count=0;

    void IN()
    {
        count++;
        delay(1000);
    }

    void OUT()
    {
      count--;
        delay(1000);
    }

    void setup()
    {
      pinMode(in, INPUT);
      pinMode(out, INPUT);
      pinMode(relay, OUTPUT);
    }

    void loop()
    {  
      
      if(digitalRead(in))
      IN();
      if(digitalRead(out))
      OUT();
      
      if(count<=0)
        digitalWrite(relay, LOW);
      else
        digitalWrite(relay, HIGH);
      
    }

  • sudheer's picture
    sudheer
    Jul 31, 2018

    can i use pir sensors in this place

  • arpit's picture
    arpit
    Aug 14, 2018

    sir the project making this cant be work
    lcd show blank screen
    bulb continously on and
    sensors did not work properly
    sir please help me immediately

  • ray's picture
    ray
    Nov 01, 2018

    Pls i need help modifying the code. is there a way to make the relay and break the relay such as activating a push button switch to control RF light source

    if(count<=0)
    {
    count=0;
    lcd.clear();
    digitalWrite(relay, HIGH); Then low again to simulate a push control.

    else

    digitalWrite(relay, HIGH); Then low again to simulate a push control.

    thanks

  • Annoymous's picture
    Annoymous
    Dec 13, 2018

    Sir pls send me the "correct" or updated source code for counting the people. I try the source code that mentions in the previous source code but it won't works.

    The issue shows counting the people 0 and 1 before count the people

Pages

Log in or register to post Comment