Motion Detection System Using Passive Infrared Technology

Having technology around us that can be used for household and entertainment purposes to signal any potential threat in our surroundings and trigger alerts is vital. The study designed a technology that is aimed at providing security to the environment and properties since it can detect movement at a certain angle and also give an alert. The system used a Passive infrared radiation (PIR) module HC-SR501 to detect motion and an Arduino uno microcontroller unit (MCU) to process and control the sensor data. The PIR sensors detect infrared radiation emitted by moving objects, such as human beings or animals. Several tests showed that the system performed well under different conditions, with the PIR sensor able to detect motion at different sensitivities distances, and angles. The designed prototype system reveals that our environment, properties, and even human lives can be secured, hence the technology can be deployed as a surveillance. However, the limitation could be power outages from public utilities, in terms of functionality.


Introduction
It is not an understatement to say that security is crucial to human living circumstances [1].One's possessions are invaluable and should be protected.To lessen the impact of loss or other IOP Publishing doi:10.1088/1755-1315/1342/1/012001 2 unaccounted expenditures associated with the replacement of stolen or lost objects, surveillance of personal belongings or other products that will engage a form of safety and protection must be secured [2] [3].The security industry introduces technology to curb, and spot any property theft or unauthorized motion [4] [5].Furthermore, in acquiring the tools for security, it is important to identify the right equipment, tools, and materials for the job, hence the advent in security if and when employed right will alleviate such tensions, stress, anxiety, and monetary waste that has not been accounted for by engineers, and scientist, on a side note, the Passive infrared (PIR) sensors can be applied to a decoration piece [6][7] [8].Passive Infrared Radiation (PIR) technology has undergone testing and experimentation and has been successful under normal testing conditions with a 95% confidence level [9] [10] [11].
PIR is an electromagnetic radiation that has wavelengths longer than visible light and shorter than radio waves [12] [13].It is invisible to human eyes but we can feel it as heat.Every object/matter occupying space in the universe emits some level of infrared radiation.Passive infrared radiation (PIR) technology has been associated with smart technology, the Internet of things (IoT) technology, cloud-based services such as; software as a service (SaaS), platform as a service (PaaS), and other cloud-based technology.It has been implemented with motion sensors for touchless lighting interfaces [14], [15], closed-circuit televisions (CCTVs), reading lamps, etc. Passive infrared radiation (PIR) sensors use a pair of pyroelectric sensors to detect heat energy in the surrounding environment [16] [17].Asha et al [18] presented sensor-based systems versatility safety systems that could be deployed to prevent injury in chaff cutter machines.The study addressed the detection of injury related to high-speed hand movement.The result provided valuable insights into optimizing the system's performance and gave practical recommendations for creating a safer working environment in agricultural settings.The study was able to the risk of injuries, only to the upper limb and improve the overall well-being, productivity, and health status of farmworkers, but did not investigate the motion of the full human being.Lasla et al [19] proposed a wireless energy-efficient system based on passive infrared sensors the system was integrated into an existing building for detection for accuracy.The installation is to facilitate the optimal PIRs placement on energy consumption, settings, notably in the buildings without complication and to be battery operated.The study results showed that the system has a lifespan of over 6 years without battery replacement.Juntunen et al [20] developed a smart LED controlled lighting pilot considering movement tracking in housing areas in Helsinki.The system saves energy, provides safety and security for users in the dark along the route.The controlled system was implemented with passive infrared sensors.However, the study had a gap in the area of temperature, strong wind in a cold environment created false sensor activity.The PIR was adopted for this study because Nigeria being a hot temperature environment would be conducive for its operation.Hence designing an efficient and reliable motion detection system using PIR technology to accurately detect and respond to movement in a given environment is vital.

Overview of the System
The proposed system is a designed data acquisition (DAQ) system of motion detection employing PIR technology.The PIR sensor was connected to the arduino board to control its output.The microcontroller was programmed to activate both a buzzer and a light emitting diode (LED) and 3 display a message when motion has been detected by the PIR sensor.To achieve perfect functionality, the output pin of the PIR sensor was connected to one of the digital input pins on the microcontroller while the buzzer, Liquid Crystal Display (LCD), and LED were connected in series to digital output pins on the microcontroller.When motion has been detected by the PIR sensor, it sends a signal to the microcontroller which converts it from an analog signal to a digital signal.Thereby activating both the buzzer and LED, thus displaying the message "motion detected" simultaneously.Figure 1 illustrates the block diagram of the proposed motion detection system.

System Design
The system design was made up of various components interconnected to perform the desired functions, which include the power supply, a DC power source connected to the Arduino uno microcontroller, pyroelectric sensors, Fresnel lens, LCD, and buzzer.The power consumption analysis was considered using the following power ratings as defined in equation 1 -4.Table 1 summarizes the power consumption of the Motion Detection System (MDS).
Where; P = Actual power rating (W).

Circuit Simulation
Several prototyping software approaches were considered.The Proteus design suite was chosen as the most preferable simulator due to its simplicity and user-friendly environment.It was used to design the component arrangement for the hardware block, where each part with its rating was tested before actualizing it as a physical prototype.Tests and experimentation were performed in the design suites to calculate the required power ratings and account for all faults where necessary.Through multiple simulation runs, slight variations in the study outcome were observed.These variations allowed for the achievement of the study objectives.The Arduino uno (ATmega328p) microcontroller was programmed using Arduino integrated development environment (IDE) and subsequently simulated.Multiple iterations were performed and errors that were derived during the simulation were troubleshot.

System Hardware Components
The system hardware designed for the MDS involved the connection of several components, to ensure proper functioning of the system prototype.

i. Pyroelectric sensor
A pyroelectric sensor was deployed to generates the electric charge whenever it is exposed to infrared radiation.Fig. 4 shows pyroelectric sensors are commonly used to detect infrared radiation emitted by humans or animals, as they have high sensitivity and low noise at room temperature [21].

ii. Fresnel Lens
It creates a shield against electromagnetic interference and also helps to maintain a constant temperature inside.The filter window is covered by a plastic lens that has multiple segments called Fresnel zones.The lens focuses the infrared light onto the pyroelectric material and also creates zones of detection that alternate between positive and negative polarity [22].A typical Fresnel lens is shown in Fig 5.

iii. The PIR sensor
It has an IC, a trimpot potentiometer, a jumper trigger, passive capacitors, and three pins that connect it to a power supply and an output device.In its idle mode, the current utilized is 0.05 mA and 65 mA when fully operational.The operating voltage of the PIR sensor ranges from 4.8 -20 V. Fig. 5 shows the PIR module HS-SR501.This is an audio signaling component that was deployed for the system implementation.It prompts an alarm.There are active and passive buzzers [23].Fig. 7 shows the active buzzer that was employed for the study.

v. Light Emitting Diode (LED)
The LED depends on the energy gap of the semiconductor material used in the LED.The LED (red) was employed.Its forward bias voltage is 2.39 V, and its forward bias current is 0.69 A.  This is a passive electronic component that limits or regulates the flow of electric current in a circuit.A 220 Ohm resistor-0.25 W power rating was used with LEDs to prevent them from burning out by limiting the current they consume.The 220 Ohm resistor is given in Fig. 9.   viii.Arduino Uno the Arduino uno microcontroller was deployed for the study.The arduino integrated development environment (IDE) usually referred to as "arduino sketch" is used to compile its code.Its six analog pins are labeled A0 to A5 with a resolution of 10 bits and a range of 0-5V [24 -27] .Fig. 11 shows the arduino uno R3 board.

System Implementation
This section presents the implementation and testing of the study, from both software and hardware perspectives.The initial implementation was tested through computer simulation in the proteus design environment.The section also discusses constructing and transforming initial ideas into tangible prototypes.

Software Implementation
The software component of this project was developed using the arduino integrated development environment (IDE) and the C++ programming language.However, some features of C++ are not supported by arduino, such as dynamic memory allocation, exceptions and templates.Therefore, the code written for arduino is a subset of C++ that resembles embedded C.During the specification stage, the system's functions were defined.In the development stage, code for the arduino microcontroller was written to implement the work's specifications.The code was written using C++ functions that can be called from a sketch, which is a file that contains instructions for an arduino board.The code was compiled using a C/C++ compiler (avr-g++) and uploaded to the board using a USB cable.Fig. 12 shows the source code of the MDS.The validation stage involved verifying that the system functions correspond to the specifications through testing and checking processes.Testing involved running the system under different scenarios and inputs to check its behavior and output.Checking involved inspecting the code for errors, bugs, or deviations from standards and guidelines.Finally, during evolution, provisions were made for modifying the software during and after system construction.This improved the performance, efficiency, and reliability of embedded systems.

Hardware Implementation
Power Supply Unit: The power supply unit (PSU) provided the necessary voltage levels for the system components.The LED and buzzer require a 5V power supply, which was obtained by implementing a voltage regulator, connected to the main 9 V battery power supply.The voltage regulator reduces the voltage from 9 V to 5 V to power the arduino uno board.
The hardware implementation involved two stages: i. Breadboard Testing: The PSU circuit was first constructed on a breadboard and tested with a multimeter to verify its functionality.The breadboard allowed for easy modifications and corrections of any errors.ii.Veroboard Implementation: After ensuring that the PSU circuit worked correctly on the breadboard, it was transferred to a Veroboard for a more permanent and robust solution as shown in Fig. 15.The Veroboard implementation was also tested with a multimeter to confirm its functionality.
Sensor Interconnection: The sensor interconnect consists of the PIR sensor that detects motion and activates an LED and a buzzer as indicators.The sensor network was connected to an arduino uno board that provided the logic and control for the system.The PIR sensor had three pins: Vcc (power), OUT (signal), and GND (ground).Table 2 designates how these pins were connected to their corresponding pins on the arduino uno board.

Results and Discussion
The MDS prototype system was tested for its functionality.

System testing:
Testing was carried out to verify the full integration of the software product.Fig. 18 displays that an object has been observed within its field of view.Fig. 19 displays that no object is within its field of view.

Angle Tests
Fig. 22 present the MDS situated on an elevated surface depicted that an object has been detected, at angle 180 degrees on a level surface, it was able to detect motion and trigger the appropriate responses from the dependent variables.In Fig. 23 at an angle of 120 degrees on a level surface, the PIR sensor was also able to detect motion and trigger the appropriate responses from the buzzer, LED and LCD.

Figure 22:
The MDS situated on an elevated surface depicted that an object has been detected.

Figure 23:
The MDS situated on a level surface depicted that an object has been detected

Conclusion and Recommendation
The study designed and built a PIR sensor module with appropriate circuitry, programming an MCU to process the signal from the PIR sensor module, and using indicators (LED and buzzer) to show the detection status of a motion detection system using PIR technology.PIR sensors detect infrared radiation emission from a moving object, such as people or animals.When an object moves within the sensor's field of view, the sensor detects a change in infrared radiation and triggers an alarm or other response.The technology is aimed to provide security to the environment and properties since it can detect movement and create awareness (alarm) at a certain angle.The results from the study can also be used for household and entertainment purposes to signal any potential threat in the surroundings and trigger run-time events respectively.However, calibrating the sensitivity and range of the sensor and testing the system in different environments presented some difficulties.Nevertheless, these challenges were successfully addressed through the utilization of online resources and experimentation with various configurations.Connecting the

Figure 2
Figure 2 illustrates the circuit diagram of the circuit simulation on Proteus software, depicting It elucidates the working process for the MDS in two phases; when motion has been detected and its passive state.The circuit diagram consists of the following components; an Arduino uno board, a PIR sensor (HC-SR501 module), a sixteen-by-two Liquid crystal display (16 X 2 LCD), and a buzzer with a 220-ohm resistor.
Fig 8 presents the deployed LED.

Figure 9 :
Figure 9: 220 -Ohm resistor vii.Liquid Crystal Display (16 x 2) screen The 16 x 2 LCD module is an electronic device that allows a microcontroller or computer to display readable information on a 16-character by 2-line liquid crystal display.It has pins that match the microcontroller's digital or analog pins and can communicate using parallel or serial interfaces.It was used to interface with the MCU which requires only two wires for communication, to indicate messages in response to input from a PIR sensor.Fig. 10 shows the 16 x 2 LCD.

Figure 12 :
Figure 12: The source code of the MDS

Figure 15 ,Figure 15 :
Figure 15: The Buzzer, LED and PIR sensor connected to the arduino uno.

Figure 16 :
Figure 16: The LCD connected to the arduino uno.

Figure 18 :
Figure 18:The MDS depicting that an object has been detected.

Figure 19 :
Figure 19:The MDS depicts that no object is within its field of viewThe results in Table3present the experiments conducted to test the effectiveness of using a PIR sensor in conjunction with a buzzer, LED, and I2C LCD module to report motion activation at distances of 1 m and a sensitivity of 1 m, the PIR sensor was able to detect motion and trigger the appropriate responses from the buzzer, LED, and LCD as shown in Fig 20 Also at 2 m, and a sensitivity of 2 m, the PIR sensor was able to detect motion and trigger the appropriate responses from the buzzer, LED and display motion on the LCD screen as seen in Fig.21.

Figure 20 :
Figure 20: The MDS sensing objects at 1 m.

Figure 21 :
Figure 21: The MDS sensing objects at 2 m.

Table 1 :
Summarizes the power consumption of MDS

Table 2 :
Arduino pin configuration with PIR sensor and indicators.

Table 3 :
The Summary of tests carried out.