Bi-directional Visitor Counter using Arduino and IR Sensors

  Рет қаралды 7,979

TechKnowLogy Park

TechKnowLogy Park

Күн бұрын

Пікірлер: 120
@sinethembalusawana
@sinethembalusawana 3 жыл бұрын
Wow! Impressive I must say. Thank You.
@sahilgupta5438
@sahilgupta5438 3 жыл бұрын
Nicely Explained..
@ryukgodofdeath2979
@ryukgodofdeath2979 2 жыл бұрын
hello mam your code website is not opening please resedn it please it is really helpfull
@Tennysonthenys
@Tennysonthenys 3 жыл бұрын
Hi, I had problem during compiling the source code that u provide. Can you please guide me? Thanks, i had email to the about the error message.
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
I have gone through the email sent by you. The errors are the result of change in text encoding. Such errors normally occurs whenever we copy the source to from the webpages. Anyway I have sent source to to your email ID. Hope it will solve your problem..
@vidyadusane9022
@vidyadusane9022 2 жыл бұрын
Hello sir Your code link is not in working. Can you share code in comment? Plz
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
#include LiquidCrystal lcd(13,11,5,4,3,2); #define MAX_LIMIT 40 //Maximum number of persons allowed in the hall or room #define in 8 //IR Sensor 1 #define out 7 //IR sensor 2 #define buz 9 //Buzzer pin int count=0, pos=0; //Function to Display the count on LCD void displayCount(int num){ char str[6]; //To hold count to be displayed int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + '0'; } str[len] = '\0'; //Put NULL character to end the string /*If count in room or hall is less than maximum limit of the hall or room, then display the message on LCD to print Number of persons in room */ if(count < MAX_LIMIT){ lcd.clear(); lcd.setCursor(0,0); lcd.print("No. of Persons"); lcd.setCursor(0,1); lcd.print("in Room: "); } /*If number of persons in room is equal to MAX_LIMIT of the room, then display the message as Room Full */ if(count==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Room Full "); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } /*If number of persons in room is greater than MAX_LIMIT, then display the message as Over Crowded Room and also turn on Buzzer*/ if(count>4){ digitalWrite(buz, HIGH); //Buzzer made ON lcd.clear(); lcd.setCursor(0,0); lcd.print("Over CrowdedRoom"); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } else{ //If count is less than or equal to MAX_LIMIT, the turnoff buzzer digitalWrite(buz, LOW); } //Display the count on LCD lcd.print(str); } //Setup function for initial setup void setup(){ //IR sensor pins are made as input pins pinMode(in, INPUT); pinMode(out, INPUT); //Buzzer pin is made as output pin pinMode(buz, OUTPUT); // Buzzer made ON for small duration to indicate start of the counting digitalWrite(buz,HIGH); delay(1000); digitalWrite(buz,LOW); delay(50); //Initial Message on LCD lcd.begin(16,2); lcd.print("Visitor Counter"); delay(100); lcd.setCursor(0,1); lcd.print("TechKnowLogyPark"); delay(100); } //Loop function void loop(){ if((digitalRead(in))==0){ delay(20); while((digitalRead(in))==0); /* Arrangement or placing of sensors: while entering the room from outside, sensor1 will be encounterd first and sensor2 will be next. pos will tell the position of a person, entering/leaving the room If pos=0, default value; No person is entering/leaving the room/hall If pos=1, person is entering the room and crossed sensor1 (in) If pos=2, person has entered the room after crossing both the sensors If pos=3, person is going out of the room and crossed the sensor2 (out) If pos=4, person has gone out of the room after crossing both the sensors */ if(pos==0) pos=1; else if(pos==3) pos=4; } if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } if((digitalRead(out))==0){ delay(20); while((digitalRead(out))==0); if(pos==1) pos=2; else if(pos==0) pos=3; } if(pos==2){ count++; //person has entered the room, increment the count displayCount(count); pos=0; } else if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } delay(50); }
@UNKNOWNUSER-lu3xh
@UNKNOWNUSER-lu3xh 3 жыл бұрын
Can this code used for nodemcu board too?
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Yes, can be used; just need to change the pin numbers accordingly.
@zgryx8428
@zgryx8428 3 жыл бұрын
Hello maam, I've used your code and it works great but I faced an issue. When my count becomes zero and you try to decrement the count again it stops counting, even though you follow the enter function to increment the count, it doesnt add it. Please help me to fix this issue also thank you so much for the source code🥰
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Is it not incrementing the count after count=0? And are you crossing out of room even after the count becomes zero? Check the code as per the below web page link: techknowlogypark.in/bidirectional-visitor-counter-using-arduino/
@kavurisaiteja2053
@kavurisaiteja2053 3 жыл бұрын
Can I get the counted data to blynk app
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Yes. You can send the count value to the blank app. Once the count is updated, same time you can send the value to the blynk app.
@kavurisaiteja2053
@kavurisaiteja2053 3 жыл бұрын
I m doing project on this could you please help me out to do ...
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Yes, tell me what kind of help you need?
@vaibhavimuppainmath.5070
@vaibhavimuppainmath.5070 4 жыл бұрын
Super
@mohammedawaiz1287
@mohammedawaiz1287 2 жыл бұрын
Hello maam in the circuit diagram pin number 3 of lcd is not connected , but in the code you have used as "LiquidCrystal lcd(13,11,5,4,3,2);" so where should i connect pin number 3 of lcd.
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Whatever the pin numbers mentioned in the function call lcd(13,11,5,4,3,2) belongs to pins of Arduino; these are not the pins of lcd. As per the circuit diagram, pin No. 3 is VEE, which can be used to vary the contrast of the display. I hope it is clear to you now.
@mohammedawaiz1287
@mohammedawaiz1287 2 жыл бұрын
Thank you ma'am
@mohammedawaiz1287
@mohammedawaiz1287 2 жыл бұрын
@@TechKnowLogyPark ma'am I have my mini project final presentation tomorrow . I have doubts mam can i Ask you via email
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Yes, go ahead; but it is Mr. B. K. Gudur who is replying to you.
@mohammedawaiz1287
@mohammedawaiz1287 2 жыл бұрын
@@TechKnowLogyPark Hello sir I'm using Arduino IDE software and dumped the code in the board . The problems is, the counter is not decreasing whenever i exit and even buzzer is keep on ringing till i press the reset button on the board . On Lcd display , only light is turned on but nothing is displayed . So can you help me to fix this problem . Thank you
@mdjaid6745
@mdjaid6745 2 жыл бұрын
Mam, how can I use 7 segment display instead of lcd display. Any video available??
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
It is simple, in place of lcd instructions use instructions to send the count to seven segment display.
@vishnutejamallela2511
@vishnutejamallela2511 2 жыл бұрын
Madam please share the code which u have used it
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
You can find the code using below link: techknowlogypark.in/bidirectional-visitor-counter-using-arduino/
@karanagrawal8034
@karanagrawal8034 2 жыл бұрын
I have one doubt when I simulate the code the counter value is not decreasing please help
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
How you are simulating the code?
@karanagrawal8034
@karanagrawal8034 2 жыл бұрын
@@TechKnowLogyPark I simulate my code using proteus software
@adityaranjan1909
@adityaranjan1909 Жыл бұрын
Your website is not accessible
@All8-fx888
@All8-fx888 3 жыл бұрын
hello,why the code is not function on laptop?
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
It has to work, check for the syntax errors.
@davidchadricks.3807
@davidchadricks.3807 2 жыл бұрын
can I ask again whats the purpose of 40 in max limit
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
40 is the maximum persons allowed within the hall. It can be varied based on the number of persons allowed to enter the hall.
@mayurpatilish
@mayurpatilish 3 жыл бұрын
Sir jab one person entry karata hai tab usi time exit se second person aaya to light on or off hoga our person count hoga
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Yes Mayur, to avoid that, entry/exit passage needs to be made such that, only one person will exit or enter through that passage. That's the reason you might have seen in so many places they keep a wooden box/door in passage of entry/exit point.
@mayurpatilish
@mayurpatilish 3 жыл бұрын
@@TechKnowLogyPark ok sir
@rrbrother8154
@rrbrother8154 2 жыл бұрын
I want to count the exact number of visitors entering and exiting the museum. How much would it cost to make such a device? What parts are needed to make it and where do they usually come from? How could the price be?
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
It is very simple to make. All the devices/materials needed can be ordered from Amazon. The list of items can be seen in the video. The price will not be more than Rs. 500/-, in Indian market.
@TechKnowLogyPark
@TechKnowLogyPark Жыл бұрын
Code is available in comment section of the video
@TechKnowLogyPark
@TechKnowLogyPark Жыл бұрын
Find the source code below: #include LiquidCrystal lcd(13,11,5,4,3,2); #define MAX_LIMIT 40 //Maximum number of persons allowed in the hall or room #define in 8 //IR Sensor 1 #define out 7 //IR sensor 2 #define buz 9 //Buzzer pin int count=0, pos=0; //Function to Display the count on LCD void displayCount(int num){ char str[6]; //To hold count to be displayed int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + '0'; } str[len] = '\0'; //Put NULL character to end the string /*If count in room or hall is less than maximum limit of the hall or room, then display the message on LCD to print Number of persons in room */ if(count < MAX_LIMIT){ lcd.clear(); lcd.setCursor(0,0); lcd.print("No. of Persons"); lcd.setCursor(0,1); lcd.print("in Room: "); } /*If number of persons in room is equal to MAX_LIMIT of the room, then display the message as Room Full */ if(count==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Room Full "); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } /*If number of persons in room is greater than MAX_LIMIT, then display the message as Over Crowded Room and also turn on Buzzer*/ if(count>4){ digitalWrite(buz, HIGH); //Buzzer made ON lcd.clear(); lcd.setCursor(0,0); lcd.print("Over CrowdedRoom"); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } else{ //If count is less than or equal to MAX_LIMIT, the turnoff buzzer digitalWrite(buz, LOW); } //Display the count on LCD lcd.print(str); } //Setup function for initial setup void setup(){ //IR sensor pins are made as input pins pinMode(in, INPUT); pinMode(out, INPUT); //Buzzer pin is made as output pin pinMode(buz, OUTPUT); // Buzzer made ON for small duration to indicate start of the counting digitalWrite(buz,HIGH); delay(1000); digitalWrite(buz,LOW); delay(50); //Initial Message on LCD lcd.begin(16,2); lcd.print("Visitor Counter"); delay(100); lcd.setCursor(0,1); lcd.print("TechKnowLogyPark"); delay(100); } //Loop function void loop(){ if((digitalRead(in))==0){ delay(20); while((digitalRead(in))==0); /* Arrangement or placing of sensors: while entering the room from outside, sensor1 will be encounterd first and sensor2 will be next. pos will tell the position of a person, entering/leaving the room If pos=0, default value; No person is entering/leaving the room/hall If pos=1, person is entering the room and crossed sensor1 (in) If pos=2, person has entered the room after crossing both the sensors If pos=3, person is going out of the room and crossed the sensor2 (out) If pos=4, person has gone out of the room after crossing both the sensors */ if(pos==0) pos=1; else if(pos==3) pos=4; } if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } if((digitalRead(out))==0){ delay(20); while((digitalRead(out))==0); if(pos==1) pos=2; else if(pos==0) pos=3; } if(pos==2){ count++; //person has entered the room, increment the count displayCount(count); pos=0; } else if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } delay(50); }
@EBKEC_rituKumari
@EBKEC_rituKumari 2 жыл бұрын
Hello mam... An error in code compiling please tell me how to solve it☹️
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Tell me what's the error?
@EBKEC_rituKumari
@EBKEC_rituKumari 2 жыл бұрын
@@TechKnowLogyPark expected primary - expression before ';' token this is the error in "count-; //person has left the room, decrement the count .
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Typing mistake in the code. Properly check the code..
@EBKEC_rituKumari
@EBKEC_rituKumari 2 жыл бұрын
@@TechKnowLogyPark mam can you provide circuit diagram of this project...... I want to implement on pcb 😐😐
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
It was available on website but now it is under maintenance. Send query to techknowlogypark@gmail.com, so that I can send the circuit diagram.
@dniztechno6745
@dniztechno6745 8 ай бұрын
The link isn't work please give the source code through e mail thanks
@ifansource4825
@ifansource4825 3 жыл бұрын
Can anyone send me the code for it
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
#include LiquidCrystal lcd(13,11,5,4,3,2); #define MAX_LIMIT 40 //Maximum number of persons allowed in the hall or room #define in 8 //IR Sensor 1 #define out 7 //IR sensor 2 #define buz 9 //Buzzer pin int count=0, pos=0; //Function to Display the count on LCD void displayCount(int num){ char str[6]; //To hold count to be displayed int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + '0'; } str[len] = '\0'; //Put NULL character to end the string /*If count in room or hall is less than maximum limit of the hall or room, then display the message on LCD to print Number of persons in room */ if(count < MAX_LIMIT){ lcd.clear(); lcd.setCursor(0,0); lcd.print("No. of Persons"); lcd.setCursor(0,1); lcd.print("in Room: "); } /*If number of persons in room is equal to MAX_LIMIT of the room, then display the message as Room Full */ if(count==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Room Full "); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } /*If number of persons in room is greater than MAX_LIMIT, then display the message as Over Crowded Room and also turn on Buzzer*/ if(count>4){ digitalWrite(buz, HIGH); //Buzzer made ON lcd.clear(); lcd.setCursor(0,0); lcd.print("Over CrowdedRoom"); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } else{ //If count is less than or equal to MAX_LIMIT, the turnoff buzzer digitalWrite(buz, LOW); } //Display the count on LCD lcd.print(str); } //Setup function for initial setup void setup(){ //IR sensor pins are made as input pins pinMode(in, INPUT); pinMode(out, INPUT); //Buzzer pin is made as output pin pinMode(buz, OUTPUT); // Buzzer made ON for small duration to indicate start of the counting digitalWrite(buz,HIGH); delay(1000); digitalWrite(buz,LOW); delay(50); //Initial Message on LCD lcd.begin(16,2); lcd.print("Visitor Counter"); delay(100); lcd.setCursor(0,1); lcd.print("TechKnowLogyPark"); delay(100); } //Loop function void loop(){ if((digitalRead(in))==0){ delay(20); while((digitalRead(in))==0); /* Arrangement or placing ofsensors: while entering the room from outside, sensor1 will be encounterd first and sensor2 will be next. If pos=0, default value; No person is entering/leaving the room/hall If pos=1, person is entering the room and crossed sensor1 (in) If pos=2, person has entered the room after crossing both the sensors If pos=3, person is going out of the room and crossed the sensor2 (out) If pos=4, person has gone out of the room after crossing both the sensors */ if(pos==0) pos=1; else if(pos==3) pos=4; } if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } if((digitalRead(out))==0){ delay(20); while((digitalRead(out))==0); if(pos==1) pos=2; else if(pos==0) pos=3; } if(pos==2){ count++; //person has entered the room, increment the count displayCount(count); pos=0; } else if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } else{ count =0; } delay(50); }
@ifansource4825
@ifansource4825 3 жыл бұрын
@@TechKnowLogyPark Thank u very much
@Ugly75
@Ugly75 3 жыл бұрын
Actually in the circuit diagram you haven't given any connection of potentio meter but where as in hardware connection you were connecting with it.. Can you please tell me the connection for potentio meter
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Connect middle point of 10k pot to VEE of LCD and remaining two points of 10k pot to GND and Vcc, one for each..
@hasinthamadhuranga9839
@hasinthamadhuranga9839 3 жыл бұрын
Plz give that code and circuit diagram
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
You can find circuit diagram and source code using the link given below: techknowlogypark.in/bidirectional-visitor-counter-using-arduino/
@jvnx1137
@jvnx1137 Жыл бұрын
​@@TechKnowLogyParkthe link is not working
@tn36trendingbgm30
@tn36trendingbgm30 2 жыл бұрын
Mam I want the code
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
I have given code in comment section of the video. You just refer to the comments to find the code.
@tn36trendingbgm30
@tn36trendingbgm30 2 жыл бұрын
@@TechKnowLogyPark link doesn't work mam
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Source Code Available in comment section of this video. Anyhow I am pasting it again; find the source code below: #include LiquidCrystal lcd(13,11,5,4,3,2); #define MAX_LIMIT 40 //Maximum number of persons allowed in the hall or room #define in 8 //IR Sensor 1 #define out 7 //IR sensor 2 #define buz 9 //Buzzer pin int count=0, pos=0; //Function to Display the count on LCD void displayCount(int num){ char str[6]; //To hold count to be displayed int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + '0'; } str[len] = '\0'; //Put NULL character to end the string /*If count in room or hall is less than maximum limit of the hall or room, then display the message on LCD to print Number of persons in room */ if(count < MAX_LIMIT){ lcd.clear(); lcd.setCursor(0,0); lcd.print("No. of Persons"); lcd.setCursor(0,1); lcd.print("in Room: "); } /*If number of persons in room is equal to MAX_LIMIT of the room, then display the message as Room Full */ if(count==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Room Full "); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } /*If number of persons in room is greater than MAX_LIMIT, then display the message as Over Crowded Room and also turn on Buzzer*/ if(count>4){ digitalWrite(buz, HIGH); //Buzzer made ON lcd.clear(); lcd.setCursor(0,0); lcd.print("Over CrowdedRoom"); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } else{ //If count is less than or equal to MAX_LIMIT, the turnoff buzzer digitalWrite(buz, LOW); } //Display the count on LCD lcd.print(str); } //Setup function for initial setup void setup(){ //IR sensor pins are made as input pins pinMode(in, INPUT); pinMode(out, INPUT); //Buzzer pin is made as output pin pinMode(buz, OUTPUT); // Buzzer made ON for small duration to indicate start of the counting digitalWrite(buz,HIGH); delay(1000); digitalWrite(buz,LOW); delay(50); //Initial Message on LCD lcd.begin(16,2); lcd.print("Visitor Counter"); delay(100); lcd.setCursor(0,1); lcd.print("TechKnowLogyPark"); delay(100); } //Loop function void loop(){ if((digitalRead(in))==0){ delay(20); while((digitalRead(in))==0); /* Arrangement or placing of sensors: while entering the room from outside, sensor1 will be encounterd first and sensor2 will be next. pos will tell the position of a person, entering/leaving the room If pos=0, default value; No person is entering/leaving the room/hall If pos=1, person is entering the room and crossed sensor1 (in) If pos=2, person has entered the room after crossing both the sensors If pos=3, person is going out of the room and crossed the sensor2 (out) If pos=4, person has gone out of the room after crossing both the sensors */ if(pos==0) pos=1; else if(pos==3) pos=4; } if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } if((digitalRead(out))==0){ delay(20); while((digitalRead(out))==0); if(pos==1) pos=2; else if(pos==0) pos=3; } if(pos==2){ count++; //person has entered the room, increment the count displayCount(count); pos=0; } else if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } delay(50); }
@jayrcabales6463
@jayrcabales6463 2 жыл бұрын
hello maam. theres an error in the code. i think it is because of copying from the web. can i have a code privately??
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Check below Code: #include LiquidCrystal lcd(13,11,5,4,3,2); #define MAX_LIMIT 40 //Maximum number of persons allowed in the hall or room #define in 8 //IR Sensor 1 #define out 7 //IR sensor 2 #define buz 9 //Buzzer pin int count=0, pos=0; //Function to Display the count on LCD void displayCount(int num){ char str[6]; //To hold count to be displayed int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + '0'; } str[len] = '\0'; //Put NULL character to end the string /*If count in room or hall is less than maximum limit of the hall or room, then display the message on LCD to print Number of persons in room */ if(count < MAX_LIMIT){ lcd.clear(); lcd.setCursor(0,0); lcd.print("No. of Persons"); lcd.setCursor(0,1); lcd.print("in Room: "); } /*If number of persons in room is equal to MAX_LIMIT of the room, then display the message as Room Full */ if(count==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Room Full "); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } /*If number of persons in room is greater than MAX_LIMIT, then display the message as Over Crowded Room and also turn on Buzzer*/ if(count>4){ digitalWrite(buz, HIGH); //Buzzer made ON lcd.clear(); lcd.setCursor(0,0); lcd.print("Over CrowdedRoom"); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } else{ //If count is less than or equal to MAX_LIMIT, the turnoff buzzer digitalWrite(buz, LOW); } //Display the count on LCD lcd.print(str); } //Setup function for initial setup void setup(){ //IR sensor pins are made as input pins pinMode(in, INPUT); pinMode(out, INPUT); //Buzzer pin is made as output pin pinMode(buz, OUTPUT); // Buzzer made ON for small duration to indicate start of the counting digitalWrite(buz,HIGH); delay(1000); digitalWrite(buz,LOW); delay(50); //Initial Message on LCD lcd.begin(16,2); lcd.print("Visitor Counter"); delay(100); lcd.setCursor(0,1); lcd.print("TechKnowLogyPark"); delay(100); } //Loop function void loop(){ if((digitalRead(in))==0){ delay(20); while((digitalRead(in))==0); /* Arrangement or placing of sensors: while entering the room from outside, sensor1 will be encounterd first and sensor2 will be next. pos will tell the position of a person, entering/leaving the room If pos=0, default value; No person is entering/leaving the room/hall If pos=1, person is entering the room and crossed sensor1 (in) If pos=2, person has entered the room after crossing both the sensors If pos=3, person is going out of the room and crossed the sensor2 (out) If pos=4, person has gone out of the room after crossing both the sensors */ if(pos==0) pos=1; else if(pos==3) pos=4; } if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } if((digitalRead(out))==0){ delay(20); while((digitalRead(out))==0); if(pos==1) pos=2; else if(pos==0) pos=3; } if(pos==2){ count++; //person has entered the room, increment the count displayCount(count); pos=0; } else if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } delay(50); }
@jayrcabales6463
@jayrcabales6463 2 жыл бұрын
@@TechKnowLogyPark hello maam.why s it stock in the title,the sensor is active but it doesnt start counting
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
The code is completely tested and working perfectly. You just check the connections properly. To increment the count, object should first pass through one sensor and later through the other and vice-versa for decrement.
@prakashbiswas6191
@prakashbiswas6191 3 жыл бұрын
can you please share the codes
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
You can find the source code using the link given below: techknowlogypark.in/bidirectional-visitor-counter-using-arduino/
@prakashbiswas6191
@prakashbiswas6191 3 жыл бұрын
i have sent you a mail regarding one of my problem can you please resolve it
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
I have replied to your email. Kindly check..
@arullongton6950
@arullongton6950 Жыл бұрын
Send me code for this mini project
@TechKnowLogyPark
@TechKnowLogyPark Жыл бұрын
Code is available in comment section of the video
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
Can you give code
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
You can find the source code using the link given below: techknowlogypark.in/bidirectional-visitor-counter-using-arduino/
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
@@TechKnowLogyPark thank you
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
@@TechKnowLogyPark how can i contact you ek project mai help chahiye thi
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
techknowlogypark@gmail.com
@kavyabellikatti1857
@kavyabellikatti1857 2 жыл бұрын
Mam I hv mailed u regarding the code plz do check..
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
I have replied to your email.
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
Madam can you explain me this written in your code int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + ‘0’;
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Yes Ezhaan Kazi, The above code is written to convert the integer to string for displaying on LCD. First part will count number of digits in a number and second part will convert every digit to a character. This can be done just by adding ascii value of zero to any digit. Hope this is now clear to you.. If not I'll tell explain in detail.
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
@@TechKnowLogyPark how can i contact you because i want to use this code in my project code but i dont understand how to do it.can you help me Out ??
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
techknowlogypark@gmail.com
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
@@TechKnowLogyPark I've mailed you can you check your inbox plz
@ezhaankazi4984
@ezhaankazi4984 3 жыл бұрын
@@TechKnowLogyPark hey r u there
@davidchadricks.3807
@davidchadricks.3807 2 жыл бұрын
please help the latest code is not decrementing only incrementing
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
You can find the working code using the link given below: techknowlogypark.in/bidirectional-visitor-counter-using-arduino/ This code has been tested and even used by many others for implementing bidirectional visitor counter. You just need to arrange both the sensors properly. If you fail to get the result, you can ask me the same for the solution.
@davidchadricks.3807
@davidchadricks.3807 2 жыл бұрын
@@TechKnowLogyPark I use pir sensor HC-SR501
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
I have written the code and implemented the project using IR Sensor Modules. Use IR sensor modules rather than PIR sensor.
@davidchadricks.3807
@davidchadricks.3807 2 жыл бұрын
@@TechKnowLogyPark yeah I understand my project is human entering and exiting but what can you recommend to me except the pir sensor I choose pir sensor because it detect heat movement so it will be accurate that it detects human than just motion only
@davidchadricks.3807
@davidchadricks.3807 2 жыл бұрын
what do you think might be the problem is it because I used pir instead ir?
@loveshinee1666
@loveshinee1666 2 жыл бұрын
Does the lcd print ? In my case doesn’t want to print did someone faced that issue?? I hope you help me plz ♥️♥️😔
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
That code is fully tested and is working properly. What problem are you facing?
@loveshinee1666
@loveshinee1666 2 жыл бұрын
@@TechKnowLogyPark it doesn’t want decrement im sure that every thing is connected properly and the sensor is placed in perfect way what do you think is the problem?
@TechKnowLogyPark
@TechKnowLogyPark 2 жыл бұрын
Try to use below code: #include LiquidCrystal lcd(13,11,5,4,3,2); #define MAX_LIMIT 40 //Maximum number of persons allowed in the hall or room #define in 8 //IR Sensor 1 #define out 7 //IR sensor 2 #define buz 9 //Buzzer pin int count=0, pos=0; //Function to Display the count on LCD void displayCount(int num){ char str[6]; //To hold count to be displayed int i, rem, len = 0, n; /*Convert integer (count) to string for displaying on LCD*/ n = num; while (n != 0){ len++; n /= 10; } for (i = 0; i < len; i++){ rem = num % 10; num = num / 10; str[len - (i + 1)] = rem + '0'; } str[len] = '\0'; //Put NULL character to end the string /*If count in room or hall is less than maximum limit of the hall or room, then display the message on LCD to print Number of persons in room */ if(count < MAX_LIMIT){ lcd.clear(); lcd.setCursor(0,0); lcd.print("No. of Persons"); lcd.setCursor(0,1); lcd.print("in Room: "); } /*If number of persons in room is equal to MAX_LIMIT of the room, then display the message as Room Full */ if(count==4){ lcd.clear(); lcd.setCursor(0,0); lcd.print("Room Full "); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } /*If number of persons in room is greater than MAX_LIMIT, then display the message as Over Crowded Room and also turn on Buzzer*/ if(count>4){ digitalWrite(buz, HIGH); //Buzzer made ON lcd.clear(); lcd.setCursor(0,0); lcd.print("Over CrowdedRoom"); lcd.setCursor(0,1); lcd.print("No.of Persons:"); } else{ //If count is less than or equal to MAX_LIMIT, the turnoff buzzer digitalWrite(buz, LOW); } //Display the count on LCD lcd.print(str); } //Setup function for initial setup void setup(){ //IR sensor pins are made as input pins pinMode(in, INPUT); pinMode(out, INPUT); //Buzzer pin is made as output pin pinMode(buz, OUTPUT); // Buzzer made ON for small duration to indicate start of the counting digitalWrite(buz,HIGH); delay(1000); digitalWrite(buz,LOW); delay(50); //Initial Message on LCD lcd.begin(16,2); lcd.print("Visitor Counter"); delay(100); lcd.setCursor(0,1); lcd.print("TechKnowLogyPark"); delay(100); } //Loop function void loop(){ if((digitalRead(in))==0){ delay(20); while((digitalRead(in))==0); /* Arrangement or placing ofsensors: while entering the room from outside, sensor1 will be encounterd first and sensor2 will be next. If pos=0, default value; No person is entering/leaving the room/hall If pos=1, person is entering the room and crossed sensor1 (in) If pos=2, person has entered the room after crossing both the sensors If pos=3, person is going out of the room and crossed the sensor2 (out) If pos=4, person has gone out of the room after crossing both the sensors */ if(pos==0) pos=1; else if(pos==3) pos=4; } if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } if((digitalRead(out))==0){ delay(20); while((digitalRead(out))==0); if(pos==1) pos=2; else if(pos==0) pos=3; } if(pos==2){ count++; //person has entered the room, increment the count displayCount(count); pos=0; } else if(pos==4 && count!=0){ count--; //person has left the room, decrement the count displayCount(count); pos=0; } delay(50); }
@loveshinee1666
@loveshinee1666 2 жыл бұрын
can you check your email i asked you about the code
@supportd9043
@supportd9043 3 жыл бұрын
can i message you on your gmail ? i just want to clarify some part thankyou
@TechKnowLogyPark
@TechKnowLogyPark 3 жыл бұрын
Ya, no problem..
@supportd9043
@supportd9043 3 жыл бұрын
@@TechKnowLogyPark Where can I send an email?
@supportd9043
@supportd9043 3 жыл бұрын
@@TechKnowLogyPark check your email i already sent my question Ty
IoT Based Bidirectional Visitor Counter using ESP8266 & MQTT
7:50
How To Electronics
Рет қаралды 17 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
How to Make a Visitor Counter Circuit Using IR Sensor
4:18
Practical Circuits
Рет қаралды 1,3 М.
Two way door counter system using arduino uno
12:57
Hamid sayed
Рет қаралды 1,4 М.
Effective Ways To Detect People With Common Sensors
7:43
Core Electronics
Рет қаралды 95 М.
Bidirectional Counter using IR sensors and Arduino.
6:21
MYTECTUTOR
Рет қаралды 46 М.
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.