Welcome to Human Body Infrared Module repository
body induction lamp
Body induction lamp
1. Purpose
In this course, we mainly learn to use Arduino, human infrared sensor module and RGB light module to realize human body sensor light.
2. Preparation
Wiring diagram as shown below.

Note: As shown in the figure below, we use the Uno sensor expansion board. If you don’t have an expansion board, you can connect the Arduino board and the sensor module by DuPont lines.
3. About code
Please check .ino file.
In the main loop, the level state of the pin of the infrared sensor connected to the Arduino is continuously detected.
When the pin is high, it means that the human body is detected, and the RGB light is on white, otherwise the RGB light is off.
4. Compiling and downloading code
4.1 We need to open the .ino file by Arduino IDE software. Then click“√”under the menu bar to compile the code, and wait for the word "Done compiling " in the lower left corner, as shown in the figure below.
4.2 In the menu bar of Arduino IDE, we need to select 【Tools】---【Port】--- selecting the port that the serial number displayed by the device manager just now, as shown in the figure below.


4.3 After the selection is completed, you need to click “→”under the menu bar to upload the code to the UNO board. When the word “Done uploading” appears in the lower left corner, the code has been successfully uploaded to the UNO board, as shown in the figure below.

5. Phenomenon
After the program is downloaded successfully, when the human body is close to the sensor, the RGB light will be on white for 3S.
If it is continuously detected, it will keep on. When the human is far away from the detection range of the sensor, the RGB light will be off.