a16m
Published © LGPL

Passenger Detection In Vehicles Door

This project idea can be implement to detect passenger in local transportation in this pandemic situation for safe journey.

AdvancedFull instructions provided462
Passenger Detection In Vehicles Door

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
PIR Sensor, 7 m
PIR Sensor, 7 m
×1
Rotary Potentiometer, 1 Mohm
Rotary Potentiometer, 1 Mohm
×1
Alphanumeric LCD, 16 x 2
Alphanumeric LCD, 16 x 2
Choose as your preference
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Circuit Diagram

Here, Arduino, PIR sensor , Potentiometer and LCD is being used to demonstrate the project.

Code

Local Transport Door Sensor Passenger Detection

C/C++
Code for people detection In local transpiration
#include <LiquidCrystal.h>
int in = 15;
int inpr = 16;
int out = 14;
int outpr = 17;
int ppl = 0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
bool pi = 0;
bool po = 0;
void setup() {
pinMode(15, INPUT);
pinMode(14, INPUT);
pinMode(16, OUTPUT);
pinMode(17, OUTPUT);
  lcd.begin(16,2);
}
void loop() {
  lcd.clear();
  digitalWrite(outpr, HIGH);
  digitalWrite(inpr, HIGH);
  pi = digitalRead(in);
  po = digitalRead(out);
  if (pi ==1){
  ppl--;
    delay(500);
  }
  else if (po ==1) {
  ppl++;
    delay(500);
  }
  ppl = constrain(ppl,0,50);
  lcd.setCursor(0,0);
  lcd.print("Passenger");
  lcd.setCursor(11,0);
  lcd.print(ppl);
  if (ppl>=20) {
  lcd.setCursor(0,1);
  lcd.print ("Please Wait");
  delay(1000);          
  }
  if (ppl<=19) {
   lcd.setCursor(0,1);
   lcd.print("Total In");
   delay(1000);
   }
}

Credits

a16m
0 projects • 0 followers

Comments