[其他] 人体红外传感器HC-SR501

[复制链接]
 楼主| 为你转身 发表于 2023-6-29 12:19 | 显示全部楼层 |阅读模式
HC-SR501
16935649d062599003.png

① 调节灵敏度 逆时针低
② 调节延时 逆时针低

调节距离电位器逆时针旋转,感应距离减小(约 3 米),反之,感应距离增大(约 7 米)
调节延时电位器逆时针旋转,感应延时减短(约 0.5S),反之,感应延时加长(约300S)
③ 触发方式选择

跳帽接上两个针脚(如上图),为H(可重复触发),在延时时段内,若感应到,将一直保持高电平
跳帽接下两个针脚,为L(不可重复触发),延时结束,自动从高电平转到低电平
当感应到人体,其IO输出3.3V高电平


 楼主| 为你转身 发表于 2023-6-29 12:19 | 显示全部楼层
模块参数:

工作电压:DC5V至20V
静态功耗:65微安
电平输出:高3.3V,低0V
延时时间:可调(0.3秒~18秒)
封锁时间:0.2秒
触发方式:L不可重复,H可重复,默认值为H(跳帽选择)
感应范围:小于120度锥角,7米以内
工作温度:-15~+70度
参考:https://blog.csdn.net/sinat_33523805/article/details/78701878?utm_medium=distribute.pc_relevant.none-task-blog-title-3&spm=1001.2101.3001.4242
 楼主| 为你转身 发表于 2023-6-29 12:19 | 显示全部楼层
PIR传感的模拟信号经BISS0001运算放大,输出到IO。

19426649d0664969fa.png

 楼主| 为你转身 发表于 2023-6-29 12:20 | 显示全部楼层
试验
试验中探测IO电平3.56v左右。
98720649d0672a9d41.png
 楼主| 为你转身 发表于 2023-6-29 12:20 | 显示全部楼层
试验设置感应led接线
20205649d06875e70e.png
 楼主| 为你转身 发表于 2023-6-29 12:20 | 显示全部楼层
树莓派样例
  1. import RPi.GPIO as GPIO
  2. import time

  3. def init():
  4.         GPIO.setwarnings(False)
  5.         GPIO.setmode(GPIO.BCM)
  6.         GPIO.setup(23, GPIO.IN)
  7.         GPIO.setup(16,GPIO.OUT)
  8.         GPIO.output(16, GPIO.LOW)
  9.         pass
  10. def led():
  11.         GPIO.output(16, GPIO.HIGH)
  12.         time.sleep(0.5)
  13.         print "detct people led turn on"

  14. def detct():
  15.         for i in range(1, 31):
  16.                 if GPIO.input(23) == True:
  17.                         print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))+"  Someone is closing!"
  18.                         led()
  19.                 else:
  20.                         GPIO.output(16, GPIO.LOW)
  21.                         print time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))+"  No one!"
  22.                 time.sleep(2)
  23. time.sleep(2)
  24. init()
  25. detct()
  26. GPIO.output(16, GPIO.LOW)
  27. GPIO.cleanup()
 楼主| 为你转身 发表于 2023-6-29 12:20 | 显示全部楼层
  1. root@ton_tom:/home/python # python hc-sr501.py
  2. 2022-02-14 17:26:08  Someone is closing!
  3. detct people led turn on
  4. 2022-02-14 17:26:10  Someone is closing!
  5. detct people led turn on
  6. 2022-02-14 17:26:13  No one!
  7. 2022-02-14 17:26:15  No one!
  8. 2022-02-14 17:26:17  No one!
 楼主| 为你转身 发表于 2023-6-29 12:21 | 显示全部楼层
您需要登录后才可以回帖 登录 | 注册

本版积分规则

82

主题

740

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部

82

主题

740

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部