0% found this document useful (0 votes)
4 views

Implementation-of-Arduino-based-Counter

This document presents an Arduino-based automated counter system designed to efficiently count the number of people entering or leaving a room using infrared and piezoelectric sensors. The system is low voltage, requires minimal maintenance, and aims to provide an inexpensive solution compared to existing methods. Various methodologies and technologies are discussed, highlighting the advantages and limitations of different counting techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Implementation-of-Arduino-based-Counter

This document presents an Arduino-based automated counter system designed to efficiently count the number of people entering or leaving a room using infrared and piezoelectric sensors. The system is low voltage, requires minimal maintenance, and aims to provide an inexpensive solution compared to existing methods. Various methodologies and technologies are discussed, highlighting the advantages and limitations of different counting techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Published by : International Journal of Engineering Research & Technology (IJERT)

http://www.ijert.org ISSN: 2278-0181


Vol. 9 Issue 09, September-2020

Implementation of Arduino-based Counter


System
Mullapudi Chaitanya Krishna1
Student,Electronics and Communication Engineering,
Vellore Institute of Technology, Vellore,
Tamil Nadu, India

Abstract—Automated counter system is an efficient solution II. LITERATURE REVIEW


for counting the number of people entering or leaving a room. There is more than one method to count the visitors. It
This paper attempts to provide a unique solution which can ultimately depends on the intensity of people. The following
automatically count the number of people. It intelligently papers were studied and analyzed to understand the current
discovers and counts the number of people with the help of
internal code from the Arduino UNO. This has been achieved by
scope of people detection:
using an Infrared sensor, piezoelectric sensors and the Bruno F. Carvalho and others [1] have suggested a method
development board Arduino UNO. Two Infrared sensors are that utilizes sensors for detecting people. The ultrasonic sensor
placed at entry and exit of a room. A series of piezoelectric plays a dominant role in identifying objects and accurately
sensors are placed under a mat between the two infrared sensors. calculates the distance between the sensor and the objects.
The sensors acquire the data and sends to the arduino which “The ultrasonic sensor constantly measures the distance of
maintains the count. The system requires low voltage and objects ahead, sending a signal through Trigger pin e
minimum maintenance to continue the operation. receiving through Echo”. Two ultrasonic sensors are placed
side by side and an algorithm is devised to count the number
Keywords—Counter system, development board, Arduino UNO,
Infrared sensor, Piezoelectric sensor
of visitors entering the premises. They have also implemented
another method which uses motion sensors to detect any
I. INTRODUCTION motion of an object or a person and compared the two
We are in a world of digital transformation. In every aspect methods. Both the methods are successfully tested in an
technology is one common thing people depend upon. If we environment. But this method cannot detect more than one
look back in the 1970s, people used to count visitors manually person at a time. If two persons pass through the system side
by counting them or they used a manual tally counter. But by side, the system will detect only one person.
today we can see that many methods have been introduced to Jeong Woo Choi and others [2] have proposed a method
count people without the need of any human presence. The that uses IR-UWB radar sensors for counting people. “IR-
sensors and cameras will simplify our job of counting the UWB radar uses an impulse signal that occupies wide
people. We just need to program them to perform the required bandwidth. It is a technology that transmits an impulse signal
task. The primary method of counting visitors include hiring and recognizes various situations by processing multiple
people to stand and manually count the number of guests or signals that are received after being reflected from multiple
workers who enter or exit from the venue or location. Even human and objects”. The algorithm devised for this method is
the tally counters are not user friendly and don’t have many implemented using ARM Cortex-M4 and Raspberry Pi 2
advantages. Therefore, these methods prove to be unreliable modules. Two IR-UWB sensors with antennas are fixed to
and come at a great cost. count the number of people. Though the system can detect
In recent times, counting visitors has become an essential task multiple people at a time, it is not cost efficient. The sensors
for people working in sectors which include customers where are high expensive in the market.
the number is used as a satisfaction tool by the administrators. Another approach using IR sensors was proposed by
Hence, people began researching methods to count people Jothibasu M, Aakash B and others [3]. IR sensors play a vital
efficiently without hindrance. Since then many methods have role in identifying objects. In this method, two IR sensors are
been introduced which are now used in various sectors around placed adjacent to each other which detect the visitors. “The
the world. However, there are certain disadvantages with logic behind the working of the counting process is simple,
every method and it is up to the administrators to decide the when the person crosses the sensor near the door and then to
best method to count visitors. One method might be the sensor away, it recognizes as an increment in count”.
efficacious but extremely expensive. Another one can be quite Apart from being a bi-directional counter, this method can be
feasible and cheap but not efficient. used to control home appliances and helps in consuming less
The objective of this paper is to provide a suitable solution for electricity. This method cannot detect more than one person at
counting people in an office or a place where the intensity of a time. If two persons pass through the system side by side,
people is moderate to high. The solution used basic sensors the system will detect only one person.
such as IR and piezoelectric and are programmed using a Jingwen Li [4] have designed an approach that uses Bag-
development board called Arduino. This paper is intended to Of-Features (BOF) model to count the number of pedestrians.
provide an efficient yet inexpensive solution for people who “The system can also select pedestrians and non-pedestrians
are in need of it. samples automatically and update the classifier in real-time to
make it more suitable for certain specific scene. The dataset

IJERTV9IS090456 www.ijert.org 851


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 9 Issue 09, September-2020

used is CASIA pedestrian counting dataset and trained using calibrate the distance range at which the object should be
SVM classifier. The system requires real time monitoring of detected.
the pedestrians via camera modules which are very expensive.
Kartik Madhira and Aditya Shukla [5] have proposed a
method that uses image processing techniques to count human
specific areas such as ATMs, retail shops, malls etc. “The
people counter solution was made using computer vision
library OpenCV for Python computer language”. The method
achieved around 80-93% accuracy. The cameras were
positioned in many angles to test the accuracy of the method.
The system requires real time monitoring of the persons via
camera modules which are very expensive.
Shubham Mathur and others [6] have come up with a Fig. 1 Infrared Sensor
method that uses image processing with sensor feedback for
counting people entering or leaving a lab. Histogram of The sensor consists of three pins namely vcc, ground and vin.
oriented gradients (HOG) technique was used for this method. The vcc pin is connected to a 5 volts DC supply to power up
The images are captured using Raspberry Pi fitted with a the sensor. The ground pin is connected to ground. The vin pin
RaspiCam. A pair of PIR sensors is installed to instruct the is connected to one of the digital input/output (I/O) pins of
system to capture the images. The data can be sent via arduino. Once powered up, the sensor transmits IR light.
Bluetooth to local servers for security purposes. An efficiency Whenever there is an obstacle in front of the sensor, the light
of 83% is achieved using this method. The equipment used in will get reflected which is detected by the IR receiver.
this system is very expensive. The sensors add extra cost to B. Piezoelectric sensor:
the system apart from camera module and Raspberry Pi. The piezoelectric sensor has the ability to convert mechanical
Another method proposed by Dr.P.Satyanarayana and stress to electrical energy (AC output). The principle involved
others [7] involves the use of OPEN CV3 using python 3.5.2. is piezoelectric effect. It is a reversible effect means if electric
“The implementation goes on like the process of background energy is provided, mechanical stress is induced. Common
subtraction on the incoming frames followed by the blob materials used in piezoelectric sensors are quartz, Rochelle
analysis using which the person can be detected and by using salt. Synthetic materials including zinc oxide and gallium
virtual lines, the count of the people entering and leaving a arsenide are also used.
particular area can be evaluated”. The system requires real The sensor has two terminals namely positive and negative.
time monitoring of the persons via camera modules which are The positive terminal is connected to one of the analog pins of
very expensive. arduino and the negative terminal is connected to ground. By
David Beymer [8] proposed a method that involves 3D pressing the sensor, the mechanical energy produced is
stereo vision. “The stereo system performs real-time 3D converted to electrical energy.
reconstruction by employing table lookup to map from image
coordinates and disparities to 3D. Based on the 3D
coordinates, the scene is (1) segmented by filtering out pixels
outside the volume of interest, and (2) reprojected to a top-
down, orthographic view. Finally, people are detected and
tracked in the orthographc reprojection using a Gaussian
mixture model and Kalman filtering”. The system requires
real time monitoring of the persons via camera modules which
are very expensive.
III. CONSTRUCTION
A. Infrared sensor:
An infrared (IR) sensor emits and detects infrared radiation. It
is used to detect obstacles. An IR sensor consists of IR
transmitter, receiver, operational amplifier (Opamp), variable
resistor and an light emitting diode (LED) in brief. IR Fig. 2 Piezoelectric Sensor
transmitter is an IR LED which emits light in the range of C. Arduino UNO
infrared frequency. IR light is invisible to us because the Arduino is an open-source microcontroller board based on
wavelength of IR radiation (700 nm – 1mm) is much higher ATmega328p microcontroller [11]. It is one of the popular
than visible light. IR light have emitting angle of development boards used for experimental purposes and it
approximately 20-60 degrees with a range of approximately serves as an intermediate to Internet of Things (IoT) [12]. The
few centimeters to several feet. board consists of other components such as serial
The photodiode receiver acts as the IR receiver which detects communication, crystal oscillator, voltage regulator etc. It
the reflected IR light. Photodiode is an LED with black color consists of 2 KB of RAM, 1 KB of ROM, flash memory of 32
coated on its outer side. The Opamp is used as a voltage KB and can be easily programmed with the open-source
comparator in the IR sensor. The variable resistor is used to software Arduino IDE.

IJERTV9IS090456 www.ijert.org 852


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 9 Issue 09, September-2020

It also includes 14 digital I/O pins for both reading and writing whenever a person passes through the mat it records the signal
data, and 6 analog pins for reading input: and the value is high for a certain period of time. The person
GND (3 pins): Abbreviation for ‘Ground’. The board consists then passes by the IR sensor which detects the entry. The
of 3 pins and is used as the negative terminal of any sensor or algorithm is designed in such a way that if both piezoelectric
circuit connected to the Arduino. and the entry IR sensor are high at the same time, it detects the
5V & 3.3V: These pins supply 5volts and 3.3 volts of power person and the count is increased by one.
to the circuit respectively. Most sensors are designed to be
compatible with these 2 voltages.
Power: All Arduino boards require a power source to run on.
There are two ways to power the board. The first is by using a
USB cable connected to a computer. Alternatively, the board
can be powered by connecting it directly to a wall power
supply using the barrel jack given. But the voltage of the
power source should be in the range of 6-12V.
Analog: Analog pins are designated under ‘Analog In’ label
and consist of pins A0 to A5. These pins can read signals from
analog devices such as piezoelectric sensors and convert it to
binary data for the processor to read.

Fig. 4 Hardware of the project which includes IR sensors and piezoelectric


mat
When a person exits and passes through the mat, the weight of
the person is converted to an electrical signal, which surpasses
the threshold and is set high. The person then passes by the IR
sensor which detects the exit. Now since both the sensors
(piezoelectric and exit IR sensor) are set high, the system
detects the person is leaving and the count is decreased by
one. The person passes through both the IR sensors but since
there is a delay in activating the piezoelectric sensor, only one
of the sensors get time to detect by the time a person passes
Fig. 3 Arduino UNO through the system and count is detected.
The system is designed so that even if two persons enter or
ATMEGA 328P-PU: ATmega328 is a single-chip exit simultaneously the threshold is set to detect the two
microcontroller. persons and the count is increased by two.
Digital: The Digital pins are numbered from 0 to 13 on the
Arduino UNO. They are used for both digital inputs like
accepting data from a digital sensor and also as digital outputs
like powering an LED.
Reset button: Pushing the reset button restarts the code
uploaded to the board.
Main IC: The black cuboid with metal legs is the most
important part of arduino, known as an Integrated Chip or IC.
The IC used in arduino UNO is the microprocessor
ATmega328P.
IV. METHODOLOGY
The system consists of a piezoelectric mat. The piezoelectric
sensors are distributed evenly on the mat and the connections
are made to the analog pin of Arduino UNO board. Two IR
sensors are installed at either end of the mat at a sufficient Fig. 5 inside view of the piezoelectric mat
height from the ground. The first IR sensor which is
programmed to detect the entry of a person is placed on the
exit side of the mat. The second IR sensor which is
programmed to detect the exit of a person is placed on the
entry side of the mat.
When a person enters and passes through the mat, the weight
of the person, which is in the form of external stress to the
piezoelectric sensor, is converted into an electrical signal. The
electric signal is greater than a certain threshold, and the
digital output is high. The threshold value is set so that

IJERTV9IS090456 www.ijert.org 853


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 9 Issue 09, September-2020

V. BLOCK DIAGRAM VI. RESULTS


The counter system is designed to detect the number of
START visitors entering or leaving the premises. The experiment is
performed in a room. A total of five scenarios were
considered. Results were obtained which are mentioned in the
following table.

PERSON PERSON
ENTERS EXITS

PIEZOELECT PIEZOELECT
-RIC -RIC
SENSORS SENSORS Fig. 6 Scenario 1 – One person entering the room
ACTIVATED ACTIVATED

ARDUINO ARDUINO
MICROCONT MICROCONT
-ROLLER -ROLLER

\ ENTRY IR EXIT IR
SENSOR SENSOR
ACTIVATED ACTIVATED
Fig. 7 Scenario 2 – One person leaving the room

ARDUINO ARDUINO
MICROCONT MICROCONT
-ROLLER -ROLLER

COUNT COUNT
INCREASED DECREASED
IF BOTH IF BOTH
SENSORS SENSORS Fig. 8 Scenario 3 – Two persons entering the room at the same
ARE HIGH ARE HIGH

IJERTV9IS090456 www.ijert.org 854


(This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by : International Journal of Engineering Research & Technology (IJERT)
http://www.ijert.org ISSN: 2278-0181
Vol. 9 Issue 09, September-2020

distance. The size of the mat can also be increased based on


the area available. The data can be sent to cloud and store it
for future use. The data can also be monitored live for security
purposes and can be used for further IoT applications.

REFERENCES
[1] Carvalho, Bruno & Silva, Caio & Silva, Alessandra & Buiati,
Fábio & de Sousa Junior, Rafael. (2016). Evaluation of an
Arduino-based IoT Person Counter. 129-136.
10.5220/0005954601290136.
[2] J. W. Choi, X. Quan and S. H. Cho, "Bi-Directional Passing
People Counting System Based on IR-UWB Radar Sensors,"
in IEEE Internet of Things Journal, vol. 5, no. 2, pp. 512-522,
April 2018, doi: 10.1109/JIOT.2017.2714181.
[3] Jothibasu M, Aakash B, Shanju Ebanesh K, Gokul Vinayak L,
Fig. 9 Scenario 4 – Two persons leaving the room at the same time “Automatic Room Monitoring with Visitor Counter (ARM –
VC)”, IJITEE, Volume-8 Issue-7, May, 2019
[4] Jingwen Li, Lei Huang and Changping Liu, "An efficient self-
learning people counting system," The First Asian Conference on
Pattern Recognition, Beijing, 2011, pp. 125-129, doi:
10.1109/ACPR.2011.6166686.
[5] K. Madhira and A. Shukla, "Pedestrian flow counter using image
processing," 2017 International Conference on Energy,
Communication, Data Analytics and Soft Computing (ICECDS),
Chennai, 2017, pp. 1911-1915, doi:
10.1109/ICECDS.2017.8389782.
[6] S. Mathur, B. Subramanian, S. Jain, K. Choudhary and D. R.
Prabha, "Human detector and counter using raspberry Pi
microcontroller," 2017 Innovations in Power and Advanced
Computing Technologies (i-PACT), Vellore, 2017, pp. 1-7, doi:
10.1109/IPACT.2017.8244984.
[7] Dr.P.Satyanarayana , P.Gopikrishna , K.Soukhya , M.Satvik ,
Y.CharanKumar, “A Robust Bi-Directional Algorithm For People
Count In Crowded Areas, IJPAM, Volume 116 No. 6 2017, 73-78
[8] K Mohana Prasad et al 2019 IOP Conf. Ser.: Mater. Sci. Eng. 590
Fig. 10 One person entering and other person leaving the room at the same 012012.
time [9] Beymer, David. (2000). Person counting using stereo. 127-133.
10.1109/HUMO.2000.897382.
[10] Wikipedia contributors. "Piezoelectric sensor." Wikipedia, The
Free Encyclopedia. Wikipedia, the Free Encyclopedia, 28 Jun.
2020. Web. 18 Aug. 2020.
[11] Arjun Varma, Ashwath A, Ayush Verma, A. Bagubali, Kishore V
Krishnan, “Implementation of Obstruction Avoiding Robot using
Ultrasonic Sensor and Arduino UNO”, IJRTE, Volume-8 Issue-4,
November 2019.
[12] Wikipedia contributors. "Arduino." Wikipedia, The Free
Encyclopedia. Wikipedia, the Free Encyclopedia, 18 Aug. 2020.
Web. 18 Aug. 2020.
[13] Dhaief, Zahraa. (2016). People Counting Technology.
Fig. 11 Results of the experiment 10.21884/IJMTER.2016.3142.ABPRK.
[14] S. Saxena and D. Songara, "Design of people counting system
using MATLAB," 2017 Tenth International Conference on
VII. CONCLUSION AND FUTURE SCOPE Contemporary Computing (IC3), Noida, 2017, pp. 1-3, doi:
The counter system has the ability to detect two simultaneous 10.1109/IC3.2017.8284344.
visitors, entering or leaving at the same time. The system is [15] S. Saxena and D. Songara, "Design of people counting system
developed using Arduino UNO development board and it’s using MATLAB," 2017 Tenth International Conference on
Contemporary Computing (IC3), Noida, 2017, pp. 1-3, doi:
IDE. The project uses two IR sensors and several piezoelectric 10.1109/IC3.2017.8284344.
sensors for more accuracy and precision. Arduino helps
achieve the coordination among the sensors.
The system is designed to use at places like laboratories or
classrooms where the intensity of crowd is intermediate. The
system can be enhanced by installing industrial IR sensors
which have better sensitivity at detecting persons at sufficient

IJERTV9IS090456 www.ijert.org 855


(This work is licensed under a Creative Commons Attribution 4.0 International License.)

You might also like