The HC-SR501 PIR Pyroelectric IR Infrared People Detector Module is used to detect the presence of people.
PIR sensors are commonly used to turn lights on and off automatically when people enter and leave a room. Your robot can use them to detect people as well.
This Pyroelectric IR sensor has range of about 7 meters with a 120 degree cone angle. It can operate from 3.6-20V but we recommend powering it with 5V. There are adjustments for the detection range output delay.
Connect a 5V power supply to the Voltage (VCC) and Ground (GND) pins. Connect the Output (OUT) pin to a digital input on your robot's microcontroller. In the default repeating mode, when someone enters the sensor's range, the Output pin will go HIGH and stay HIGH until no person is in range. The adjustable delay will affect how much time it takes for the Output to switch to LOW again after a person is no longer in range.
By default, the module operates in repeating mode with a jumper hard wired to the L position. This trace can be cut and a jumper or solder bridge applied to the H position operating in oneshot trigger mode. The oneshot trigger mode will pulse the Output (OUT) pin HIGH briefly when a person is first detected. It will not remain HIGH while the person is in range. When using the default repeating mode, the Output (OUT) pin will remain HIGH while a person a detected. We recommend leaving the jumper trace as-is and using the default repeating mode.