Lamp with automatic switching on. Infrared motion sensor HC-SR501 Hc sr501 photoresistor wiring diagram

In this article I will tell you how to work with the HC-SR501 sensor (PIR sensor). The sensor is inexpensive and versatile, it can be used alone or with a microcomputer to create various projects (burglar alarm systems or automated lighting systems)

Specifications

Supply voltage: 4.8V ... 20V
Static current: 50mA
Output level: 3.3V / low 0V
Delay time: 0.5 - 200s (adjustable)
Blocking time: 2.5s
Work Angle:< 100
Working temperature: -15C … + 70C
Object detection: 23mm
Dimensions: 33mm x 25mm x 24mm

General information

Any person or animal with a temperature above zero emits heat energy in the form of radiation. This radiation is not visible to the human eye because it is emitted at infrared wavelengths, below the spectrum that humans can see. Measuring this energy is not the same as measuring temperature. Since the temperature depends on the thermal conductivity, therefore, when a person enters the room, he cannot instantly change the temperature in the room. However, there is a unique infrared emission due to body temperature that the PIR sensor is looking for.
The principle of operation of the infrared motion sensor HC-SR501 is simple, when turned on, the sensor adjusts to "Normal" infrared radiation within its detection zone. It then looks for changes, such as a person walking or moving within a controlled area. The detector uses a pyroelectric sensor to determine the infrared cure. This is a device that generates an electrical current in response to receiving infrared radiation. Because the transducer does not emit a signal (such as the previously mentioned ultrasonic transducer), it is penalized "passive". When a change is detected, the HC-SR501 changes the output signal.

To improve the sensitivity and efficiency of the HC-SR501 sensor, the method of focusing infrared radiation on the device is achieved, this is achieved by using the "Fresnel Lens". The lens is made of plastic and is made in the form of a dome and actually consists of several small Fresnel lenses. Although plastic is translucent to humans, it is actually completely transparent to infrared light, so it also serves as a filter.

The HC-SR501 is a low cost PIR sensor that is completely self-contained, capable of operating on its own or in conjunction with a microcontroller. The sensor has a sensitivity adjustment that detects motion from 3 to 7 meters and its output can be set to remain high for 3 seconds to 5 minutes. Also, the sensor has a built-in voltage regulator, so it can be powered by a constant voltage of 4.5 to 20 volts and consumes a small amount of current. HC-SR501 has a 3-pin connector, the purpose is as follows:

Pin assignment
VCC— positive DC voltage from 4.5 to 20 V DC.
OUTPUT- 3.3 volt logic output. LOW does not indicate discovery, HIGH means someone has been discovered.
GND- grounding.

The board also has two potentiometers for setting several parameters:
SENSITIVITY— sets the maximum and minimum distance (from 3 meters to 7 meters).
TIME- the time during which the output will remain HIGH after detection. At least 3 seconds, maximum 300 seconds or 5 minutes.

Jumper assignment:
H is the Hold or Repeat setting. In this position, the HC-SR501 will continue to output a HIGH signal as long as it continues to detect motion.
L— This is an interrupt or no retry option. In this position, the output will remain HIGH for the period set by the TIME potentiometer setting.

The HC-SR501 board has additional holes for two components, there is a marking nearby, you can look at it by removing the Fresnel lens.

Purpose of additional holes:
RT- This is for a thermistor or temperature sensitive resistor. Adding this allows the HC-SR501 to be used in extreme temperatures and also improves the accuracy of the detector to some extent.
RL is a connection for a light-dependent resistor or photoresistor. By adding a component, the HC-SR501 will only work in the dark, which is a common application for motion-sensitive lighting systems.

Example #1: HC-SR501 as a standalone device.

Required details:


Transistor 2SC1213 x 1


Connection:
When you turn on the HC-SR501, calibration is required, it takes from 30 to 60 seconds, the sensor also has a “reboot” period of about 6 seconds (after triggering), during which time it does not respond to movements. In this example, we use HC-SR501 and a relay module (1-channel), as well as an NPN transistor (2SC1213 is used in the example). The HC-SR501 sensor is powered by 5 V, since the relay also requires the same power, and a 220V lamp is used as a load. Since the output signal of the HC-SR501 is weak (in practice, it is only enough to light the LED), one option is to use any NPN bipolar transistor.

Attention! Follow safety precautions and be careful!

The operation of this circuit is very simple, after switching on and calibrating, the sensor starts reading. When motion is detected, the sensor changes the value at the “OUT” pin.

Example #2: HC-SR501 adding photoresistor

Required details:
Motion sensor HC-SR501 x 1 pc.
Relay module (1-channel) x 1 pc.
Transistor 2SC1213 x 1
Lamp for 220V (75W) with socket x 1 pc.
Power supply for 5V x 1 pc.
Photoresistor x 1pc
DuPont wire, 2.54 mm, 20 cm, F-M (Female - Male) x 1 pc.

Connection:
In the following example, we use the same circuit as in example No. 1, only a photoresistor has been added. The place for installing the photoresistor is located next to the output connector, the designation on the board is "RL". You can solder directly to the board or use the pin header to easily connect the Dupont wire. The main thing is that the photoresistor should not be closed from the natural light of the room, but also be protected from the light of the lamp, which we use as a load. The figure below shows where to install the photoresistor.

Once the photoresistor is installed, turn on the circuit and wait for a while while the HC-SR501 sensor calibrates. If everything is connected correctly (and the room lights are on), nothing will happen, the photoresistor prevents the HC-SR501 from starting when the room is lit. Now turn off the light and the HC-SR501 will start up whenever it detects activity.

Example #3: HC-SR501 and Arduino

Required details:
Arduino UNO R3 x 1pc
Motion sensor HC-SR501 x 1 pc.
LEDs 5 mm x 3 pcs.
Resistor 0.125W, 320Om x 3 pcs.
DuPont wire, 2.54 mm, 20 cm, F-M (Female - Male) x 1 pc.

Connection:
Although the HC-SR501 sensor is a stand-alone device, it can be connected to a microcontroller pin. In the example, we use the Arduino UNO R3 controller, in which we can take into account the turn-on time and the reset period. This way the device can be more accurate as you won't be trying to sense forward motion when the sensor is not ready. Also, you can connect several HC-SR501 sensors to the Arduino, which will allow you to track movement in different places.
In the following example, we will connect one HC-SR501 to the Arduino as an indication using three LEDs, each of which indicates the status of the sensor:

  • Red LED- This LED indicates that the sensor is not ready.
  • Yellow LED- This LED indicates that the sensor is ready to detect motion.
  • Green LED- This LED lights up for 3 seconds when the sensor is triggered. Instead of an LED, you can control an external output (like the relay module we used earlier).

Wiring diagram:

The jumper on the HC-SR501 must be set to the “L” position, and it is also necessary to set the time to a minimum (5 seconds), to do this, turn the potentiometer to the left until it stops. Now that you're all connected, you need to upload the sketch.

/* Tested on Arduino IDE 1.8.0 Test date 08/12/2016. */int detectedLED = 13; // Specify the pin int readyLED = 12; // Specify the pin int waitLED = 11; // Specify the pin int pirPin = 7; // Specify the pin of the sensor int motionDetected = 0; // Variable for motion detection int pirValue; // Variable to save value from PIR void setup() ( pinMode(detectedLED, OUTPUT); // Set pin as output pinMode(readyLED, OUTPUT); // Set pin as output pinMode(waitLED, OUTPUT); // Set pin as output pinMode(pirPin, INPUT); // Set pin as input // Initial delay of 1 minute to stabilize the sensor// digitalWrite(detectedLED, LOW); digitalWrite(readyLED, LOW); digitalWrite(waitLED, HIGH); delay( 60000); digitalWrite(readyLED, HIGH); digitalWrite(waitLED, LOW); ) void loop() ( pirValue = digitalRead(pirPin); // Read the value from the motion sensor if (pirValue == 1) // If there is movement, make a delay of 3s ( digitalWrite(detectedLED, HIGH); motionDetected = 1; delay(3000); ) else ( digitalWrite(detectedLED, LOW); ) // Delay after triggering // if (motionDetected == 1) ( digitalWrite (detectedLED, LOW); digitalWrite(readyLED, LOW); digitalWrite(waitLED, HIGH); delay(6000); digitalWrite(readyLED, HIGH); digitalWrite(wai tLED, LOW); motionDetected = 0; ) )

Download sketch

Upload this sketch to the Arduino controller. When turned on, the red LED will light up, which indicates the preparation of the sensor (on for 1 minute). After a minute, the yellow LED will turn on and the red LED will turn off, which means that the sensor is ready to detect motion. As soon as the sensor detects motion, the green LED will turn on and remain lit for three seconds.

Buy on Aliexpress
Buy Infrared Motion Sensor HC-SR501
Buy a set of DuPont wires, 2.54 mm, 20 cm

Motion sensors are devices that respond to moving rather than stationary objects. This is how they differ from presence sensors configured to be triggered by the disappearance of moving objects in the controlled area.

In other words, a device that controls movement should work when a person is inside the observed space, when he moves or freezes, but at least just moves his fingers. At the same time, presence control devices are triggered when people have completely left the room or a completely frozen person remains in it, not making any movements.

Principles of operation of motion sensors

Both groups of these sensors can work based on:

    capturing sound vibrations with sensitive acoustic systems;

    perception of thermal radiation caused by the human body by infrared receivers passive action;

    overlapping invisible to the human eye infrared rays directed from the emitter to the receiver active method.

There are other ways to detect a moving person, but they, like the acoustic method, are rarely used. And in household devices, motion sensors are most often used, working with electromagnetic oscillations of waves located in the infrared spectrum. They are described in .

IR sensor receivers have a common principle of operation.

Motion sensors and presence sensors capture infrared radiation that spreads in all directions from any objects located in the field of view. Thermal rays, as in a conventional optical system, for example, a camera, fall on a segmented lens that works according to the Fresnel principle.

This glass or optical grade plastic construction is created with a large number of concentric sectors/segments, each of which forms a narrow beam of parallel heat rays onto the IR sensor.

It is also called the term "PIR sensor" because it has a pyroelectric effect - it creates an electric field proportional to the heat flux received. The received signal is processed by electronic devices.

For most sensor designs, the pyrodetector works with analog values. An example is .

It has small dimensions, works on the basis of a microcircuit, has three terminals for connecting power and load wires, and two adjusting potentiometers. When triggered, it produces a control electrical signal with a voltage of 3.3 volts and a current of several milliamps.

Recently, blocks have been introduced that perform double conversion and command processing based on .

This allows the use of microprocessor devices and computer technologies for further signal conversion and the formation of various control algorithms for automatic devices.

Both analog electronic and digital sensors are connected to power supplies and have output devices that switch the load in the primary network.

One of the principles is laid down in the electronics operation algorithm:

    motion detection;

    stay trips.

When a person appears in the field of action of the sensor, by his presence he makes changes in the thermal balance of the environment, and all his movements are recorded through the Fresnel lens as a camera lens. Electronic units are triggered and give an electrical signal to the control contact.

This completes the functions of the sensor itself, although the process of switching actuators has not yet been completed, and the power of the control signal of the motion sensor for switching lighting fixtures, turning on a sound siren, sending SMS to a mobile phone, or performing other tasks is not enough.

This signal must be amplified and transmitted to a powerful contact for switching the load.

The motion sensor HC-SR501 discussed above cannot perform these functions on its own. To implement them, you can assemble a simple transistor switch on.

The VCC and GND terminals of the motion sensor and the key are supplied with power = 4.5 ÷ 20 volts from an additional source, and the control signal from the OUT terminal of the sensor is fed to the amplifier terminal of the same name. The appropriate voltage load is connected to the output circuit.

If you use this scheme to turn on your mobile phone, you can receive SMS on your mobile phone, which will be a signal about the appearance of unexpected guests in the security zone.

In most ready-made modules for lighting circuits with motion sensors, its amplifier and power contact are built-in, switching the load circuit. The designs of such blocks, powered by a network of ≈220 volts, have three terminals for connecting wires directly on the case, two of which supply power (phase L and zero N) and the third L "together with zero N is used to switch lamps.

Active Motion Sensors

Devices that work on the principle of channel control between an IR emitter and a receiver have approximately the same algorithm, tuned to a common frequency, like a TV remote control or a wireless computer mouse with their receivers. They can have an autonomous power supply independent of the stationary electrical network.

In this case, one of the layouts of the modules of the direct or rotary method of forming a path using mirrors is performed.

Sensor connection diagrams

Wiring diagram for easy connection shown in the picture.

With this connection, the operating mode of the lamp fully corresponds to the algorithm laid down by the electronic circuit, and is adjusted by adjustment potentiometers.

On simple sensor designs, two regulators are installed:

1. LUX - the level of illumination, upon reaching which the sensor is triggered (for example, there is no need to use electric light in sunny weather). For regulation, its highest value is initially set;

2. TIME - the duration of the timer, or, in other words, the length of time in which the lamp will be on after motion is detected. Usually, a minimum value is set, because with each new movement, the sensor will constantly restart.

Usually these two adjustment parameters are enough to adjust the control of household lamps. There are two more potentiometers:

1. SENS - sensitivity or range. It is used to reduce the control zone in cases where it is not possible to limit it by changing the orientation of the motion sensor;

2. MIC - the acoustic noise level of the built-in microphone, at which the sensor is triggered. But in domestic conditions, this function is not needed - the sensor will be triggered by extraneous sounds of passing cars, children's exclamations ...

Scheme of connecting a luminaire to two sensors


This method is used in places where it becomes necessary to control lighting from two remote points with limited visibility for one sensor.

The terminals of the same name are connected in parallel to each other and output to the power supply network and the lighting device. When the output contact of any sensor is triggered, the lamp lights up.

Wiring diagram via switch

This method is used when a motion sensor block is added to an existing lamp with a switch. When the switch is turned on, the circuit operates completely as it is configured by the electronics. And when the contact is open, the phase is removed from the power supply and the motion sensor is disabled.

Practice has shown that among apartment owners, when leaving the premises, the habit of automatically turning off the light with a switch has been preserved. After that, when a person enters the room, the motion sensor is disabled. To exclude such situations, the switch contacts are shunted, which makes the transition to the previous circuit.

In this circuit, the switched on switch completely bypasses the output contact of the motion sensor. It is used when a person is in a fixed position for a long time, and the shutter speed of the timer is short and you have to make extra distracting movements to turn on the lamp.

Scheme for connecting powerful loads by electromagnetic devices

A motion sensor block with low power contacts can be used for very powerful lighting fixtures. For this, an intermediate device is used - a relay or contactor of the appropriate ratings. Its winding is connected to the low-power contact of the sensor, and the power contact switches the load of the lighting system.

In this circuit, as in all others, it is necessary to accurately calculate the switched powers and select power contacts for them. After being put into operation, the load currents must be measured and compared again with the power of the contacts. For reliable long-term operation of the system, it is necessary to create a power reserve.

Such a circuit with electromagnetic devices is able to work reliably and for a long time. But, it has two significant drawbacks:

1. increased noise level and emerging electromagnetic interference accompanying the process of moving the armature during switching;

2. constant wear of the contact system due to discharges that occur when the circuit breaks, which requires periodic preventive maintenance.

Triac and trinistor circuits are deprived of these shortcomings.

Scheme for connecting powerful loads with semiconductor devices


In this case, there are no all kinds of noise and interference. But for the operation of a semiconductor device, it is necessary to convert the control signal of the motion sensor into a harmonic that coincides in frequency with the mains voltage. For this, a special matching circuit is created, which outputs alternating current to.

When the matching circuit is operating, the triac is open. and the lamps are on. When there is no control signal, the triac is closed and the lighting controlled by it is turned off.

The disadvantage of this scheme is the complexity of the design of the matching signal of the electronic device.

Selecting the installation location and sensor orientation method

Depending on its design, the motion sensor can have a different viewing angle to control the space from a few degrees to a circular view, which is usually used for ceiling mounting.

These angles are distributed in the horizontal and vertical planes, determine the observation area, and are indicated in the documentation.

Sensors designed for wall mounting usually have a view of about 110÷120 or 180 degrees horizontally and 15÷20 vertically.

Outside this space, no movements are detected by the sensors. Therefore, when installing a motion sensor, it is important not only to select them according to the viewing characteristics, but also to adjust them after installation to correct the direction. Designs with a movable viewing body facilitate adjustment, while for other devices it is necessary to think over and perform the initial installation very carefully.

Ceiling sensors typically have a 360 degree horizontal field of view that extends in a cone from top to bottom. His zone of control is much larger, but it can also have blind space in the corners of rooms.

Influence of foreign objects on the operation of sensors

When installing and configuring a motion sensor, it is important to take into account the conditions for their placement, to assess the impact on their reliability of nearby objects and various energy sources. Thermal heaters, swaying tree branches, passing cars, elevators going up/down and other objects can cause frequent false alarms.

When there is no way to get rid of them, then the sensitivity of the device is coarsened with a potentiometer or the interference zone is shielded.

Currently, pyro sensors, or infrared motion sensors, are commercially available. The principle of operation of the pyroelectric sensor will not be described here. I will only say that the pyro-sensor is designed to record the movement of a person. This particular device uses the HC-SR501 pyro sensor.

Module with sensor HC-SR501

It is a small printed circuit board on which the lens is located. This board has three points for connecting to an external circuit - point Vpp (power supply from 5 to 20V), current Out (output, when it is triggered, the voltage is 3.3V), and GND (common minus).

There are two tuning resistors on the board, one of which regulates the sensitivity of the sensor (the range of motion detection is from 3 to 7 meters), the other is the time during which the voltage of 3.3V is maintained at the output when triggered (from 5 seconds to 200 seconds). Another jumper for two positions "H" and "L".

In order for the sensor to work in this design, you need to put the jumper on its board in the “H” position, the time adjustment resistor in the minimum time position. Well, the sensitivity adjustment resistor to a position in which there will be the necessary sensitivity. Figure 1 schematically shows the pyroelectric sensor board with the location of the connection and control elements on it.

Rice. 1. Organs for setting and connecting the HC-SR501 sensor.

Schematic diagram of the security device

The alarm works on the B1 electronic siren, which is a standard car alarm siren. This is due to the supply voltage of the circuit. The circuit is based on a D1 logic chip of the K561LE10 type (or a foreign analogue 4025). This chip consists of three logic elements "ZIL-NOT" CMOS logic. When powered from a 12V source, the voltage at the output of the pyroelectric sensor F1 (3.3V) will not be enough, so after it the cascade on the transistor VT1 is turned on, it increases the level of a logical unit but inverts the voltage. To correct the inversion introduced by the transistor VT1, element D1.1, included by the inverter, is used.

Rice. 2. Schematic diagram of a security device based on the HC-SR501 pyro-sensor.

Now, when the pyroelectric sensor is triggered, the output of element D1.1 will be a logical unit. On the other two elements of the microcircuit, an RS flip-flop is assembled with a reverse reset circuit on C2 and R4.

As soon as the trigger is set to a state with a logic unit at the output D1.3, the capacitor C2 begins to slowly charge through R4, and after about 20 seconds the voltage across it reaches the logic unit threshold. And the trigger returns to its original position.

The trigger is blocked by the C1-R3 circuit. While C1 is discharged or the blocking switch S10 is closed, the voltage at terminal 12 D1.3 is a logical unit. While there is such a state, the voltage at the output of element D1.3 does not depend on the voltage at the terminals 1 and 2 of element D1.2 connected together. Therefore, the circuit does not respond to the state of the pyroelectric sensor.

After turning off S10, the capacitor C1 through the resistor R3 begins to slowly charge and after about 20 seconds the voltage across it reaches the logic zero threshold. Now the trigger will respond to the pyroelectric sensor, and when it is triggered, a logical unit will be set at the output of D1.3. The key on VT2 and VTZ will open and power will be supplied to the siren.

Disabling the alarm occurs in two stages. First you need to press the code buttons on the keyboard from the S0-S1 buttons. The keyboard is made according to the scheme of a simple combination lock. All buttons are toggle.

All are connected in series in the circuit, but the buttons that form the code are connected by normally open contacts, and all the rest are normally closed. As a result, the circuit is closed if only the buttons that form the code are pressed at the same time. In all other cases, the circuit is not closed. The code is set by mounting the buttons.

The figure shows the option for the code "045", - while pressing the buttons SO, S4 and S5, the circuit closes and discharges the capacitor C1. Now, for about 20 seconds, the circuit will not respond to the pyroelectric sensor, you can enter the room and finally block the alarm with switch S10 (turn it on).

The time during which the circuit is not sensitive to the pyroelectric sensor (time to enter and block or to unblock and exit) depends on the parameters of the circuit C1-R3. The minimum time during which the alarm sounds - by the R4-C2 circuit.

Details and installation

B1 - any electronic siren for car alarms. Buttons S0-S9 - toggle switches, non-latching. The logic part is mounted on the printed circuit board shown in Figure 3.

Rice. 3. Printed circuit board for a security device based on the pyro-sensor HC-SR501.

Keyboard buttons S0-S9 are installed on a separate panel and wired with mounting wires, according to the given code.

Karavkin V. RK-2015-11.

Infrared motion sensor HC-SR501

This article provides a description of the main characteristics and principles of operation of the finished IR sensor HC-SR501, which can be used both with arduino and separately.

The most important advantage of this sensor, in my opinion, is the price for aliexpress. I bought it for 42 rubles with free delivery in 2016.
Its second advantage is the ease of connection and use, since it does not contain any interfaces and has only three contacts (power, common and output).

In the "H" mode, a logical unit (+3.3 volts) appears at the output, which allows even a novice radio amateur to connect the sensor.

Main characteristics

  • Dimensions: 3.2 cm x 2.4 cm x 1.8 cm (approx.)
  • Sensitivity and delay time can be adjusted
  • Working voltage: DC 4.5V - 20V
  • Current:< 60 мA
  • Output signal: high / low level (0 or 1), signal: 3.3V TTL level
  • Detection range: 3 - 7 meters (adjustable by potentiometer)
  • Detection angle: 120-140° (Depends on installed Fresnel lens)
  • Trip delay time: 5-300 seconds (adjustable by potentiometer, default 5s -3%)
  • Blocking until the next measurement: 2.5 seconds (smd resolder can be changed)
  • Operating Temperature: -20 - 80°C
  • Working mode:
    • Mode H - in this mode, when the sensor is triggered several times in a row, its output (at OUT) remains at a high logic level.
    • L mode - in this mode, a separate pulse appears at the output each time the sensor is triggered.

The appearance of the motion sensor


In the photo above, the sensor is on both sides and with the Fresnel lens removed.
To set the operating modes, the module has two potentiometers and a jumper, I think their purpose is clear from the photo below:

HC SR501 upgrade

- About adjustment b locking until the next measurement (2.5 sec.)
As mentioned above in the main characteristics, the blocking time can be changed by replacing smd ,
its default resistance is 1 MΩ, in the diagram below it is designated R14 (between 5 and 6 legs of the microcircuit)
The resistance can be slightly reduced to increase performance, for example
replacing this resistor with 220 kΩ reduces the delay by a factor of 5, but be careful, excessive speed can cause the sensor to turn on immediately after trying to turn it off, such an effect observed already at 100 - 180 kOhm

- Photoresistor in HC-SR501
In addition to the standard sense organs of the pyroelectric sensor on the hc board SR501 you can also install a photoresistor. Often there are free contacts on the connection board. In the diagram below, its contacts are designated as RL.When a photoresistor is connected, the device will only work in the dark. When the photoresistor is illuminated, its resistance is low, and the voltage at input A3 of the DA1 chip will be insufficient to turn on the device.
You can adjust the switching threshold by connecting in parallel
resistor R9 tuning resistor. it is desirable to connect through a resistance of 100 - 200 ohms in order to prevent a short circuit at low resistances of the photoresistor.
Everything seems to be clear, if you don't understand, ask in the comments.

- Noise sensor in HC SR501
Perhaps a little superfluous, but there is such a possibility - connecting a noise sensor from the same arduino.
The signal wire through a 10 kΩ resistor connected in series with a 10 microfarad capacitor is connected to the 13th leg of the DA1 microcircuit (see diagram)

The noise sensor itself is best powered from a stable source of 3.3 -5 volts, you can take power from the stabilizer
in
HC-SR501 (7133) - DA2 chip.

- (thermistor) in HC-SR501
According to some reports, a thermistor is connected to the RT contacts of the IR sensor in parallel to R8,
I couldn't find any information about it on the Internet. Since this is a circuit between the first and second stages of amplification and the resistance R8 directly affects the sensitivity of the sensor, it can be assumed that the thermistor should ensure the sensor is triggered in case of fire or is simply an element of thermal stabilization, which in my opinion is unlikely.
In general, a new sensor has been ordered (the old one already controls the light), they will come and try it and describe what for what and why.
If you have an answer, you can write in the comments.

HC-SR501

The diagram may differ from the one shown, but not by much.
The supply voltage through the protective diode VD1 is supplied to the microcircuit voltage regulator
HT 7133-1.
C1 - filtering. The pyroelectric sensor is powered by voltage stabilizer through additional RC filter consisting of resistors R3, R4 and capacitor C4. From the output of the pyroelectric sensor through the resistor R2, the signal is fed to the non-inverting input of the operational amplifier A1, pin 14 of the DA1 chip. Resistor R2 is part of the U - shaped filter - C2, R2 and C5. The DA1 microcircuit is a specialized microcircuit and, in all likelihood, a Chinese brainchild, because the documentation for it is in Chinese. The DA1 circuit from the documentation is shown in Figure 2, and a typical switching circuit is in Figure 3. In addition to operational amplifiers and some logic cells, it is difficult to understand anything. But we don't need much.

And so, the amplified op-amp A1 sensor signal, pin 16 DA1, through a decoupling capacitor C6 and resistor R8 is fed to the inverting input of the second amplifier A2, pin 13 DA1. Capacitors C7 and C9 are apparently corrective, and resistor R10 is a feedback resistor, the value of which determines the transfer coefficient of this amplifier. The gain A1 is equal to R10/R5. The gain of the OU A2 is equal to the ratio of the sum of the resistances R6, R7 and the resistance of the resistor R8. Kus = (R6 + R7)/R8. Resistor R7 is trimmer, which gives us the opportunity to adjust the sensitivity of the circuit. In other words, you can adjust the distance from the sensor to the object at which the signal will appear at the output of the device. Conclusion 9 DA1 pulled up to the supply voltage. It can be used to turn the circuit on and off. If this pin is connected to a common wire, then the output signal at pin 2 will not appear. A photoresistor can be connected to the RL connector, then the device will only work in the dark. When the photoresistor is illuminated, when its resistance is low, then the voltage at input A3 of the DA1 chip will be insufficient to turn on the device. You can adjust the turn-on threshold with a trimming resistor connected in parallel with resistor R9.

Chip DA1 has an internal timer. Using this timer, you can set the duration of the output signal at pin 2. The timing circuit of this timer is resistors R13, R15 and capacitor C10. Time adjustment is made by resistor R15. The logical one level corresponds to a voltage of two volts, so in some cases a matching stage may be required to work with other blocks. The current consumption of the circuit is very small and is only 0.06 mA.

Sensor test

Checking the operation of the sensor is very simple by assembling a simple circuit on a breadboard. The indicator here is a conventional LED, with a current-limiting resistor of 180 ohms, as shown in the figure below.

You can buy a sensor HC-SR501here.

I take sound modules


PIR sensor translated from English as Pyroelectric (Passive) InfraRed sensor— pyroelectric (passive) infrared sensor. Pyro-electricity- this is the property to generate a certain electric field when the material is irradiated with infrared (thermal) rays. So PIR sensors allow to detect the movement of people in the controlled area, as the human body radiates heat.

HC-SR501 can be powered from 4.5 to 20 volts,
its dimensions are approximately 3.2cm x 2.4cm x 1.8cm,
Detection distance 3 - 7m, regulated by a variable resistor " Sensitivity Adjust"
Pulse Width at Detection 5 - 200sec is regulated by a variable resistor " Time Delay Adjust"
Working temperature-20 — +80°C

Operating modes
L and H
H mode- in this mode, when the sensor is triggered several times in a row, its output (at OUT) remains at a high logic level.
L mode- in this mode, a separate pulse appears at the output each time the sensor is triggered.

for example : set the light to turn on for 5 seconds.
mode L : there is movement - the light turned on, after 5 seconds. turned off. If you walk in front of the sensor all the time, the light is on-off-on-off, etc.
H mode : there is movement - the light turned on, after 5 seconds. turned off. If you walk in front of the sensor all the time, the light is on all the time.

After connecting power to the sensor, you must wait about 1 minute, the sensor is calibrated after switching on. Do not perform any actions with him at this time.

As soon as the sensor detects movement, the output Out voltage will appear and will remain there for a certain time set by a tuning resistor Delay. With this output voltage, we turn on the required device. It can be a lighting lamp, a fan, a sound annunciator. Of course, it will not be possible to power these devices directly from the sensor, the output is low-current, so we need something else to switch a powerful load.
The easiest option is to use FETs from an old computer motherboard.


You can play around with setting the sensitivity and installing the module in different places at home
So that the module does not slow down, you can replace R12 (which goes to the 6th output of the microcircuit) with 100 Ohms, it sets the frequency of the common generator.
If the sensor is used to turn on the lighting, you can install a photoresistor on the board, then during the daytime the sensor will not give a signal to turn on. For the photoresistor, the board has mounting holes above the input pins. There are also holes for installing a thermistor. Its installation will increase the sensitivity of the sensor and the accuracy of its operation.




Do not place the PIR sensor in places where the temperature changes rapidly. This will lead to the fact that the sensor will not be able to detect the presence of a person in the controlled area, and there will be many false positives, but with the thermistor installed, there will be no such problem.

You can make your home a little smarter and more economical by installing such sensors in places where you need to turn on the lights only while a person or a warm-blooded animal is there.