How to Use Infrared Motion Sensor Module
A sensor that uses infrared to detect whether people or objects are moving. It can also be used as a switch to trigger sounds when someone passes by.
About the Component
Using a sensor capable of receiving infrared at the part marked with a red circle in the photo, it outputs whether there is an obstacle in front of the sensor as a digital signal: High(true) / Low(false).
※ The detection distance may be affected, so please use the sensor parallel to the ground when using it.
※ The optimal detection distance is at 25°C, and the detection distance decreases when the temperature exceeds 30°C.
※ Connect the SPACEBLOCK microcontroller board and the infrared motion sensor module, then wait 5-10 seconds before starting the project. If you move immediately after connecting, the detection may not be accurate for the first 5-10 seconds.
Specifications
Voltage | 電圧 | 3~5V | |
---|---|---|---|
Output Signal | Digital | 出力信号 | デジタル |
Detection Distance | 検出距離 | 3~4m | |
Detection Angle | 検出角度 | 100° | |
Temperature Range | 温度範囲 | -20~85℃ | |
Size | サイズ | 34 x 20 (mm) |
Connection
Connect the infrared motion sensor module to the SPACEBLOCK microcontroller board using jumper wires (male-female) as follows:
- Connect the S pin of the infrared motion sensor to a digital compatible pin on the SPACEBLOCK
- Connect the G pin of the infrared motion sensor to the GND pin of the SPACEBLOCK
- Connect the V pin of the infrared motion sensor to the 5V or 3.3V pin of the SPACEBLOCK
※ The image shows the signal line connected to pin A0. Digital compatible pins include A0 to A10, A13, A15, B0 to B15, and C14 to C1.
※ 5V, 3.3V, and GND can also be inserted into pins with the same markings on the SPACEBLOCK microcontroller board.
Usage
When something nearby moves, it returns High(true) for about 2 seconds after detection. If there is no movement, it returns Low(false). You can retrieve values from the infrared motion sensor module using the block in the 'Input' category of your project.
For detailed usage of the block, click here.
Digital Reading2