This project is a simple people counting system that uses an ultrasonic sensor, an Arduino board, and an LCD display to count the number of people passing through a specific location. The system is designed to be easy to set up and use, making it a great solution for a variety of applications such as retail stores, libraries, museums, and more.
To get started with this project, follow these steps:
You will need the following materials to build the people counting system:
- Arduino board (e.g., Arduino Uno)
- One HC-SR04 ultrasonic sensor
- I2C LCD display
- Breadboard
- Jumper wires
- USB cable (for connecting the Arduino board to your computer) "COM"
- Connect the VCC pin of the ultrasonic sensor to the 5V pin of the Arduino board.
- Connect the GND pin of the ultrasonic sensor to the GND pin of the Arduino board.
- Connect the TRIG pin of the ultrasonic sensor to pin 6 of the Arduino board.
- Connect the ECHO pin of the ultrasonic sensor to pin 7 of the Arduino board.
- Connect the SDA pin of the LCD display to the A4 pin of the Arduino board.
- Connect the SCL pin of the LCD display to the A5 pin of the Arduino board.
- Connect the VCC pin of the LCD display to the 5V pin of the Arduino board.
- Connect the GND pin of the LCD display to the GND pin of the Arduino board.
Note
you can read_more about I2C LCD
Before using the LCD display with the Arduino, you need to install the LiquidCrystal_I2C library. To install the library, follow these steps:
- Open the Arduino IDE.
- Go to the "Sketch" menu, select "Include Library", then "Manage Libraries".
- In the "Library Manager" window, search for "LiquidCrystal_I2C" and select "LiquidCrystal 12C by Frank de Brabander" from the results.
- Click the "Install" button to install the library.
To upload the code to the Arduino board, follow these steps:
- Clone or download the project code from this repository.
- Open the
people_counter.ino
file in the Arduino IDE. - Connect the Arduino board to your computer using the USB cable.
- Select the correct board and port in the Arduino IDE (under the "Tools" menu).
- Upload the code to the Arduino board (click the "Upload" button in the Arduino IDE).
To use the people counting system, follow these steps:
- you can calculate sound speed using sengpielaudio
- Place the ultrasonic sensor at the entrance of the location you want to count people in.
- Turn on the Arduino board.
- The LCD display will show the current count of people passing through the location.
- When a person passes through the sensor, the count will be updated accordingly.
You can customize the people counting system to fit your specific requirements. The code is well-commented and easy to understand, so you can modify it as needed. For example, you can change the threshold distance for detecting people, or add more sensors to cover a larger area.
If you have any questions or comments about this project, please feel free to contact me at
Gmail : abdelrahmansalby23@gmail.com 📫