人工智能測溫實驗

人工智能測溫實驗

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、實驗結果
在這裏插入圖片描述
在這裏插入圖片描述

學習

相關文章
相關標籤/搜索