“【RuilongMaker出品】红外测障 光电传感器”参数说明
认证: | ruilongmaker | 适用年龄: | 10岁以上 |
材质: | 塑料 | 型号: |  XH2.54 3Pin |
规格: | 3PIN-30 | 商标: | ruilongmaker |
包装: | 特供包装盒(可订做) | 产量: | 10000 |
“【RuilongMaker出品】红外测障 光电传感器”详细介绍
红外测障传感器,上电后静置1-2S,用手挡传感器探头前方,可以看见红色指示灯变亮,同时可以通过电位计调节来实现检测距离的调节。
- 电源要求:+3.0-5.5V
- 信号类型:数字信号
- 接口模式:XH2.54×3
- 引脚定义:G-地 V-电源 S-默认高电平(挡光变低电平,红灯亮)
- 模块重量:15g
- 1pcs x 红外测障传感器
- 1pcs x XH2.54 3Pin 20cm 传感器线
(1)连线方法:按照传感器模块接口标号与主控制器相连接,标号“G”接主控制器的“地”、“V”接“电源”、“S”接“Arduino UNO R3”A0;(2)Arduino IDE中复制粘贴以下代码,可以通过串口监视器查看挡光前后输出的IO状态。
// These constants won't change. They're used to give names// to the pins used:const int analogInPin = A0; // Analog input pin that the potentiometer is attached toint sensorValue = 0; // value read from the potvoid setup() { // initialize serial communications at 9600 bps: Serial.begin(9600);}void loop() { // read the analog in value: sensorValue = analogRead(analogInPin); // print the results to the serial monitor: Serial.print("sensor = " ); Serial.print(sensorValue); delay(2);}