MEVIHUB

Automatic Passenger Counting Systems Using Arduino

Overview

An automated counter system is an efficient solution for counting the number of people entering or leaving a bus. Highlight people and passengers counters are compact and autonomous devices based on non-contact stereoscopic vision technology. They have been designed for passengers counting above the doorways of buses and rolling stocks and counting people as they enter or leave buildings or any area with restricted access.

Benefits of deploying a passenger counting system: 

Components Used

Block Diagram

Arduino

Description

The Uno R3 CH340G ATmega328p Development Board is the low-cost version of the popular Uno R3 Arduino. It is assembled with the CH340 USB to Serial converter chip, instead of using an Atmega16U2 chip.

We have used plenty of these low-cost Arduino boards with CH340 chips, and have found them to work perfectly. The only time the CH340 chip is used is during programming and when using the serial output of the USB port. During regular operation, this board is identical to the more expensive version without the CH340 chip.

Arduno Specifications:

IR Sensor as Visitor Detector

The main element of this project is the IR Sensor which works as a Human Detector. Whenever the IR sensor detects an interrupt it counts the person and adds it to the previous value. You can check some of our previous projects made using IR Sensor Like Digital Tachometer and also the Fan Speed Measurement.

IR Sensor module has the great adaptive capability of the ambient light. It has an infrared transmitter and a receiver. The infrared emitting tube emits a certain frequency which when encounters an obstacle reflects back to the signal. The reflected signal is then received by the receiver tube. Apart from the IR Transmitter and Receiver the circuit also consists of Opamp, Variable Resistor (Trimmer pot) & output LED.

16 × 2 standard LCD screen

Do you want to add an interface to your project? Use the standard 16 × 2 alphanumeric LCD display, they are extremely common and a quick way for your project to display status messages.

An LCD (liquid crystal display) screen is an electronic display module and has a wide range of applications. A 16 × 2 LCD screen is a very basic module and is very commonly used in various devices and circuits.

Final Code

//////  Automatic Passenger Counting Systems   //////////


#include<LiquidCrystal.h>
LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);
// rs=A0, en=A1, d4=A2, d5=A3, d6=A4, d7=A5
int temp=0;

void setup() {
  Serial.begin(115200);
  lcd.begin(16,2);
   pinMode(2,INPUT_PULLUP);
  pinMode(3,INPUT_PULLUP);

lcd.print("Bus Passenger Count");
Serial.print("Bus Passenger Counter");
}

void loop() {
  
if(digitalRead(2)==0)
  { 
    temp=temp+1;
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Passenger in");
   lcd.setCursor(14,0);
   lcd.print(temp);
   lcd.setCursor(2,1);
   lcd.print("Total:");
   lcd.print(temp);
   Serial.print("Passenger In \t");
   Serial.print(temp);
   Serial.print("\t Total \t");
   Serial.println(temp);
     delay(500);
  }
else if(digitalRead(3)==0)
{
  if(temp>0)
  {
   temp=temp-1;
   lcd.clear();
   lcd.setCursor(0,0);
   lcd.print("Passenger Out");
   lcd.setCursor(14,0);
   lcd.print(temp);
   lcd.setCursor(2,1);
   lcd.print("Total:");
      lcd.print(temp);
   Serial.print("Passenger Out\t");
        Serial.print(temp);
   Serial.print("\t Total \t");
   Serial.println(temp);
   delay(500);
  }
  else if(temp<0)
  {
    temp = 0;
    Serial.print("wrong\t");
    Serial.println(temp);
  }
}


}
Exit mobile version