Skip to content

Understanding PIR Motion Sensors

If you understand the times we live in, everything has become smart. You get to operate smart devices and live and work in smart houses or offices. The level and sophistication of connection between devices make life simpler. It also brings greater efficiency and productivity, though it calls for enhanced security and energy management efficiency. PIR motion sensors prove the go-to solution in ensuring this for security and BEM (building energy management). But how so?

The smart connected tech responsible for making BEM and security possible has increased the demand level for energy, thereby increasing energy costs. Further, the need to consider the environment also ranks high among many people. Consequently, good energy management becomes paramount. Coupled with the level of automation needed by most building occupants, it becomes necessary to have a system of monitoring the absence or presence of humans through on-demand energy management.

PIR Motion Sensors

Have you ever set foot in a building and the lights switch on and off? Have you also ever witnessed a controlled environment whenever people get into a room? Well, it is always the PIR (passive infra-red or pyro-electric sensors at the center of it all. It is also critical to note that PIR or passive infra-red normally works in conjunction with ultrasonic. However, passive infra-red sensors can work, and well, as an independent unit.

PIR or passive infra-red and ultrasonic technologies function on the principle of detection (people). However, each has a distinct sense, with each also coming with distinct benefits. The benefits, in this case, depending on the specific application you subject either motion sensor on.

How a Passive Infra-Red Motion Sensor Works

pir motion sensor circuit

Every object above absolute zero temperature tends to emit radiation as heat energy. It is a phenomenon widely understood as Wien’s Law. Consequently, by detecting the changes in the IR or infra-red radiation, the PIR comfortably detects the absence or presence of humans. It can also detect other warm and moving objects other than humans.

In most instances, the typical arrangement will include the passive infra-red sensor, a microcontroller, an alarm system, an LED, a power management device, and a battery. Further, connectivity also needs to become available for the system to work, especially at home.

The PIR sensor normally gets connected to the microcontroller. However, the microcontroller links the power management system (battery), the alarm system, LED, and connectivity (Internet of Things).


Passive infra-red sensors possess two slots, each capable of sensing or detecting infrared radiation. Therefore, as an individual (or warm object) moves across the first detector, it generates a positive pulse. But when the object moves across the second detector, the system generates a negative pulse, which then depicts movement from the differential pulses. By utilizing a decent analog electronic that uses an operation amplifier pair, a signal gets generated to indicate the presence of warm-bodied moving across it.

You will find an optical infra-red filter fitted at the sensor’s front to restrict the wavelengths to only those desired. Typical for this entails 10µm as this represents the human body’s IR energy. The region covered by the passive infra-red detector often proves a function of the lens fitted on the sensing element besides the placement of the detector in the spot or room. One of the most common lens types you will encounter is the Fresnel type developed from plastic (semi-opaque). It concentrates infra-red radiation emanating from the broader area onto the detector.

A Curious Case of Ultrasonic Transducers

In some cases, you will find other individuals preferring ultrasonic transducers as an alternative method in detecting the presence of people in a building. At the same time, an effective detection system can always get used in combination with the PIR technology for better motion detection results. Ultrasonic transducers use sound waves that operate at higher frequencies than humans typically hear – 30kHz to around 10MHz.

If you do not know how ultrasonic transducers work, it comprises a transmitter and a receiver. When a sound pulse gets generated, it bounces off the objects in its route, which the receiver reflects and records. For instance, when a room is empty, the reflection will emanate from the opposing wall. This reflection-to-received time will prove proportionate to the distance between the wall and the transducer. Consequently, whenever a human enters the building or room, a pulse will reflect them. Since their proximity to the detector in relation to the wall will prove closer, the time for their reflection to register in the detection system will also prove less.

How to Connect a PIR Sensor

It is always crucial to understand the design and how the passive infra-red sensor connects it. Most PIR designs possess two rectangular windows, which permit the penetration of the IR. A sensor containing electrodes gets attached behind either window and in a specific way. One sensor should provide the positive output signal while the other, the negative output signal. Whenever the system fails to detect an object, both detectors or sensors get the same IR, which cancels each other out. However, if an individual (warm body) comes across the detection sources, the value becomes at variance with the paired sensor, making it register an output change.

You can always rely on the Fresnel lens located at the front of the window region to enhance the range of detection besides detection patterns and angles. Such an increase allows the aspects to match the requirements of the corresponding application. Diverse sensor layouts, which deploy over two pyroelectric elements (arranged grid-wise), make it possible to fine-tune performance to suit different applications. For instance, the array and lens configuration in a product like Panasonic AMN comes optimized to sense motion in a narrow field of view. Consequently, it becomes ideal for getting deployed in the light switch and vending machine applications. It is markedly different from some general-purpose EKMC and EKMB families.

It is also prudent to incorporate an amplifier to enhance the usability of the PIR motion sensor. An amplifier will reduce the noise emanating from smart technologies like emissions from smartphones. Such electromagnetic emissions can get detected by the PIR sensor.

Applications of PIR Motion Sensors

pir motion sensor arduino

Passive infrared sensors have diverse applications in different sectors. However, the most notable include the following.

Lighting Control

Most BEM systems have lighting control as a critical element, especially in sensing the presence of individuals to regulate light as needed. PIR sensors by design can work perfectly, though in this case, the mobility of the individual or object becomes central to their detection. However, ultrasonic systems can prove adequate in providing information necessary for automation and control for HVAC systems.


Passive infra-red sensors act as valuable tools for your commercial or domestic property’s security. It monitors your home’s security by detecting intrusion (through its IDS – intrusion detection system). Most PIR sensors get installed away from the entry points and thus will detect any intrusion before the individual reaches the sensor and interferes with it.

Connected Robots

The concepts of connected robots have increasingly become popular for commercial and domestic applications. It can entail simple robots like automated vacuum cleaners at home, which can vacuum unattended. You can also get the same concept when it comes to robotic lawnmowers. However, this application of PIR needs ultrasonic transducers for it works perfectly without hitches.

Industrial Applications

Most large warehouses and factories use robots to move products or goods from one area to another. While the AGVs (automated guided vehicles) have predefined paths to follow to avoid other objects, they use ultrasonic transducers to detect and avoid other AGVs in their paths.

Vending Machines

Most current vending machine designers use the PIR technology and sensors to ensure their vending machines display light when someone waves their hand or stands in front of it. It becomes helpful in driving down operating costs. Further, the advent of IoT or the Internet of Things has ensured the driving of multiple applications by PIR sensors. It realizes this by conveying status updates to a smart server. It makes it possible for you to deploy output from a resident or nearby security cameras to light up the display panels or the printer during work hours.

You always have to watch out for and pick the correct PIR sensor for your application. Different types exist in the market, though most use a similar core architecture. Nonetheless, an increasing number of differences in construction and design exist. The infra-red radiation enters the detector or sensor enclave through one or more windows located at the front before landing on pyroelectric panels. Additionally, the pyroelectric material generates an electric current upon exposure to infra-red energy. You can find pyroelectric as cesium nitrate, gallium nitride, or carbon-based polyvinyl fluoride and phenyl pyridines.   

Further, PIR sensor design enhancements imply a shift into a wider application range than previously imagined. It also allows for the correct selection of Internet of Things-compatible services and products. However, do not struggle with PIR as RayMing PCB and Assembly exist to sort out your information, product, and service needs.       

Important Considerations before Installing a PIR Motion Sensor

Like all the common motion sensors, the passive infra-red motion sensor has a limited range of detection. In most cases, it ranges to about eighty feet, which implies that one would not prove enough for your home or office security setup. Therefore, it is advisable to work with security experts (company technicians) to install the motion sensor system. Furthermore, installation experts’ key jobs entail reviewing your space layout. Therefore, placing the PIR sensors in the most strategic places is prudent.

It also becomes integral to integrate your passive infra-red sensors with your home’s burglar alarm system. You can comfortably access, monitor, and operate it using an app from your smartphone from this system.

However, it becomes a different ball game if you want to install the PIR yourself. In this instance, you must consider the following.

DIY PIR Sensor Installation Considerations

Install the PIR sensor near the entry points in your house or office. To pull this off, consider buying PIR motion detectors designed particularly for windows and doors/

It is also prudent to place the passive infra-red sensors in high-traffic spots within your home. For example, you will possibly have a better chance of catching an intruder in the stairwell or hallway or other possible place people have to walk through. It would help if you also placed sensors or detectors near rooms having valuable items that may prove a target for thieves.

Avoid installing PIR motion sensors near heat sources. Passive infra-red sensors operate by analyzing a specific area’s temperature fluctuations, which may trigger false alarms when installed near a furnace, vent, or fireplace.

Avoid blocking the PIR sensor. Your PIR motion sensor will not function properly when obstructed. The obstruction prevents the PIR sensor’s ability to sense motion. Obstructions most times do not prove obvious. For instance, your parked SUV on the street may obstruct your PIR sensor from detecting movement in the street or sidewalk.


It is prudent always to check and wipe the dust or debris off your sensor post the installation process. It ensures a clear or unobstructed lens which ensures its effectiveness.  

You also have to configure the PIR motion sensor settings (either the technician installing it for you or doing it yourself as a DIY). However, it will help prevent your smartphone from blowing up with countless motion notifications by ensuring the sensitivity proves right. Adjusting your PIR sensor settings yourself only requires you to refer to the sensor’s instruction manual. Further, it will most possibly come with an app that you must set or change the settings to ensure the right sensitivity (not too sensitive and not less sensitive).

Always conduct thorough research before buying a PIR motion sensor to understand the diverse setting types, features, etc., that they come with. You can get PIR detectors with the “a-set-and-forget-it” mode that allows minimal settings. However, another set of PIR sensors comes with a full range of features that require a lot of time to configure.

Benefits of a PIR (Passive Infra-Red) Sensor

  • Since passive infra-red sensors work by detecting movement and body heat, it represents among the best and most reliable solutions for motion detection. Some of the most notable benefits of PIR sensors include the following.
  • PIR or passive infra-red sensors are pet-friendly. You can adjust the sensitivity to heat to avoid the occurrence of false alarms. For instance, when a dog, cat, or other small body animal crosses the detection zone.
  • Passive infra-red sensors prove inexpensive. The cost of buying PIRs proves relatively affordable compared to other sensors. Both upfront and through its maintenance period. For one, it uses little energy, and you can rely on it for a long time.
  • The passive infra-red sensor acts as a perfect fit for a simple home security setup as it covers small spaces.

Disadvantages of the PIR

  • It is ineffective when you want to cover larger spaces
  • A passive infra-red sensor can also prove tricky to install solo. It may not cover the anticipated areas or spaces if you angle it incorrectly.
  • It also needs a line-of-sight with mobile objects for it to sense or detect motion.

PIR Sensor Arduino: What it Means and how to Set it Up

If you look at the layout or the design of a passive infra-red motion sensor, you will notice that it has an output. The output becomes crucial in connecting it to the PIR sensor Arduino – a specific microcontroller type. While possible to design it by yourself, you can always rely on our expertise and pedigree at RayMing PCB to develop your Arduino microcontrollers for the PIR motion sensor.  

All you need to do entails connecting your PIR to the Arduino type of your choosing to ensure any motion gets detected properly. Whenever a motion gets detected, the pin value gets set to “1”. Further, the dual potentiometers on the board permit any adjustments to the sensitivity desired besides the delay time post the motion detection.  

Most PIR modules possess a PIR sensor responsible for detecting movement and occupancy from a human body-based infra-red radiation. Different PIR modules are available in the market, but they often prove fundamentally similar. You will get at least a GND pin, a digital output, and a Vcc pin. Some modules also have a ball-like-lens on the sensor that enhances the viewing angle.

How to Use a PIR (Passive Infra-red) Sensor with Arduino

The Circuit

The beauty of a PIR sensor entails connecting the passive infra-red output to every digital pin option. It would help if you moved the PIR sensor module’s jumper to the position marked “L.” it will have the intended effect of toggling the sensor whenever it detects motion. However, while solid, it is unlikely as an effective option in practical applications. You can refer to the mode as the single triggering or non-triggering mode.

You will get the standard sensor logic if you move the jumper slightly to the “H” position. Your sensor will switch on upon detecting motion and turn off post the last detected motion. In this case, the sensor will ensure the timer gets reset; otherwise necessary to turn off (output) every moment it detects motion. It becomes applicable, for instance, in-room occupancy lighting regulation or control. Here, you do not want your lights blinking off as the unit resets.

Two potentiometers exist behind the module. Therefore, you can increase or reduce the sensor’s sensitivity by changing the sensitivity setting of the potentiometer. Another aspect you can change includes the output delay after the movement detection.


  • It is always crucial to incorporate or add the library before uploading the code. You must consider the following steps, especially when new to the Arduino board.
  • Visit the to download the software into your operating system. After that, install the IDE package as instructed.
  • The next step entails running the Arduino IDE and clearing the text editor. You then have to copy the code into the text editor.
  • Pick the boards and the board tools before selecting your Arduino board.
  • Connect or link the Arduino board to your PC and ensure you set the COM port.
  • Press the arrow sign button to upload, and you will have everything ready.

It is crucial to calibrate the sensor, and for this to happen, avoid any movement in front of the passive infra-red sensor for close to fifteen seconds. Always ensure that pin 13 turns off before subjecting any movement in front of the detector. It becomes vital as, post this period, the PIR sensor gets a snapshot of the viewing scope and, as such, can detect motion.       

Picking the Ideal Arduino Model for your PIR Motion Sensor

Arduino microcontroller models differ when it comes to types and part series. Such features, while distinguishing, cannot take away from the uniform and standard functionality of Arduino in relation to the PIR motion sensors as they always prove similar. However, for the capability of the Arduino microcontroller, you should consider the following aspects before settling for one.

Size or Dimensions

Arduino microcontrollers come in diverse sizes. In most cases, the more compact, the better for your PIR sensor system. It is, however, not far-fetched to find most of them measuring 80mm * 60mm * 25mm.

Microcontroller Series

Arduino microcontrollers come in diverse series based on the board’s fabrication technique and technology. For instance, Arduino Uno Rev 3 comes on a microcontroller ATmega328P tech. It is useful to consider the fabrication technique besides the tech used to understand the quality status of the board.

Operating Voltage

Voltage often correlates to current. The voltage specification of a microcontroller determines the amount of power consumption. But like most smart technologies (BEM), you will want it to operate effectively and in an energy-saving manner. So consider the recommended input voltage and limit.

Digital Pin Number

A microcontroller will typically have analog input pins and digital I/O pins. However, the number of pins becomes essential in determining the potential connections. For example, if you get 14 digital I/O pins with 6 PWM and a further six analog input pins, then you will be good to go.


Arduino, like all other microcontrollers, possesses a memory aspect. However, the type (flash memory) and size become crucial in determining its operational capability. Therefore, it will have an SRAM, Flash memory, and an EEPROM in most instances.

Clock Speed

Before connecting it to the PIR motion sensor, any microcontroller needs to consider such aspects, especially for your Arduino.

Final Thoughts

PIR or passive infra-red sensors represent a crucial aspect of any security system in private and commercial addresses. It helps detect intruders or suspicious activities with unprecedented precision when set properly. Therefore, understanding the ins and outs of it proves pivotal in choosing and ensuring your home’s security.