Homemade LED lamp based on the HC-SR501 IR sensor. Lamp with automatic switching on Motion sensor for turning on the light 501 circuit

infrared sensor motion (PIR motion sensor) HC-SR501 (DSN-FIR800) used to detect movement of objects in the controlled area that emit infrared radiation (heat). The principle of operation of the sensor is based on pyroelectricity.

Pyroelectricity is the property of generating a certain electric field when the material is irradiated with infrared (thermal) rays. A Fresnel lens is installed above the sensing element, which is used to increase the viewing radius and amplify the incoming infrared signal.

Modules HC-SR501 is a module consisting of a 500BP IR sensor, a Fresnel lens, and a BISS0001 microcircuit control module. The module operation mode is set by a jumper (mode H or mode L).

Operating modes

The module operation mode is set by a jumper. There are two modes - H mode and L mode. In the photo, the module is set to H mode.

  • 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. Red jumper.
  • L mode- in this mode, a separate pulse appears at the output each time the sensor is triggered. Yellow jumper.

Note:
On this instance, there is no block for the jumper, but there are contacts on the board for sealing the jumper, and option H is already closed by a printed conductor.
To select L mode, you must remove the factory jumper (as shown in the picture).

Key Features of HC-SR501

  • Color: white green
  • Dimensions: 3.2 cm x 2.4 cm x 1.8 cm (approx.)
  • Infrared sensor control board
  • Sensitivity and delay time can be adjusted
  • Working voltage: DC 4.5V-20V
  • Current:<60 mA
  • Output voltage: high / low signal level: 3.3V TTL output
  • Detection range: 3 - 7M (can be adjusted)
  • Detection range:<140 °
  • Delay time: 5-200S (can be adjusted, default 5s -3%)
  • Time blockade: 2.5S (default)
  • Trigger: L: Non-repeatable trigger H: Repeat trigger (default)
  • Operating Temperature: -20 - 80°C
  • Trigger method: L unique trigger / H repeat trigger

Contacts:

OUT(output signal) – contact for data exchange between the sensor and the microcontroller;
VCC- supply voltage (4.5 - 20v);
GND- general contact.


Infrared motion sensor HC-SR501 it is not recommended to use in places with sudden temperature changes (a sharp burst of infrared radiation) from heating, it will be perceived as the appearance of a moving object, which may cause false alarms.
The HC-SR501 module is often used in burglar alarms, as well as in smart homes to control lighting when a person enters the room.

HC-SR501 is a pyroelectric infrared motion sensor that allows you to detect the movement of people in a controlled area. It is a module consisting of a 500BP IR sensor, a Fresnel lens, and a BISS0001 microcircuit control module. The module operation mode is set by a jumper (mode H or mode L).

In H mode, when the sensor is triggered several times in a row, its output (at OUT) remains at a high logic level. In L mode, a separate pulse is sent to the output each time the sensor is triggered.
It is not recommended to use the sensor in places with sudden temperature changes - it will perceive a sharp burst of infrared radiation from heating as the appearance of a moving object, which can cause false alarms.

HC-SR501 is often used in burglar alarms, as well as in smart homes to control lighting when a person enters the room.

Characteristics:


Supply voltage
4.5V-20V
Current on OUT
<60uA
Output voltage
High and low levels in 3.3V TTL logic
Detection distance
3.7m (customizable)
Detection angle
up to 120°-140° (depending on the specific sensor and lens)
Pulse Width at Detection
5 - 200sec. (configurable)
Blocking time until the next measurement
2.5sec (but can be changed by replacing SMD resistors)
Working temperature
-20....+80°C
Working mode
L - single capture, H - repeated measurements
Dimensions
3.2cm x 2.4cm x 1.8cm

In the struggle for the life of incandescent lamps on the landing, I tried a fairly large number of schemes for their protection. These were both simple diodes and soft start circuits, and acoustic sensors. Not all have proven themselves on the positive side. Going to the Aliexpress website, I came across a pyroelectric sensor HC-SR501. At a price of less than one dollar, the sensor has a number of positive qualities, namely: power supply from 5 to 20 volts, motion detection zone from 3 to 7 meters, turn-off delay from 5 to 300 seconds. (I don’t see the point in giving a full description here, since this information is more than enough). Externally, the sensor looks like this:

Just what you need to illuminate the landing, where people do not walk so often and the constant glow of the lamp is useless.

The photo below shows the connection points for the common wire (GND), the trigger signal output (Output) and the power bus (+ Power). The board has two variable resistances: one regulates the response zone (Sensitivity Adjust), the other the turn-off delay (Time Delay Adjust).

In addition, there is a jumper for switching modes. H And L. In mode L the sensor, having fixed the movement, outputs a high-level signal. Regardless of whether there is further movement in the detection area or not, after a set delay time (for example, 30 seconds), the output signal will be turned off.

In mode H the output signal will disappear only after the delay time has elapsed from the moment of the last motion detection in the detection zone. That is, they passed through the movement zone - it will turn off after 30 seconds, stay and move in the detection zone for 10 minutes and leave it - it will turn off after 30 seconds. While you are in the detection zone, the sensor will not turn off.

Just what you need to illuminate the landing, where people do not walk so often and the constant glow of the lamp is useless. Having studied the datasheet and materials on the network, I discarded the Arduino use cases as excessively costly and sketched the following circuit.

Functionally, the device consists of three nodes:

  1. the HC-SR501 sensor itself;
  2. an actuator consisting of a resistor R3, a transistor VT1, a diode D1 and a relay P1, where R3 and VT1 serve as a link between the sensor and the relay. Without them, the load capacity of the sensor is so low that only an LED can be connected directly;
  3. transformerless power supply, where R1 is necessary to reduce the inrush current (often it can be neglected), capacitor C1 with a rating of 0.47 - 0.68 uF with an operating voltage of at least 250 volts provides an output current of up to 0.05 A, R2 is necessary for discharging capacitor C1 after disconnecting the device from the network.

Why a diode bridge is known to everyone. The filter capacitor should be selected with an operating voltage of at least 25 volts. Well, finally, the zener diode sets the voltage at the output of the power supply at 12 volts. The choice of a zener diode specifically for 12 volts is due, on the one hand, to the supply range of the sensor from 3 to 20 volts, on the other hand, the operating voltage of the relay is 12 volts.

Separately, it is worth mentioning the transistor. This is practically any NPN transistor structure - 2N3094, BC547, KT3102, KT815, KT817, etc. etc.

A relay with almost any coil resistance, a switching voltage of 250 volts and a current of 3 amperes, which will make it possible to safely switch a load of several hundred watts.

You can buy the sensor in the FastAVR project partner store with a 10% discount if you follow the link

Motion sensor (PIR Motion sensor) HC-SR501 connection to Arduino

PIR-sensor is translated from English as Pyroelectric (Passive) InfraRed sensor - a pyroelectric (passive) infrared sensor. Pyroelectricity is the property of generating a certain electric field when a material is irradiated with infrared (thermal) rays. Therefore, PIR sensors make it possible to detect the movement of people in a controlled area, since the human body radiates heat. Such sensors are small in size, inexpensive, and have low power consumption. They are easy to use and do not wear out. For these reasons, they are used in most industrial motion sensors.
Do not place PIR sensors in places where the temperature changes rapidly. This will lead to the fact that the sensor will not be able to detect the appearance of a person in the controlled area, and there will be many false positives.
Thanks to our "Chinese brothers", a module consisting of the PIR sensor itself and the control circuit has become very popular for home use. They combined everything into one module and called it HC-SR501.

Basic parameters of the HC-SR501 module

Parameter Value
Dimensions approx 3.2cm x 2.4cm x 1.8cm
Supply voltage DC 4.5V- 20V
Current on OUT o -140 o (depending on the specific sensor and lens)

Pulse duration
on detection 5 - 200sec.(configurable)

Blocking time up to
next measurement 2.5sec. (but can be changed by replacing SMD resistors)

Working temperature -20 - +80 o C
Operating mode L - single capture, H - repeated measurements

Description
The whole module looks like this:

And this is what it looks like with the Fresnel lens removed. What is this lens can be read on Wikipedia. The photo shows the PIR sensor 500BP.

Closer up

And this is the reverse side of the module with the power supply and control circuit.

The module has several settings. Two switches and a jumper. From the picture, I think everything should be clear.

Operating modes

The module operation mode is set by a jumper. There are two modes - H mode and L mode. In the photo above, the module is set to H mode.

  • 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.

Well, one more picture, copied from the datasheet to the PIR sensor:

Scheme

You can check the operation of the sensor by assembling the simplest circuit on the breadboard. As an indicator, a conventional LED is used here.

Assemble this diagram. The jumper must be set to operating mode L. Apply power. Wait approximately 20-40 seconds (up to 60 seconds for some modules). At this time, the sensor is being calibrated.
Now, as soon as the sensor detects movement, the LED will glow for a certain time, set by the tuning resistor. You can play around with setting the sensitivity and installing the module in different places in the house.
It is better (although not necessary) to connect the module to microcontrollers (well, or other microcircuits) through a transistor and a 10k pull-up resistor. Here is an example diagram:

Or here: