Arduino Based Bidirectional Visitor Counter | IR Sensor Counter | Counter with Code & Diagram
Вставка
- Опубліковано 9 лют 2025
- Arduino based bidirectional visitor counter can count the number of people visiting any place like library, super shop, hall room, VIP hotels, secured places etc.
Arduino Based Bidirectional Visitor Counter Project | 16×2 LCD Display & I2C LCD Adapter Circuit showing the results. IR sensor, breadboard, connecting wire & 9V battery are the other major equipments. This counter counts 2 incoming and outgoing door separately, i.e. you are entering, and then going out, after this full process, you will be counted as a visitor. If you just enter and exits from the entering door, you will not be counted and another additional project can count you as suspect, not maintaining the rules of using sperate gate. In high secured places, libraries, attendance required type places, hall rooms, seminar rooms, educational institutions, safe houses, small industry ; these kind of counters are used as counting/safety purpose. Betterment and unique applications can be achieved by bringing change in Arduino Code after deep analysis.
Project Report including Code, Connection Diagram, Library and other work steps :
Coming Soon.
Equipments Details :
Arduino Uno R3
Arduino Uno R3 is a microcontroller board based on ATmega328. Arduino UNO R3 has 14 digital input/output pins, 6 analog inputs. Arduino Uno R3 contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
LCD 1602 Parallel LCD Display & I2C Liquid Crystal Display Adapter
This is LCD 1602 Parallel LCD Display that provides a simple and cost-effective solution for adding a 16×2 White on Liquid Crystal Display into your project. The display is 16 character by 2 line display has a very clear and high contrast white text upon a blue background/backlight.
This is great blue backlight LCD display. It is fantastic for Arduino based project. This LCD1602 LCD Display is very easy to interface with Arduino or Other Microcontrollers.
This display overcomes the drawback of LCD 1602 Parallel LCD Display in which you’ll waste about 8 Pins on your Arduino for the display to get working. Luckily in this product, an I2C adapter is directly soldered right onto the pins of the display. So all you need to connect are the I2C pins, which shows a good library and little of coding.
The I2C is a type of serial bus developed by Philips, which uses two bidirectional lines, called SDA (Serial Data Line) and SCL (Serial Clock Line). Both must be connected via pulled-up resistors. The usage voltages are standard as 5V and 3.3V.
If you already have the I2C adapter soldered onto the board like in this product, the wiring is quite easy. You should usually have only four pins to hook up. VCC and GND of course. The LCD display works with 5 Volts. So we go for the 5V Pin.
The values shown on the display can be either a simple text or numerical values read by the sensors, such as temperature or pressure, or even the number of cycles that the Arduino is performing.
IR Sensor
Infrared Obstacle Avoidance Proximity Sensors Module has builtin IR transmitter and IR receiver that sends out IR energy and looks for reflected IR energy to detect presence of any obstacle in front of the sensor module. The module has on board potentiometer that lets user adjust detection range. The sensor has very good and stable response even in ambient light or in complete darkness.
The sensor module can be interfaced with Arduino, Raspberry Pi or any microcontroller having IO voltage level of 3.3V to 5V.
Applications:
Obstacle avoidance in robots
Production counting on assembly lines
Presence detection
Security systems
আরডুইনো বাইডিরেকশনাল কাউন্টার প্রজেক্ট
ইইই বিভাগের শিক্ষার্থীদের তৈরি।
#arduino
#arduinoproject
#irsensor
#arduinoide
#project
#eee
#electrical
#electronic
#electronics
#diy
#diyprojects
#bangladesh
#india
#বাংলাদেশ
#জামালপুর
জামালপুর বিজ্ঞান ও প্রযুক্তি বিশ্ববিদ্যালয়
//code
#include
#include
LiquidCrystal_I2C lcd(0x27, 16, 2);
const int Sensora = 2;
const int sensorB = 3;
const int output = 13;
int count = 0;
boolean sensorATriggered = false;
unsigned long sensorATime;
byte currStateA;
byte prevStateA = HIGH;
boolean sensorBTriggered = false;
unsigned long sensorBTime;
byte currStateB ;
byte prevStateB = HIGH;
void setup () {
lcd.begin();
lcd.backlight();
Serial.begin (9600);
pinMode (Sensora, INPUT);
pinMode (sensorB, INPUT);
pinMode (output, OUTPUT);
lcd.print(" No of visitors ");
}
void loop () {
lcd.setCursor(8,1);
currStateA = digitalRead (Sensora);
if (currStateA != prevStateA)
{
if (currStateA == LOW)
{
sensorATriggered = true;
sensorATime = millis ();
}
}
// prevStateA = currStateA;
currStateB = digitalRead (sensorB);
if (currStateB != prevStateB)
{
if (currStateB == LOW)
{
sensorBTriggered = true;
sensorBTime = millis ();
}
}
// prevStateB = currStateB;
if (sensorBTriggered && sensorATriggered)
{
if (sensorATime> sensorBTime)
{
count ++;
Serial.println(count);
delay(500);
}
if (sensorBTime> sensorATime)
{
count--;
Serial.println(count);
delay(500);
}
sensorATriggered = false;
sensorBTriggered = false;
}
lcd.print(count);
lcd.print(" ");
}