Types of IR sensors

There are basically two types of IR sensor: Passive IR sensors and Active IR sensors.

Passive Infrared Sensors (PIR sensors) do not need an infrared source to operate. PIR sensors detect the infrared rays emitted. The main application of these motion detection sensors is to the check the presence of any human or animal since the body of a human and animal radiates infrared energy.

Let's understand the anatomy of the PIR sensor module that we will be using to build our surveillance system. We use the readily available HC-SR501 PIR Sensor module. Refer to Figure 6.1:

Figure 6.1

The preceding picture shows the top view of the PIR module with a dome-shaped fresnel lens mounted on it. This lens helps to focus infrared radiation.

Inside this fresnel lens, there is a pyroelectric sensor, which detects the IR radiation; refer to Figure 6.2, which shows a picture of the pyroelectric sensor enclosed in a metal body with a rectangular crystal in the center:

Figure 6.2

Along with the pyroelectric sensor, supporting circuitry is situated on the other side of the module, as shown in Figure 6.3:

Figure 6.3

The supporting circuitry has a few important components that play a major role in the operation of the PIR sensor module:

  • I/O pins:
    • The first pin is for powering the sensor itself, marked as Vcc. The PIR sensor has an operating range of 5V to 12V.
    • The second pin reads the output of the PIR sensor, marked as 3.3V TTL. It generates a digital output, which goes high when the sensor detects infrared radiation and goes low when there is no radiation in its range.
    • The third pin is for grounding the sensor module marked as GND.
  • B1SS0001 PIR controller IC:
    • A CMOS-based chip designed specifically for human-infrared sensor control circuits
    • Low power consumption and suitable for battery-powered operations
    • High input impedance operational amplifier
    • Bi-directional level detector/excellent noise immunity
    • Built-in power up disable and output pulse control logic
    • Dual operating modes: retriggerable and nonretriggerable
  • Trigger settings include three pins and at any time only two pins are shorted using the jumper. When the pin marked H (refer to Figure 6.3) is shorted with the middle pin, the sensor works in retrigger mode. In retrigger mode, the PIR sensor gives continuous high output for a certain duration of time when it detects any human body (infrared radiation is emitted from the human body due to body heat). And when the pin marked as L (refer to Figure 6.3) is shorted with the middle pin, the sensor works in nonretrigger mode. In nonretrigger mode, the PIR sensor's output keeps on switching between high and low when it detects any human body.

For our use case, we will set the Trigger in retrigger mode by shorting pin H with the middle pin:

  • Sensitivity of the PIR sensor can be altered using the Trimpot provided on the module and marked as Sensitivity Adjust (refer to Figure 6.3). When the Trimpot is turned in a clockwise direction, the sensitivity is increased and it detects even the slightest movement of a human body (a source of infrared radiation) from a distance of 6 meters or more approximately. And when it is turned in an anticlockwise direction, the sensitivity is decreased and it detects motion within a small range of 2 to 3 meters.
  • Delay time determines how long the PIR sensor's output will remain high after detecting the motion. A Trimpot marked as time delay Adjust is provided to vary the delay time. The time value can be set from a few seconds to few minutes. When the Trimpot is turned in a clockwise direction, the delay time increases and the output will remain high for a longer period; when it's turned anticlockwise, the delay time reduces.

Until now, we have discussed the anatomy of the PIR sensor module. Let's understand how the PIR sensor actually works. A PIR sensor has two slots and each slot detects infrared radiation separately as shown in Figure 6.4. Here, each slot is made up of IR-sensitive material:

Figure 6.4

When there is no movement in front of the sensor, it remains in the idle state and both Slot 1 and Slot 2 detect the same amount of infrared radiation. When a warm body like that of a human or an animal passes by the detecting area, the IR radiation from the body is first detected by Slot 1 of the PIR sensor, which results in a positive differential change between two slots. And when the body leaves the detecting area, the IR radiation is detected by Slot 2, which results in a negative differential change between the two slots. The combination of this positive and negative differential change results in the output signal at the PIR sensor, which is being read out through I/O pins.

Active infrared sensor modules consist of two elements: An infrared source and infrared detector. A source can be an LED or laser diode whereas an infrared detector can be a photodiode or phototransistor. When Energy (IR radiation) emitted by the source is reflected from any object and falls on the detector, it generates a signal. A typical setup of an IR object detector module can be seen in Figure 6.5:

Figure 6.5

In our use case, the IR transmitter is an LED (refer to Figure 6.6), which emits infrared radiation. It looks like a normal LED, but the light emitted by it is not visible to the naked human eye:

Figure 6.6

The IR receiver detects the radiation emitted by the transmitter. In our use case, we use an infrared photodiode as the IR receiver (refer to Figure 6.7). The IR photodiode is different from the normal photodiode because it only detects infrared radiations:

Figure 6.7

Note that, when an IR photodiode is used in conjunction with an IR transmitter in an object detection circuit, then the wavelength of both the transmitter and receiver should match.

Let's look at the IR sensor module that we are going to use to build our surveillance system (refer to Figure 6.8):

Figure 6.8

The following are the ingredients of the IR module:

  • LM358
  • IR transmitter and receiver pair
  • Potentiometer: 10 k
  • LED
  • 270 Ohm resistor X 2
  • 10 Ohm resistor

Let's explain the working of the IR module with the help of its circuit diagram shown in Figure 6.9:

Figure 6.9

When an object comes close to an IR LED, infrared rays get reflected from the object and fall on an IR photodiode (receiver), which causes current to flow in the circuit. The energy from the IR waves is absorbed by electrons at the p-n junction of the IR photodiode, which causes the current flow.

When the current flows through a 10 k Ohm resistor, it creates a potential difference (voltage). This voltage value depends upon Ohm's law (V=IR). Since resistance is constant, the current, more will be the higher the voltage. The amount of current flow is directly proportional to the infrared waves detected by the photodiode. In simpler words, greater the intensity of the IR waves received by photodiode (the closer the object, the greater the quantity of reflected IR waves), the more current will flow through it and the higher the voltage.

The voltage output generated by the sensor is compared with a fixed value of reference voltage using LM358 opAmp IC (the reference voltage is created using a potentiometer). As shown in Figure 6.9, the positive terminal (non-inverting) of the OpAmp is connected to the positive terminal of photodiode (the voltage at this point changes when the object moves across the photodiode) and the negative (inverting) terminal of the OpAmp is connected to the reference voltage point (it remains constant) across the potentiometer.

The OpAmp works in such a way that when the voltage at the positive terminal of the OpAmp is more than that of the voltage at the negative terminal, the OpAmp generates an output, which eventually turns on the LED.

So, in a nutshell, when an object moves closer to the IR sensor, the IR waves that get reflected from it fall on the IR photodiode, which causes the voltage at the positive terminal of the OpAmp to increase; at a certain point it becomes more than reference voltage at a negative terminal and we get the output, which can be used to raise an alert by powering a buzzer or blinking an LED.

The sensitivity (minimum distance at which the sensor detects an object) can be altered by rotating the potentiometer.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.11.98