18228浏览
查看: 18228|回复: 8

要安心“摸鱼” ? 来试试检测微波

[复制链接]
本帖最后由 安卓机器人 于 2021-7-16 12:57 编辑

要安心“摸鱼” ? 来试试检测微波图1
鱼儿很美,摸鱼儿快乐


要安心“摸鱼” ? 来试试检测微波图2
朝九晚五的长时间工作容易让效率变低,我们需要适当“微休息”,上班时间摸鱼就是一种 “微休息行为”,是一种针对心理资源的管理策略。劳逸结合,调节心态,通过短暂的微休息行为来恢复我们整个工作中消耗的心理资源,并获得更多的积极情绪,所以,我认为一定能促进工作效率呢。

但是,大多数领导们对于这种上班行为当然是看不惯,因为很可能不能按时完成工作任务啊。

所以“摸鱼”时,我们的内心一定不可能安定!

为此,这里推荐用“微波运动传感器”来检测我的周围环境动态,做到提前预警,随时切换到工作状态!

查阅到微波运动传感器的优点如下 ~
微波探测方式与其它探测方式相比:
非接触探测;
不受温度、湿度、噪声、气流、尘埃、光线等影响,适合恶劣环境;
抗射频干扰能力强;
输出功率小,对人体构不成危害;
探测距离远(本模块2-16米);
支持对非生命类物体的检测;
微波的方向性很好,能够穿透任何非金属物体(很容易隐藏它),速度等于光速;
寿命长,大于100000小时,高可靠性、稳定性。

要安心“摸鱼” ? 来试试检测微波图3

Arduino控制板
要安心“摸鱼” ? 来试试检测微波图5

遮蔽物用于隐藏
要安心“摸鱼” ? 来试试检测微波图4

检测预警灯(红、黄)
要安心“摸鱼” ? 来试试检测微波图6

接线图(与下面程序相关)
要安心“摸鱼” ? 来试试检测微波图8


隐藏模块
要安心“摸鱼” ? 来试试检测微波图7

两个模块配合检测角度更广

要安心“摸鱼” ? 来试试检测微波图9

  1. /***********Notice and Trouble shooting***************
  2.   1.Connection and Diagram can be found here
  3.   <https://wiki.dfrobot.com.cn/index.php?title=%28SKU:SEN0192%29_Microwave_sensor%E5%BE%AE%E6%B3%A2%E4%BC%A0%E6%84%9F%E5%99%A8%E6%A8%A1%E5%9D%97>
  4.   2.This code is tested on Arduino Uno, Leonardo, Mega boards.
  5.   3.arduino Timer library is created by jonoxer.
  6.   See <https://www.dfrobot.com.cn/images/upload/File/SEN0192/20160112134309yy5nus.zip arduino Timer library> for details.
  7. ****************************************************/
  8. #include <MsTimer2.h>           //Timer interrupt function
  9. int pbfIn = 0;  // Define the interrupt PIN is 0, that is, digital pins 2
  10. int pbbIn = 1;  
  11. int ledfOut = 10;
  12. int ledbOut = 11;
  13. int countf = 0;
  14. int countb = 0;
  15. volatile int statef = LOW;       //Define ledOut, default is off
  16. volatile int stateb = LOW;
  17. void setup()
  18. {
  19.   Serial.begin(9600);
  20.   pinMode(ledfOut, OUTPUT);
  21.   pinMode(ledbOut, OUTPUT);
  22.   attachInterrupt(pbfIn, statefChange, FALLING); // Sets the interrupt function, falling edge triggered interrupts.
  23.   attachInterrupt(pbbIn, statebChange, FALLING);
  24.   MsTimer2::set(100, process); // Set the timer interrupt time 1000ms
  25.   MsTimer2::start();//Timer interrupt start
  26. }
  27. void loop()
  28. {
  29. //  Serial.println(count); // Printing times of 1000ms suspension
  30.   delay(1);
  31.   if (statef == HIGH ||stateb == HIGH) //When moving objects are detected later, 2s shut down automatically after the ledout light is convenient.
  32.   {
  33.     delay(100); //2000
  34.     if(statef == HIGH){
  35.       statef = LOW;   
  36.       digitalWrite(ledfOut, statef);    //Turn off led
  37.     }
  38.     if(stateb == HIGH){
  39.       stateb = LOW;   
  40.       digitalWrite(ledbOut, stateb);    //Turn off led
  41.     }
  42.   }
  43. }
  44. void statefChange()  //Interrupt function
  45. {
  46.   countf++;
  47. }
  48. void statebChange()  //Interrupt function
  49. {
  50.   countb++;
  51. }
  52. void process()   //Timer handler
  53. {
  54.   if (countf > 10) //1000ms interrupt number greater than 1 is considered detected a moving object (this value can be adjusted according to the actual situation, equivalent to adjust the detection threshold of the speed of a moving object)
  55.   {
  56.     statef = HIGH;
  57.     digitalWrite(ledfOut, statef);    //Lighting led
  58.     countf = 0; //Count zero
  59.   }
  60.   if (countb > 10) //1000ms interrupt number greater than 1 is considered detected a moving object (this value can be adjusted according to the actual situation, equivalent to adjust the detection threshold of the speed of a moving object)
  61.   {
  62.     stateb = HIGH;
  63.     digitalWrite(ledbOut, stateb);    //Lighting led
  64.     countb = 0; //Count zero
  65.   }
  66. //  else
  67. //    count = 0; //In 1000ms, interrupts does not reach set threshold value is considered not detect moving objects, interrupt the count number is cleared to zero.
  68. }
复制代码
实测


后记:

添加其它传感器,如PIR,就会只检测人员;

由先前运动检测进而人脸识别或走姿识别就可以更准确;

...


image109.360doc.gif

KIKI  管理员

发表于 2021-7-16 13:03:13

为什么要包起来
回复

使用道具 举报

安卓机器人  中级技神
 楼主|

发表于 2021-7-16 13:45:18

本帖最后由 安卓机器人 于 2021-7-16 13:51 编辑
KIKI 发表于 2021-7-16 13:03
为什么要包起来

减少暴露机会呀~全部放在盒子里也可以。
回复

使用道具 举报

糖醋花生  高级技师

发表于 2023-1-30 19:59:25

《如果老板看见了》
回复

使用道具 举报

三春牛-创客  初级技神

发表于 2023-8-12 12:00:37

厉害厉害
回复

使用道具 举报

三春牛-创客  初级技神

发表于 2023-8-12 12:01:38

哈哈,摸鱼神器
回复

使用道具 举报

三春牛-创客  初级技神

发表于 2023-8-12 12:02:40

赞赞赞赞赞
回复

使用道具 举报

花生编程  中级技匠

发表于 2023-8-13 16:26:13

厉害厉害
回复

使用道具 举报

花生编程  中级技匠

发表于 2023-8-13 16:27:15

不错不错
回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail