Embedded System Project : Person counter

Person counting is a method to count how many persons are comes in the range of sensor and count it. This is possible through embedded system software. This method is useful in museums, stadiums, etc. places so that they can count daily visitors and make a perfect record of it.

Connections

Used elements for this project :-

1 Arduino board

1 LCD 16Ɨ2

1 Ultrasonic distance sensor

Cables

In this we are provide a 5V power supply through 1 cable for showing a output on screen. 2 cables are going in ground and others are connected with digital pins. Here, we use ultrasonic distance sensor for detecting a distance. It will detect sensor from object to sensor. It has 4 cables connected one is for 5V power supply, one is connected in ground and other 2 cables are connected in digital pins. This is all about connections with Arduino board.

Embedded System Person Counting

Source Code

				
					#include <LiquidCrystal.h>

LiquidCrystal lcd(11, 10, 5, 4, 3, 2);

int trig = 7;
int echo = 8;
int count = 0;
long duration;
long distance;
int esc = 0;


void setup()
{
   lcd.begin(16,2);
   pinMode(trig, OUTPUT);
   pinMode(echo, INPUT);

}

void loop()
{
   digitalWrite(trig, LOW);
   delayMicroseconds(5);

   digitalWrite(trig, HIGH);
   delayMicroseconds(15);

   digitalWrite(trig, LOW);

   duration = pulseIn(echo, HIGH);
   distance= duration*0.034/2;

   if (distance < 300 && esc == 0)
   {
      count = count + 1;
      esc = 1;
   }

   if(distance > 300)
   {
      esc = 0;
   }

   lcd.setCursor(0,0);
   lcd.print("Count: ");
   lcd.print(count);
   delay(2500);
}
				
			

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Articles

PS/2 Port
DVD Drive
Floppy Disk
Router

Popular Articles

Motherboard
Keyboard
Floppy Disk

Author

HK Sangani 35 Articles
I'm Harikrushna Sangani, a software engineer and the face behind IT Tutorials Cloud. I'm passionate about all things tech and love sharing my knowledge with you through easy-to-follow tutorials and tips. Join me on IT Tutorials Cloud to level up your coding skills and stay updated on the latest in the tech world. Let's learn together! Harikrushna Sangani
adbanner