当前位置:网站首页>基于Arduino制作非接触式测温仪
基于Arduino制作非接触式测温仪
2022-08-01 04:03:00 【优信电子】
基于Arduino制作非接触式测温仪
MLX90614 红外测温模块
MLX90614 简介
MLX90614是一款由迈来芯公司提供的低成本,无接触温度计。输出数据和物体温度呈线性比例,具有高精度和高分辨率。TO-39金属封装里同时集成了红外感应热电堆探测器芯片MLX81101(温度是通过PTC或是PTAT元件测量)和信号处理专用集成芯片MLX90302,专门用于处理红外传感器输出信号。用以阻碍可见光和近红外光辐射的光学滤波器(可传播长波)集成在封装内提供对环境和日光的免疫。滤波器的波长通带为5.5到14μm。由于集成了低噪声放大器、17位模数转换器和强大的数字信号处理芯片 MLX90302,使得高精度和高分辨度的温度计得以实现。一个附加的片上温度传感器用来测量芯片的温度。测量完两个传感器的输出后,对应的环境温度和物体温度被计算出。计算所得物体温度和环境温度存储在MLX90302的RAM单元,温度分辨率为0.01℃,并可通过两线 SMBus(系统管理总线)兼容协议接口(IIC与之兼容)(0.02℃分辨率)或是10位PWM(脉宽调制)输出模式输出。MLX90614出厂温度范围都进行过校准,传感器测量的温度为视场里所有物体温度的平均值。
MLX90614 参数
探头直径8.2mm
数字接口类型:IIC(从模式)
温度测量范围:-70℃~382.2℃
温度测量误差:±0.5℃ (室温下)分辨率0.02℃
工作电压:3.3V~5V
使用环境温度-40~125℃
项目介绍
本项目将以Arduino作为主控,按键触发,搭配MLX90614红外测温传感器制作一个非接触式,测温距离在1CM左右的人体手腕测温仪,测量到的温度用OLED显示屏打印出来 。

项目搭建
接线
Arduino | MLX90614 | OLED | 按键 |
---|---|---|---|
A4 | SDA | ||
A5 | SCL | ||
5V | VIN | VCC | |
GND | GND | GND | OUT |
D3 | IN | ||
D8 | RES | ||
D9 | DC | ||
D10 | CS | ||
D11 | D1 | ||
D12 | D2 |
开发
为了方便开发本项目会用到MLX90614库和U8g2库
#include <U8g2lib.h>
#include <Adafruit_MLX90614.h>
项目上电后初始化完成后,在串口和OLED屏幕上打印项目名称"Contactless Temperature Measurement",由于屏幕宽度有限,使用OLED显示器分行打印
Serial.println("Contactless Temperature Measurement"); //串口打印项目名称
u8g2.enableUTF8Print(); // enable UTF8 support for the Arduino print() function
u8g2.setFont(u8g2_font_ncenB14_tr); //字体选择
u8g2.setFontDirection(0); //绘制/显示方向
u8g2.clear(); //清空显示和缓冲
u8g2.setCursor(7, 15); //移动光标位置
u8g2.print("Contactless"); //OLED打印内容
u8g2.setCursor(0, 35);
u8g2.print("Temperature");
u8g2.setCursor(0, 55);
u8g2.print("Measurement");
u8g2.sendBuffer();
通过按下按键改变D3引脚电平状态触发测温
int Start()
{
int B=1;
B=digitalRead(Bottom);
delay(30);
return B;
}
获取温度—为了提高温度的可靠性 读取了5次温度存放在一个数组里,数组里的输出通过可靠性判断和处理后就可以打印输出了
void gTemp()
{
for (int i = 0; i < 5; i++)
{
t[i] = mlx.readObjectTempC();
Serial.println(t[i]);
delay(300);
}
}
主程序
void loop(void) {
while(!Start()) //测温循环
{
u8g2.clear();
Serial.println("start"); //串口打印开始信息
delay(1000);
gTemp(); //测温 读取5次温度值 保存再t数组里面
if(dTemp()>0) // 判断数据有效性
{
u8g2.clear(); //清屏
u8g2.setCursor(3, 20);
u8g2.print("temperature");
u8g2.setCursor(40, 50);
u8g2.print(prantTemp()); //打印温度值
Serial.println(prantTemp()); -
u8g2.sendBuffer();
}
else
{
Serial.println("read fail"); //串口打印测温错误信息//五次温度处理后判断为无效数据
u8g2.clear(); //清屏
u8g2.setCursor(23 ,17); //OLED打印位置
u8g2.print("read fail"); //OLED打印读取失败信息 OLED打印测温错误信息//五次温度处理后判断为无效数据
u8g2.setCursor(19, 37); //OLED打印位置
u8g2.print("please try"); //OLED打印读取失败信息
u8g2.setCursor(35, 55); //OLED打印位置
u8g2.print("again"); //OLED打印读取失败信息
u8g2.sendBuffer();
}
delay(5000);
u8g2.clear(); //清屏
break;
}
}
项目验证展示
- 点击开始测温后被测温目标再进入测温区域,判断为测温失败
测温失败演示
- 正确测温演示
Arduino - MLX90614非接触式测温
测得温度为36.25摄氏度
边栏推荐
- EntityFramework saves to SQLServer decimal precision is lost
- What is a programming language
- [FPGA tutorial case 43] Image case 3 - image sobel edge extraction through verilog, auxiliary verification through MATLAB
- Message queue design based on mysql
- Unknown Bounded Array
- Error using ts-node
- 故乡的素描画
- win10 固定本机IP
- August 22 Promotion Ambassador Extra Reward Rules
- 一个service层需要调用另两个service层获取数据,并组装成最后的数据,数据都是list,缓存如何设计?
猜你喜欢
Simulation of Active anti-islanding-AFD Active Anti-islanding Model Based on Simulink
The fledgling Xiao Li's 114th blog project notes: Wisdom cloud intelligent flower watering device combat (3) - basic Demo implementation
情人节浪漫3D照片墙【附源码】
【kali-信息收集】枚举——DNS枚举:DNSenum、fierce
Message queue design based on mysql
【入门教程】Rollup模块打包器整合
The 16th day of the special assault version of the sword offer
Which interpolation is better for opencv to zoom in and out??
Message queue MySQL table for storing message data
使用ts-node报错
随机推荐
黑客到底可以厉害到什么程度?
<JDBC> 批量插入 的四种实现方式:你真的get到了吗?
【堆】小红的数组
button remove black frame
MySQL modifies SQL statements to optimize performance
MLP neural network, GRNN neural network, SVM neural network and deep learning neural network compare and identify human health and non-health data
MySQL3
HCIP(15)
A way to deal with infinite debugger
项目越写越大,我是这样做拆分的
Software Testing Weekly (Issue 82): In fact, all those who are entangled in making choices already have the answer in their hearts, and consultation is just to get the choice that they prefer.
Dart 命名参数语法
MySQL4
Mysql基础篇(Mysql数据类型)
leetcode6133. 分组的最大数量(中等)
How to download the Keil package
数据比对功能调研总结
Flutter “Hello world“ 程代码
Dynamic Programming 01 Backpack
What is dynamic programming and what is the knapsack problem