ARM based Bidirectional Visitor Counter and Automatic Room Light Controller using PIR sensors

ARM based Bidirectional Visitor Counter and Automatic Room Light Controller using PIR sensors

Volume 1, Issue 5, Page No 10-15, 2016

Author’s Name: Muhammad Umar Farooqa),1Aamna Shakoor1, Abu Bakar Siddique2

View Affiliations

1Electrical Engineering Department, University of Engineering and Technology Lahore, 54890, Pakistan

2 Electrical Engineering Department, University of Engineering and Technology Lahore, 54890, Pakistan

a)Author to whom correspondence should be addressed. E-mail: mufarooq40@gmail.com

Adv. Sci. Technol. Eng. Syst. J. 1(5), 10-15 (2016); a DOI: 10.25046/aj010503

Keywords: Bidirectional Visitor counter, Automatic Room Light Controller, ARM Cortex, PIR motion sensor

Share
927 Downloads

Export Citations

With the advancement of technology intelligent devices are fast approaching the realm of necessity from the status of luxury. With limited energy resources, it is the need of time to revolutionize the traditional methods of counting visitors inside hotels, recreational places, meeting rooms and cinemas to control the electrical appliances. Moreover, the improved living standards demand developing circuits that would ease the complexity of life. Many systems have been developed to fill this technological gap but most of them are not applicable in real time scenarios due to their limitations. This paper describes the development and implementation of real time bidirectional visitor counter along with automatic room light controller. The proposed system keeps track of visitors visiting a room as well as takes over the control of the room lights. As a visitor enters the room, the count is incremented by one and the lights are switched on. While the count is decremented if a person leaves the room. Lights of the room are switched off only if there is no person inside. Though a number of systems have been developed in this field but most of them are not practically applicable due to outdated technology. In this paper, we have used state of the art components to develop a practically applicable system. Finally, the system was deployed and tested in real world situations to enumerate its efficiency.

1. Introduction

      Most of the regions in the world are undergoing a wave of terrorism. Ongoing circumstances has made one’s life completely uncertain. Both developing and developed countries are facing terrorists attacks on social places, not sparing even hotels, schools and care centers. Aftermath of such incidents is large number of causalities. Human deaths and injuries are estimated by trial and error method [1]. Visitor detection check is also vital for no-go and restricted areas. Moreover, in limited sitting places such as cinemas, conference and meeting rooms, it is necessary to keep track of total number of visitors. This requires a system capable of keeping count of and check on total number of visitors in a zone or a building.

      Bidirectional Visitor Counter (BVC) is a system used to count the visitors entering and leaving a room. The word bidirectional signifies the count of both types i.e. entering and leaving. When a person enters the room the count is incremented and when a person leaves the room that count is decremented. Bidirectional counters are designed accordance with the real time demands. The design becomes tedious for single door systems where all the visitors are going in and coming out through a single channel.

      The energy sources are going scarce. In developing countries the energy consumption rate is higher than the production rate. Therefore it is the need of time to save the energy as

Figure 1: Architecture of Bidirectional Visitor Counter and Automatic Room Light Controller

appliances are manually operated. Most of the times, the electric lights and fans are left running even in the fully evacuated rooms. It demands a shift towards an automated system in order to save energy. This paper describes the development and real time implementation of a bidirectional visitor counter and Automatic Room Light Controller (ARLC). Room light controller works on top of the information gathered through BVC. As soon as the net accumulated counter value falls to zero, the lights of the room and the fans will be turned off to save electricity. The room is automatically re-energized when the count is incremented.

      Contrasting to previously developed systems on conventional microcontrollers like PIC and Atmel and limited ranged Infra-Red sensors (IR Sensors), we have used state of the art technology. Though the work can be done by conventional microcontrollers, but with increasing computer technology, it is difficult to program most of those microcontrollers. Moreover, with advanced field of study, researchers and the students are interested in state of art microcontrollers rather than conventional ones. So, our system may be regarded as shift of a developed system from conventional to state of the art technology.

2.     Literature Review

      Before the advancement of information systems, counting of visitors passing through a location used to been done manually. The room appliances are still mostly controlled manually in most parts of the world that often leads to power wastage in case of personal negligence. With the innovation in technology, many electronic systems such as bidirectional visitors’ counters and automatic appliance controllers have been developed to keep check of the visitors visiting a hall and controlling the lights of that room [2-8]. the visitors up and down using output from a IR sensor. These sensors consist of an IR transmitter/receiver (TX/RX) pair. The design of BVCs can be quite simple for two door systems. Where one door is dedicated for entering and the other for leaving. One sensor monitors for the visitors entering and the other one monitors the visitors leaving the room. This is the scenario for which many projects have been developed [2], [5], [8]. But the design becomes more challenging for single door systems where all the visitors are entering and leaving through the single channel. The conventional systems employ IR Transmitter receiver pair, each installed on opposing sides of the door [3]. In such systems, the sensor height, sensor alignment and power supply availability to both the devices offer many installation hurdles. The system can still fail to detect a kid if the installing height of sensors is a larger than the kids’ height. Similarly, some visitors may also pass through channel without being detected if the height of the sensors is too low. Moreover, most of the existing systems are based on unreliable IR sensors with their limited range and poor detection with transparent or bright colored materials [11].

      In comparison to the older systems, we have used practically applicable PIR sensors rather than ordinary IR sensors. Typical IR sensors used by earlier developers, have much limited range [11]. They can be used to successfully develop a model of sensing range of a few centimeters to inches. However, for practical application on several feet wide doors, PIR sensors are the best choice that we have used in our design. Moreover, a number of conventional microcontrollers were programmed through serial/parallel ports on PC which have been vanished from most of the present laptops and PCs used by a university student. It echoes to shift older technology on the state of the art microcontrollers. That’s why we used a latest microcontroller developed by Texas Instruments (TI).

3.     Proposed System

      The proposed system is designed using ARM cortex based microcontroller, a seven segment display and two PIR sensors. One of the sensors is installed just outside and the other one just inside the door. Microcontroller determines whether a visitor is coming in or going out by reading the output sequence of the two sensors. We will call the outside sensor Sensor-A and the inside sensor as Sensor-B throughout this paper. The output of the microcontroller derives a relay circuit that turns on the lights of the room when the counter is incremented from 0. All the lights and fans remain turn on until the count is again decremented to its initial value of zero. The flow of our proposed algorithm is shown in Figure 1.

4.     Materials and Methods

4.1.  Materials

      Prior to moving to the working methodology of our system, the used materials are discussed briefly here. Following components has been used in our proposed system:

  • Power Supply
  • Tiva C Launchpad
  • PIR proximity sensor
  • HC-SR501
  • Common Anode 7-segement display and driver circuit
  • Single Relay Module

4.1.1.       Power Supply

To provide power to all the components of proposed system, we developed a power supply unit. The first part of this unit is a transformer that steps down 220 V AC mains to 12 V AC. These low voltages are then rectified through a full-wave rectifier. The rectified output is then filtered through filter capacitors and regulated to 5 V DC using a 7805 linear regulator. This supply

Figure 2: Tiva C Launchpad microcontroller TM4C1233H6PM [10]
Figure 3: HC-SR501 PIR proximity sensor [9]

unit powers all the components including microcontroller, sensors, seven segment driver circuit and the relay module.

4.1.2.       Tiva C Launchpad

      In the design we have used ARM Cortex-M (TM4C1233H6PM microcontroller) based Tiva C Launchpad (by Texas Instruments) shown in Figure 2. Details of the microcontroller are given in [10]. The board requires 5 V regulated power supply on VBUS and GND pins. The power is provided through regulated supply of 5 V. Six GPIO ports are available on the board with nomenclature Port A, Port B, Port C, Port D, Port E and Port F. We make use of selected pins from port A, B, E and F. Port A and B are used to provide power and data to 7-segment display respectively. Port E is used to integrate PIR sensors’ interrupts and single relay module. The status indicator LEDs are connected to port F. The microcontroller drives and reads the PIR sensors, the 7-segment display and trigger the relay switch.

4.1.3.       PIR Proximity Sensor

      For visitor detection, we have used two Passive Infra-Red (PIR) proximity motion sensor HC-SR501 as shown in Figure 3. Operating voltage range of sensor is from 4.5 V to 20 V and the power is provided through the supply unit described in first section. Delay time and block time of the sensors are adjustable. The sensing range of HC-SR501 is about 120 degrees up to the distance of seven meters [9]. Though the linear range is useful for most practical scenarios, we found out experimentally that the angle is too wide for satisfactory operation of visitor counting in real world scenarios. The solution of this problem is also discussed in order to improve efficiency. PIR sensors sense an object by comparing the heat emitted by the moving object and the background. So, such sensors must be installed only for stationary backgrounds and heat invariant environments to avoid false switching. Ambient temperature conditions for HC-SR501 is exactly in accordance with room temperature conditions of most of the regions including Asia and some of the European countries.

Figure 4: Single Relay Module

Figure 5: Signal loss due to non-overlapping proximity area

4.1.4.       Common Anode 7-Segment Display

     To display the number of visitors inside a room, we have used a common anode 7-segment display. For this purpose, a driving circuit is designed using four NPN transistors. The driving circuit is powered from the same power supply.

4.1.5.       Single Relay Module

      This module controls the electric appliances. In common, the room appliances operate on 220 V. So, the single relay module turns on and off these appliances of the room in accordance with the output of bidirectional visitor counter. Single relay module is designed using 5 V DC-220 V AC relay (Figure 4). Relay is triggered by the signal asserted on GPIO pin of microcontroller. As soon as the count is incremented from zero, the relay module triggers and turns on the appliances. The relay moves back to its initial condition only when count falls to zero again.

4.2.  Methodology

4.2.1.       Working

      When a visitor enters a room, it is detected sequentially first by sensor A and then by sensor B. The microcontroller recognizes that sequence and increments the occupancy counter. It can be problematic if there is non-overlapping proximity area of sensors (shown in Figure 5 as a typical case). As soon as anyone of the sensors senses a motion, the corresponding signal is asserted. This signal remains high for a specific time interval after the sensor output goes low. This signal gets away with the problems created by non-overlapping proximity area.

      The working of our proposed system is shown in Figure 6. The dotted line shows the door and the Signal-A and Signal-B are the corresponding signals

Figure 6: Working methodology of our purposed system when a visitor enters

Figure 7: Working methodology of our purposed system when a visitor leaves

asserted by Sensor A and Sensor B respectively. Same analogy is used for decrementing the occupancy count with only difference that the sensors sequence will be reversed as is shown in Figure 7.

4.2.2.       Pseudo Code

The pseudo code of the algorithm is given in Algorithm. 1

5.     Testing and Results

      The real time testing was done on main entrance of Department of Electrical Engineering, UET Lahore. The testing under controlled conditions produced 100 % accuracy. The wrong triggers were avoided by allowing just one visitor to be in the range of the sensors at a time. However testing in real time conditions produced about 60 % efficiency the cause of which was diagnosed to be the wide sensing angle of PIR sensors.

      In order to increase the efficiency in this scenario it was required to optimally reduce this wide angle. We added an extra view restricting geometry in front of the sensors as depicted in Figure 8 . Due to this addition, we were able to reduce the angle range from 120 degrees to only 40 degrees. Testing this new design in real time improved the accuracy to 96 %.The error of 4 % was found when two persons passed

Figure 8: Geometry used to reduce wide angle

before the sensors exactly at the same time. It can be avoided by queueing on the entrances of highly recommended places. For second testing, a class room of the department was chosen. The whole system including BVC and ARLC was tested in this last phase. The system yielded 100 % efficiency by accurately counting the students entering and leaving the class room and turning on and off the lights accordingly.

6.     Conclusion

      Replacement of the outdated technology with latest one, have made us enable to develop a practically applicable BVC system that produced highly efficient results in practical scenarios. The system is an effective addition for security systems. It may be implemented at sensitive buildings and highly secret meeting rooms. Moreover, it relaxes the management burden in public recreation and limited seats places such as cinemas. In addition to visitor counter, automatic room light controller produces amazing efficiency to control the room appliances which is a desired product for energy deficient developing countries.

7.     Future Work

      The project can be expanded in various projections. For time being, we have controlled room lights in digital manner such that the lights are turned off automatically when no person is inside the room and turned on automatically when the count is incremented. We intend to control light intensity based on the number of people inside the room. It will be more power friendly in order to save energy. We will also embed with Internet of Things (IoT) technology and WLAN connectivity for observations on world wide web. Moreover, we have intended to develop an automated ticketing systems at cinemas and recreational places to reduce the further load of the management.

Conflict of Interest

The authors declare no conflict of interest.

Acknowledgment

The authors would like to thank Department of Electrical Engineering, UET Lahore for their support to fulfill the laboratory and equipment requirements for the completion of this project.

Received: 28 July 2016, Accepted: 25 September 2016, Published Online: 27 October 2016

  1. Edje E. Abel, Ureigho Roy Joel, “Information Systems: The pprospects of bi-directional counter system in the hotel industry”, Found. Comp. Sci. 2(9) (2015).
  2. Gaurav Waradkar, Hitesh Ramina, Vinay Maitry, Tejasvi Ansurkar, Asha Rawat, Parth Das, “Automated room light controller with visitor counter”, Imper. J. Interdisc. Res., 2(4): 777-780 (2016).
  3. Mathur, K. S. Nagl, “Microcontroller-based bidirectional visitor counter”, Electronics for You, 78-81 (2007). [Online] Available: http://www.scribd.com/doc/49533576/BiDirectional-VisitorCounter, Accessed in June, 2016.
  4. Mohanaprakash, Sathya, Dhanabal, “Modern multipurpose security and power management system”, Int. J. Eng Res. Gen. Sci., 3(2): (2015).
  5. Shah, P. Savaliya, M. Patel, “Automatic room light controller with bidirectional visitor counter”, Int. J. ICT Res. Develop., 1(4): (2015).
  6. Kimbley, R. Mehrotra, SA Khan, S. Pawar, “Automatic room light controller using microcontroller and visitor counter”, Int. J. Res. Engg. Techno., 5(3): (2016).
  7. Dey, S. Chakraborty, S. Islam, M. Pramanik, Md. AH Malick, “Design of controllable bidirectional visitor counter” , Int. J. Innov. Res. Elect Electro., Instru. Cont. Engg., 4(5): 133-136 (2016).
  8. H. Majumdar, H. Biswas, H.A. Shaim, K.T. Ahmmed, “Automated Energy Saving and Safety System” in International Conference on Electrical Engineering and Information & Communication Technology (ICEEICT) 2014.
  9. Tiva TM4C1233H6PM Microcontroller, Datasheet [Online]. Available:. http://www.ti.com/lit/ds/symlink/tm4c1233h6pm.pdf, accessed in June, 2016.
  10. “Tiva C. Launchpad DataSheet” , [Online]. Available:. http://www.ti.com/lit/ds/symlink/tm4c1233h6pm.pdf, accessed in June, 2016.
  11. Saracoglu, “A Guide to IR/PIR Sensor Set-Up and Testing” , Michigan State University.

Citations by Dimensions

Citations by PlumX

Google Scholar

Scopus

Crossref Citations

  1. Mohammed Azher Therib, Heyam A. Marzog, Marwa Jaleel Mohsin, "Smart Digital Bi-Directional Visitors Counter Based on IoT." Journal of Physics: Conference Series, vol. 1530, no. 1, pp. 012018, 2020.
  2. Muwaffaq I. Alomoush, "Application of the stochastic fractal search algorithm and compromise programming to combined heat and power economic–emission dispatch." Engineering Optimization, vol. 52, no. 11, pp. 1992, 2020.
  3. Indra Kishor, Akshay Sharma, Gargi Singh Tanwar, Udit Mamodiya, "A Smart BiDirectional Visitor Counter System Designed for Single Door Entry & Exit Setups with Dynamic Tracking and Data Regression Analysis based on IoTML." In Proceedings of the 5th International Conference on Information Management & Machine Intelligence, pp. 1, 2023.
  4. Sumeeth Asnani, Ashwini Kunte, Mohammed Hasan Charoliya, Nivaan Gupta, "Temperature actuated non-touch automatic door." In 2021 2nd International Conference on Smart Electronics and Communication (ICOSEC), pp. 669, 2021.
  5. Marc Joshua Rivera, Deiscart D’Mitrio C. Maceda, Andrew G. Bitancor, Leonardo C.Sawal, Rose Ann R. Blanqueza, Natalie Joy dJ. Dazo, Hannah Faye L. Sabillo, "Energy-Saving Wireless Bidirectional People Counter with Notification and Data-Storing Systems." In 2023 IEEE 13th International Conference on Control System, Computing and Engineering (ICCSCE), pp. 7, 2023.

No. of Downloads Per Country

Special Issues

Special Issue on Computing, Engineering and Multidisciplinary Sciences
Guest Editors: Prof. Wang Xiu Ying
Deadline: 30 April 2025

Special Issue on AI-empowered Smart Grid Technologies and EVs
Guest Editors: Dr. Aparna Kumari, Mr. Riaz Khan
Deadline: 30 November 2024

Special Issue on Innovation in Computing, Engineering Science & Technology
Guest Editors: Prof. Wang Xiu Ying
Deadline: 15 October 2024