回到首页 返回首页
回到顶部 回到顶部
返回上一页 返回上一页

【教哈有方】非接触式智能识别测温仪 简单

头像 jhy365 2020.03.22 1377 2

2020年春天,中国经历了一场大灾难,新型冠状病毒肆虐。全国人民众志成城抗击疫情,现在已取得了阶段性的胜利。虽然现在已是春暖花开,回归校园的日子指日可待,但是我们不能掉以轻心,要做好防控。我设计制作了这个“非接触式智能识别测温仪”原型,希望他能保护我的老师、我的同学,期待早日重返校园。

project-image
project-image

1、项目问题:通过二哈识别学生、红外测温测量温度,识别后显示学号及体温,并进行语音播报,并上传至物联网对数据进行收集整理。

2.解决方案:通过二哈的人脸识别区分学生,红外测温,语音播报,上传物联网。

3.项目重点:二哈端设置、红外测温及物联网的上传。

4.项目难点:程序编写。

材料清单

  • Gravity: 二哈识图(HuskyLens)AI 视觉传感器 X1 链接
  • 非接触式红外温度传感器 X1 链接
  • 掌控板2.0编程入门学习主控板 X1 链接
  • micro:bit掌控I/O扩展板 X1 链接
  • Gravity: UART MP3语音模块 X1 链接
  • 无源音箱小喇叭 (8Ω3W) X1 链接

步骤1 原型设计

project-image
project-image
project-image

步骤2 结构设计

project-image

步骤3 代码调试

project-image
project-image
project-image

步骤4 部件组装

project-image
project-image
project-image

步骤5 功能调试

project-image
project-image
project-image
project-image
代码
/*!
 * MindPlus
 * mpython
 *
 */
#include <MPython.h>
#include <DFRobot_Iot.h>
#include <DFRobot_MLX90614.h>
#include <DFRobot_SerialMp3.h>
#include <DFRobot_HuskyLens.h>
// 静态常量
const String topics[5] = {"wnfwV9BZR","stpWwvuWg","YuCVQDuZg","",""};
// 创建对象
DFRobot_SerialMp3 serialMp3;
DFRobot_HuskyLens huskylens;
DFRobot_Iot       myIot;
DFRobot_MLX90614  mlx90614;


// 主程序开始
void setup() {
	mPython.begin();
	buzz.play(NYAN, Once);
	display.setCursor(25, 22);
	display.print("众志成城  抗击疫情");
	delay(2000);
	serialMp3.begin(&Serial1, P0, P1);
	// 哈士奇初始化
	huskylens.beginI2CUntilSuccess();
	huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION);
	// WIFI连接
	myIot.wifiConnect("@PHICOMM5003", "588100niko");
	while (!myIot.wifiStatus()) {yield();}
	display.setCursorLine(1);
	display.printLine("wifi已连接");
	delay(2000);
	display.fillScreen(0);
	myIot.init("iot.dfrobot.com.cn","INAQV9fWR","","SH0wV9fZRz",topics,1883);
	// MQTT
	myIot.connect();
	while (!myIot.connected()) {yield();}
	display.setCursorLine(1);
	display.printLine("MQTT已连接");
	delay(2000);
	display.fillScreen(0);
	delay(1000);
	serialMp3.playList(4);
	delay(1000);
}
void loop() {
	huskylens.request();
	if (huskylens.isLearned(1)) {
		if (huskylens.isAppear(1,HUSKYLENSResultBlock)) {
			display.setCursorLine(2);
			display.printLine((String((String("ID 1:") + String(mlx90614.getObjectTempC()))) + String("℃")));
			delay(1000);
			myIot.publish(topic_0, (String(mlx90614.getObjectTempC()) + String("℃")));
			delay(5000);
			if ((mlx90614.getObjectTempC()>37.3)) {
				serialMp3.playList(1);
			}
			else {
				serialMp3.playList(5);
			}
			display.fillScreen(0);
		}
	}
	if (huskylens.isLearned(2)) {
		if (huskylens.isAppear(2,HUSKYLENSResultBlock)) {
			display.setCursorLine(2);
			display.printLine((String((String("ID 2:") + String(mlx90614.getObjectTempC()))) + String("℃")));
			delay(1000);
			myIot.publish(topic_1, (String(mlx90614.getObjectTempC()) + String("℃")));
			delay(5000);
			if ((mlx90614.getObjectTempC()>37.3)) {
				serialMp3.playList(2);
			}
			else {
				serialMp3.playList(5);
			}
			display.fillScreen(0);
		}
	}
	if (huskylens.isLearned(3)) {
		if (huskylens.isAppear(3,HUSKYLENSResultBlock)) {
			display.setCursorLine(2);
			display.printLine((String((String("ID 3:") + String(mlx90614.getObjectTempC()))) + String("℃")));
			delay(1000);
			myIot.publish(topic_2, (String(mlx90614.getObjectTempC()) + String("℃")));
			delay(5000);
			if ((mlx90614.getObjectTempC()>37.3)) {
				serialMp3.playList(3);
			}
			else {
				serialMp3.playList(5);
			}
			display.fillScreen(0);
		}
	}
}

评论

user-avatar
  • DFBJMFvtzEI

    DFBJMFvtzEI2020.04.01

    可以加一个好友,探讨一下吗?

    0
    • gray6666

      gray66662020.03.29

      可以升级设计个切割板的。

      0