DFROBOT Mind+ 掌控板 人工智能测温实验

DFROBOT Mind+ 掌控板实验

人工智能测温实验

特别声明:本文系湛江市第十七中学星火创客团队及岭南师范学院物联网俱乐部原创部分参赛项目,转载请保留声明

一、实验软硬件环境

硬件:Mind +掌控板、DS18B20温度传感器(由于没有测温人体的,只好用它来代替一下)、micro:bit、HuskyLens。
软件:Mind+ IDE(版本:V1.6.5 RC3.0)

二、实验目的及要求

1、实现测温
2、实现人脸识别
3、实现云数据库应用
4、实现测温数据mqtt上传至物联网云平台

三、实验原理与内容

1、基于DS18B20或LM35实现测温
2、基于二哈实现多人人脸学习和识别
3、基于TinywebDB实现云数据库应用
4、基于EasyIoT实现mqtt数据上传。

四、实验过程

1、HuskyLens的人脸识别教程链接:https://wiki.dfrobot.com.cn/SKU_SEN0305_Gravity__HUSKYLENS%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%E6%91%84%E5%83%8F%E5%A4%B4#target_32

2、图形化编程截图:
在这里插入图片描述

3、arduino代码:

/*!
 * 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, mind_s_XingMing2, mind_s_WenDu;
// 函数声明
void DF_ID1();
void DF_ID2();
// 静态常量
const String topics[5] = {"vZS4cspGg","","","",""};
// 创建对象
DFRobot_Iot       myIot;
mPython_TinyWebDB mydb;
DFRobot_HuskyLens huskylens;
DFRobot_DS18B20   ds18b20_P8;


// 主程序开始
void setup() {
	mPython.begin();
	ds18b20_P8.begin(P8);
	myIot.wifiConnect("602iot", "18wulian");
	while (!myIot.wifiStatus()) {yield();}
	display.setCursorLine(1);
	display.printLine("连接成功");
	myIot.init("iot.dfrobot.com.cn","afK75ypMg","","-fFn5spGRz",topics,1883);
	myIot.connect();
	while (!myIot.connected()) {yield();}
	display.setCursorLine(2);
	display.printLine("mqtt连接成功");
	mydb.setServerParameter("http://tinywebdb.appinventor.space/api", "share","everyone");
	display.setCursorLine(3);
	display.printLine(mydb.testInternetConnect());
	huskylens.beginI2CUntilSuccess();
	huskylens.writeAlgorithm(ALGORITHM_FACE_RECOGNITION);
	display.setCursorLine(4);
	display.printLine("二哈初始化成功");
	delay(1500);
	display.fillScreen(0);
}
void loop() {
	mind_s_XingMing = "2018A14135李土培";
	mind_s_XingMing2 = "2018A14145王烁斌";
	mind_s_WenDu = ds18b20_P8.getTempC();
	huskylens.request();
	if (huskylens.isAppearDirect(HUSKYLENSResultBlock)) {
		DF_ID1();
		DF_ID2();
	}
}


// 自定义函数
void DF_ID1() {
	if (huskylens.isAppear(1,HUSKYLENSResultBlock)) {
		mydb.updateTagValue(mind_s_XingMing2, mind_s_WenDu);
		myIot.publish(topic_0, (String(mind_s_XingMing) + String(mind_s_WenDu)));
		display.setCursorLine(1);
		display.printLine("开始测温");
		display.setCursorLine(2);
		display.printLine((String(mind_s_XingMing2) + String(mind_s_WenDu)));
		delay(1500);
		display.fillScreen(0);
	}
}
void DF_ID2() {
	if (huskylens.isAppear(2,HUSKYLENSResultBlock)) {
		mydb.updateTagValue(mind_s_XingMing, mind_s_WenDu);
		myIot.publish(topic_0, (String(mind_s_XingMing2) + String(mind_s_WenDu)));
		display.setCursorLine(1);
		display.printLine("开始测温");
		display.setCursorLine(2);
		display.printLine((String(mind_s_XingMing) + String(mind_s_WenDu)));
		delay(1500);
		display.fillScreen(0);
	}
}

五、实验效果

1、掌控板显示:
在这里插入图片描述

2、数据库数据更新
在这里插入图片描述
3、上传到easyIoT
在这里插入图片描述

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

X 、case

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值