本帖最后由 木子呢 于 2021-8-2 10:56 编辑
AI核酸采集医护助手
作品来源:第四届全国青少年人工智能创新挑战赛之单片机创意智造挑战赛初中组晋级作品
参赛作者:石家庄石门实验学校 邱袁睿赫 王煜迪
指导老师:石家庄石门实验学校 何忠才 王丹丹
医护端介绍:
医护端采用的是掌控版作为主控版,利用wifi连接上物联网Easy loT平台进行远程人工控制和数据的传输、加上AI视觉传感器、语音识别、语音合成、温湿度传感器、按钮模块以及掌控版自带RGB灯实现所需的功能。
当有人进行核酸采集时,医护人员按AI视觉传感器的学习按钮,进行人员学习和信息录入,这样省去了大部分录入信息的时间。
采取语音识别传感器进行人机交互,比如医护人员全身穿着防护服不容易得知温湿度,可以直接采取语音识别询问温度和湿度,医护端的显示屏会显示当前的温度和湿度,并且会通过语音合成模块进行播报。
可以通过人机交互询问一些核酸采集常见的问题。比如核酸检测出结果时间,费用问题。这些都会通过掌控版显示器和语音合成模块播报。
再就是该医护端还有核酸检测结果查询功能,通过AI视觉传感器进行人脸识别,可以通过wifi获取结果,并且通过显示器和语音合成进行显示和播放。假如核酸结果为非阴性,显示器和语音合成会提示“做好防护 请按黄色按钮 联系防疫人员”,之后通过物联网进行远程汇报,防疫人员可以及时收到信息,再通过物联网进行回复,提醒该人员原地等待。
客户端介绍:
客户端主要实现是实现核酸采集是的安全提醒,采用是Arduino作为主控板,连接上非接触红外温度传感器、人体热释电红外传感器、超声波测距传感器、音频录放模块,和黄绿led灯以及led显示屏来实现功能。
人体热释电判断当前有无人员做核酸采集,若无,测绿色led灯亮,屏幕提示“请往前走 测量体温”。当靠近时,会通过非接触红外温度传感器测定该人是否发热。若有人正在核酸采集,则会通过超声波测距是否排队人员在1米以外,若1米以内,显示屏会提示“请在1米外等候”并且会通过喇叭提醒。若1米内无人,红色led会亮起,提醒下一个人等待。
视频:
制作步骤步骤1:第一步 设计整体思路和功能实现需要哪些传感器
步骤2:进行编程
步骤3:结构件的设计
步骤4:进行结构木板的切割
步骤5:功能搭建安装
步骤6:设备的调试
硬件清单
代码:
- /*!
- * MindPlus
- * mpython
- *
- */
- #include <MPython.h>
- #include<DFRobot_ASR.h>
- #include <DFRobot_Iot.h>
- #include <DFRobot_DHT.h>
- #include <DFRobot_HuskyLens.h>
- #include<DFRobot_SpeechSynthesis.h>
-
- // 动态变量
- volatile float mind_n_ZhiLing;
- // 函数声明
- void whenTopic0Received0();
- // 静态常量
- const String topics[5] = {"vVWftpcMg","","","",""};
- // 创建对象
- DFRobot_Iot myIot;
- DFRobot_HuskyLens huskylens;
- DFRobot_ASR asr;
- DFRobot_SpeechSynthesis_I2C sstts;
- DFRobot_DHT dht11_P8;
-
-
- // 主程序开始
- void setup() {
- mPython.begin();
- myIot.setMqttCallback(topic_0, "已安排", whenTopic0Received0);
- asr.begin(PASSWORD,MIC);
- asr.addCommand("xiao hu",0);
- asr.addCommand("wen du",1);
- asr.addCommand("shi du",2);
- asr.addCommand("jie guo",3);
- asr.addCommand("fei yong",4);
- asr.addCommand("cha xun",5);
- asr.start();
- sstts.begin();
- sstts.setVolume(10);
- sstts.setSpeed(5);
- sstts.setSoundType(sstts.FEMALE2);
- sstts.setTone(5);
- dht11_P8.begin(P8, DHT11);
- rgb.write(-1, 0x000000);
- rgb.write(-1, 0xFFFFFF);
- myIot.wifiConnect("Redmi", "123456789");
- while (!myIot.wifiStatus()) {yield();}
- display.fillScreen(0);
- display.setCursor(24, 22);
- display.print("wifi连接成功");
- delay(1000);
- myIot.init("iot.dfrobot.com.cn","fAZ-pt5Mg","","BAW-tt5GRz",topics,1883);
- myIot.connect();
- while (!myIot.connected()) {yield();}
- display.fillScreen(0);
- display.setCursor(24, 22);
- display.print("MQTT连接成功");
- delay(1000);
- display.fillScreen(0);
- huskylens.beginSoftwareSerialUntilSuccess(P14, P13);
- display.setCursor(24, 22);
- display.print("人脸识别初始化成功");
- delay(1000);
- display.fillScreen(0);
- huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION);
- display.setCursor(24, 22);
- display.print("语音识别初始化成功");
- delay(1000);
- display.fillScreen(0);
- display.setCursor(24, 22);
- display.print("语音合成初始化成功");
- delay(1000);
- display.fillScreen(0);
- rgb.write(-1, 0x000000);
- }
- void loop() {
- rgb.write(1, 0x0000FF);
- mind_n_ZhiLing = (asr.read());
- rgb.write(1, 0xFF0000);
- if ((mind_n_ZhiLing==0)) {
- sstts.speak("有什么可以帮助你");
- }
- else if ((mind_n_ZhiLing==1)) {
- sstts.speak((String("当前室温为") + String((String(dht11_P8.getTemperature())))));
- display.setCursor(16, 22);
- display.print((String("当前室温为") + String((String(dht11_P8.getTemperature())))));
- }
- else if ((mind_n_ZhiLing==2)) {
- sstts.speak((String("当前湿度为") + String((String(dht11_P8.getHumidity())))));
- display.setCursor(16, 22);
- display.print((String("当前湿度为") + String((String(dht11_P8.getHumidity())))));
- }
- else if ((mind_n_ZhiLing==3)) {
- sstts.speak("大约二十四小时后出结果");
- }
- else if ((mind_n_ZhiLing==4)) {
- sstts.speak("单人八十元一次,五人管二十元每人");
- }
- else if ((mind_n_ZhiLing==5)) {
- huskylens.request();
- if (huskylens.isLearned(1)) {
- if (huskylens.isAppearDirect(HUSKYLENSResultBlock)) {
- if (huskylens.isAppear(1,HUSKYLENSResultBlock)) {
- sstts.speak("魏书翔的核酸结果为阴性");
- }
- else {
- display.setCursor(34, 10);
- display.print("做好防护");
- sstts.speak("做好防护");
- display.setCursor(30, 28);
- display.print("按黄色按钮");
- sstts.speak("按黄色按钮");
- display.setCursor(28, 46);
- display.print("联系防疫人员");
- sstts.speak("联系防疫人员");
- delay(1000);
- display.fillScreen(0);
- delay(1000);
- if (((digitalRead(P15))==1)) {
- display.setCursor(30, 28);
- display.print("已联系请等待");
- sstts.speak("已联系请等待");
- delay(3000);
- myIot.publish(topic_0, "请来接我");
- delay(2000);
- display.fillScreen(0);
- }
- }
- }
- }
- }
- }
-
-
- // 事件回调函数
- void whenTopic0Received0() {
- display.setCursor(30, 28);
- display.print("已安排人员");
- sstts.speak("已安排人员");
- delay(2000);
- display.fillScreen(0);
- }
复制代码
代码:
- /*!
- * MindPlus
- * uno
- *
- */
- #include <DFRobot_MLX90614.h>
- #include <DFRobot_Ultrasonic.h>
- #include <DFRobot_SSD1306_I2C.h>
-
- // 动态变量
- volatile float mind_n_distance, mind_n_temperature, mind_n_H;
- // 静态常量
- const chCode chBuf[] = {
- {0x8bf7,0xe8afb7,0xC7EB,{0x00,0x40,0x40,0x40,0x27,0xfc,0x20,0x40,0x03,0xf8,0x00,0x40,0xe7,0xfe,0x20,0x00,0x23,0xf8,0x22,0x08,0x23,0xf8,0x22,0x08,0x2b,0xf8,0x32,0x08,0x22,0x28,0x02,0x10}},
- {0x5411,0xe59091,0xCFF2,{0x02,0x00,0x04,0x00,0x08,0x00,0x7f,0xfc,0x40,0x04,0x40,0x04,0x47,0xc4,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x47,0xc4,0x44,0x44,0x40,0x04,0x40,0x14,0x40,0x08}},
- {0x524d,0xe5898d,0xC7B0,{0x10,0x10,0x08,0x10,0x08,0x20,0xff,0xfe,0x00,0x00,0x3e,0x08,0x22,0x48,0x22,0x48,0x3e,0x48,0x22,0x48,0x22,0x48,0x3e,0x48,0x22,0x08,0x22,0x08,0x2a,0x28,0x24,0x10}},
- {0x8d70,0xe8b5b0,0xD7DF,{0x01,0x00,0x01,0x00,0x01,0x00,0x3f,0xf8,0x01,0x00,0x01,0x00,0xff,0xfe,0x01,0x00,0x01,0x00,0x11,0x00,0x11,0xf8,0x11,0x00,0x11,0x00,0x29,0x00,0x47,0xfe,0x80,0x00}},
- {0x68c0,0xe6a380,0xBCEC,{0x10,0x40,0x10,0x40,0x10,0xa0,0x10,0xa0,0xfd,0x10,0x12,0x08,0x35,0xf6,0x38,0x00,0x54,0x88,0x50,0x48,0x92,0x48,0x11,0x50,0x11,0x10,0x10,0x20,0x17,0xfe,0x10,0x00}},
- {0x6d4b,0xe6b58b,0xB2E2,{0x00,0x04,0x27,0xc4,0x14,0x44,0x14,0x54,0x85,0x54,0x45,0x54,0x45,0x54,0x15,0x54,0x15,0x54,0x25,0x54,0xe5,0x54,0x21,0x04,0x22,0x84,0x22,0x44,0x24,0x14,0x08,0x08}},
- {0x4f53,0xe4bd93,0xCCE5,{0x08,0x40,0x08,0x40,0x08,0x40,0x10,0x40,0x17,0xfc,0x30,0x40,0x30,0xe0,0x50,0xe0,0x91,0x50,0x11,0x50,0x12,0x48,0x15,0xf4,0x18,0x42,0x10,0x40,0x10,0x40,0x10,0x40}},
- {0x6e29,0xe6b8a9,0xCEC2,{0x00,0x00,0x23,0xf8,0x12,0x08,0x12,0x08,0x83,0xf8,0x42,0x08,0x42,0x08,0x13,0xf8,0x10,0x00,0x27,0xfc,0xe4,0xa4,0x24,0xa4,0x24,0xa4,0x24,0xa4,0x2f,0xfe,0x00,0x00}},
- {0x6b63,0xe6ada3,0xD5FD,{0x00,0x00,0x7f,0xfc,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x11,0x00,0x11,0xf8,0x11,0x00,0x11,0x00,0x11,0x00,0x11,0x00,0x11,0x00,0x11,0x00,0xff,0xfe,0x00,0x00}},
- {0x5e38,0xe5b8b8,0xB3A3,{0x01,0x00,0x11,0x10,0x09,0x20,0x7f,0xfe,0x40,0x02,0x9f,0xf4,0x10,0x10,0x1f,0xf0,0x01,0x00,0x3f,0xf8,0x21,0x08,0x21,0x08,0x21,0x28,0x21,0x10,0x01,0x00,0x01,0x00}},
- {0x6458,0xe69198,0xD5AA,{0x20,0x80,0x20,0x40,0x27,0xfc,0x21,0x10,0xf8,0xa0,0x27,0xfc,0x24,0x44,0x2d,0xf4,0x34,0x44,0xe5,0xf4,0x25,0x14,0x25,0x14,0x25,0xf4,0x24,0x04,0xa4,0x14,0x44,0x08}},
- {0x4e0b,0xe4b88b,0xCFC2,{0x00,0x00,0xff,0xfe,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x40,0x02,0x20,0x02,0x10,0x02,0x08,0x02,0x08,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00}},
- {0x53e3,0xe58fa3,0xBFDA,{0x00,0x00,0x00,0x00,0x3f,0xf8,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x20,0x08,0x3f,0xf8,0x20,0x08,0x00,0x00}},
- {0x7f69,0xe7bda9,0xD5D6,{0x00,0x00,0x7f,0xfc,0x44,0x44,0x7f,0xfc,0x01,0x00,0x01,0xfc,0x01,0x00,0x3f,0xf8,0x20,0x08,0x3f,0xf8,0x20,0x08,0x3f,0xf8,0x01,0x00,0xff,0xfe,0x01,0x00,0x01,0x00}},
- {0x8054,0xe88194,0xC1AA,{0x00,0x88,0xfc,0x48,0x48,0x50,0x48,0x00,0x79,0xfc,0x48,0x20,0x48,0x20,0x78,0x20,0x4b,0xfe,0x48,0x20,0x4c,0x50,0x78,0x50,0xc8,0x88,0x08,0x88,0x09,0x04,0x0a,0x02}},
- {0x7cfb,0xe7b3bb,0xCFB5,{0x00,0xf8,0x3f,0x00,0x04,0x00,0x08,0x20,0x10,0x40,0x3f,0x80,0x01,0x00,0x06,0x10,0x18,0x08,0x7f,0xfc,0x01,0x04,0x09,0x20,0x11,0x10,0x21,0x08,0x45,0x04,0x02,0x00}},
- {0x533b,0xe58cbb,0xD2BD,{0x00,0x00,0x7f,0xfc,0x44,0x00,0x44,0x00,0x4f,0xf8,0x50,0x80,0x40,0x80,0x5f,0xfc,0x40,0x80,0x41,0x40,0x42,0x20,0x44,0x10,0x58,0x08,0x40,0x00,0x7f,0xfe,0x00,0x00}},
- {0x62a4,0xe68aa4,0xBBA4,{0x10,0x40,0x10,0x20,0x10,0x20,0x11,0xfe,0xfd,0x02,0x11,0x02,0x11,0x02,0x15,0xfe,0x19,0x02,0x31,0x00,0xd1,0x00,0x11,0x00,0x12,0x00,0x12,0x00,0x54,0x00,0x28,0x00}},
- {0x4eba,0xe4baba,0xC8CB,{0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x02,0x80,0x02,0x80,0x04,0x40,0x04,0x40,0x08,0x20,0x08,0x20,0x10,0x10,0x20,0x08,0x40,0x04,0x80,0x02}},
- {0x5458,0xe59198,0xD4B1,{0x00,0x00,0x1f,0xf0,0x10,0x10,0x10,0x10,0x1f,0xf0,0x00,0x00,0x3f,0xf8,0x20,0x08,0x20,0x08,0x21,0x08,0x21,0x08,0x21,0x08,0x02,0xc0,0x04,0x30,0x18,0x08,0xe0,0x04}},
- {0x6709,0xe69c89,0xD3D0,{0x02,0x00,0x02,0x00,0xff,0xfe,0x04,0x00,0x04,0x00,0x0f,0xf0,0x08,0x10,0x18,0x10,0x2f,0xf0,0x48,0x10,0x88,0x10,0x0f,0xf0,0x08,0x10,0x08,0x10,0x08,0x50,0x08,0x20}},
- {0x5728,0xe59ca8,0xD4DA,{0x02,0x00,0x02,0x00,0x04,0x00,0xff,0xfe,0x08,0x00,0x08,0x40,0x10,0x40,0x30,0x40,0x57,0xfc,0x90,0x40,0x10,0x40,0x10,0x40,0x10,0x40,0x10,0x40,0x1f,0xfe,0x10,0x00}},
- {0x7c73,0xe7b1b3,0xC3D7,{0x01,0x00,0x21,0x08,0x11,0x08,0x09,0x10,0x09,0x20,0x01,0x00,0x7f,0xfc,0x03,0x80,0x05,0x40,0x05,0x40,0x09,0x20,0x11,0x10,0x21,0x08,0xc1,0x06,0x01,0x00,0x01,0x00}},
- {0x5916,0xe5a496,0xCDE2,{0x10,0x40,0x10,0x40,0x10,0x40,0x10,0x40,0x3e,0x40,0x22,0x60,0x42,0x50,0x42,0x48,0xa4,0x44,0x14,0x44,0x08,0x40,0x08,0x40,0x10,0x40,0x20,0x40,0x40,0x40,0x80,0x40}},
- {0x7b49,0xe7ad89,0xB5C8,{0x20,0x40,0x3f,0x7e,0x48,0x90,0x85,0x08,0x01,0x00,0x3f,0xf8,0x01,0x00,0x01,0x00,0xff,0xfe,0x00,0x00,0x00,0x20,0x7f,0xfc,0x08,0x20,0x04,0x20,0x04,0xa0,0x00,0x40}},
- {0x5f85,0xe5be85,0xB4FD,{0x08,0x40,0x08,0x40,0x10,0x40,0x23,0xfc,0x48,0x40,0x08,0x40,0x17,0xfe,0x30,0x10,0x50,0x10,0x97,0xfe,0x10,0x10,0x12,0x10,0x11,0x10,0x11,0x10,0x10,0x50,0x10,0x20}}
- };
- // 创建对象
- DFRobot_SSD1306_I2C oled12864;
- DFRobot_Ultrasonic ultraA1;
- DFRobot_MLX90614 mlx90614;
-
-
- // 主程序开始
- void setup() {
- ultraA1.begin(A1);
- oled12864.setChCode(chBuf);
- oled12864.begin(0x3c);
- }
- void loop() {
- mind_n_distance = ultraA1.getDistanceCm();
- mind_n_temperature = mlx90614.getObjectTempC();
- mind_n_H = digitalRead(4);
- if ((mind_n_H==0)) {
- oled12864.setCursor(32, 1);
- oled12864.print("请向前走");
- oled12864.setCursor(32, 3);
- oled12864.print("检测体温");
- digitalWrite(9, HIGH);
- delay(3000);
- digitalWrite(9, LOW);
- oled12864.fillScreen(0);
- if ((mind_n_temperature<36.5)) {
- oled12864.setCursor(32, 1);
- oled12864.print("体温正常");
- oled12864.setCursor(28, 3);
- oled12864.print("请摘下口罩");
- delay(2000);
- oled12864.fillScreen(0);
- }
- else {
- oled12864.setCursor(42, 1);
- oled12864.print("请联系医护人员");
- oled12864.fillScreen(0);
- }
- }
- else if ((mind_n_H==1)) {
- oled12864.setCursor(26, 1);
- oled12864.print("有人在检测 ");
- oled12864.setCursor(24, 3);
- oled12864.print("请1米外等待");
- digitalWrite(7, HIGH);
- delay(2000);
- digitalWrite(7, LOW);
- if ((mind_n_distance<100)) {
- digitalWrite(10, HIGH);
- delay(3000);
- }
- else {
- digitalWrite(10, LOW);
- }
- oled12864.fillScreen(0);
- }
- }
复制代码
附件:
AI核酸采集医护助手.zip
|