人工智能测温实验

人工智能测温实验

1、实验目的及要求
【一】实现测温
【二】实现人脸识别
【三】实现云数据库应用
【四】实现测温数据mqtt上传至物联网云平台



python

2、实验原理与内容
基于DS18B20或LM35实现测温
基于二哈实现多人人脸学习和识别
基于TinywebDB实现云数据库应用
基于EasyIoT实现mqtt数据上传。



web

3、实验软硬件环境
硬件:掌控板
软件:Mind+

数据库

4、实验过程
1. 基于DS18B20或LM35实现测温
2.基于二哈实现多人人脸学习和识别
在这里插入图片描述


api

3.基于TinywebDB实现云数据库应用
在这里插入图片描述
app

4.基于EasyIoT实现mqtt数据上传
在这里插入图片描述
在这里插入图片描述

oop

/*! * MindPlus * mpython * */
#include <MPython.h>
#include <DFRobot_Iot.h>
#include <DFRobot_DS18B20.h>
#include <mPython_tinywebdb.h>
#include <DFRobot_HuskyLens.h>

// 动态变量
String mind_s_XingMing;
// 静态常量
const String topics[5] = { "Kn8-BPpGg","","","",""};
// 建立对象
DFRobot_Iot       myIot;
mPython_TinyWebDB mydb;
DFRobot_HuskyLens huskylens;
DFRobot_DS18B20   ds18b20_P8;


// 主程序开始
void setup() { 
	mPython.begin();
	ds18b20_P8.begin(P8);
	myIot.wifiConnect("666", "88888888");
	while (!myIot.wifiStatus()) { yield();}
	display.setCursorLine(1);
	display.printLine("WIFI链接成功");
	myIot.init("iot.dfrobot.com.cn","VtyDB-jZg","","4psDf-jZgz",topics,1883);
	myIot.connect();
	while (!myIot.connected()) { yield();}
	display.setCursorLine(1);
	display.printLine("MQTT链接成功");
	mydb.setServerParameter("http://tinywebdb.appinventor.space/api", "iot666","4ea89cc3");
	huskylens.beginI2CUntilSuccess();
	huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION);
	huskylens.writeName(String("2018A14123"), 1);
	huskylens.writeName(String("2018A14118"), 2);
	huskylens.writeName(String("2018A14142"), 3);
}
void loop() { 
	huskylens.request();
	if (huskylens.isAppearDirect(HUSKYLENSResultBlock)) { 
		if (huskylens.isLearned(huskylens.readBlockCenterParameterDirect().ID)) { 
			display.setCursorLine(1);
			display.printLine("请保持面向摄像头");
			display.setCursorLine(2);
			display.printLine((String("当前室温为") + String(ds18b20_P8.getTempC())));
			mind_s_XingMing = mydb.getTag((String(huskylens.readBlockCenterParameterDirect().ID)));
			display.setCursorLine(3);
			display.printLine(mind_s_XingMing);
			myIot.publish(topic_0, mind_s_XingMing);
			delay(1000);
		}
	}
	display.setCursorLine(3);
	display.printLine("未录入该人脸");
	delay(1000);
}

5、实验结果
在这里插入图片描述
在这里插入图片描述

学习

相关文章
相关标签/搜索