×

带显示屏的非接触式温度传感器

消耗积分:0 | 格式:zip | 大小:0.02 MB | 2023-02-06

陈文博

分享资料个

描述

我过去做过一个使用非接触式温度传感器的项目,在本教程中为了降低整体显示成本,我将传感器与 4 位 7 段显示器连接。测量温度的基本思想保持不变。请确保阅读“使用 Arduino 和 mlx90614 的非接触式温度传感器”以简要介绍所使用的校准组件。本项目由PCBWAY.com赞助

 

TM1637 显示器和控制器:

这个4位数字显示是由泰坦微电子开发的名为TM1637的集成电路控制的。这里我有一些直接来自数据表的信息-TM1637是一种带键盘扫描接口的LED(发光二极管显示器)驱动控制专用电路,它内部集成了MCU数字接口、数据锁存器、LED高压驱动和键盘扫描。本产品为DIP20/SOP20封装类型,性能优良,品质优良,主要适用于电磁炉、微波炉、小家电的显示驱动。从数据表中获取更多信息,包括电路图和不同的编程模式。

mini_20220815_185557_Q6Oe5xCAHM.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 

功能特点:

键盘扫描(8×2bit),带增强识别电路

亮度调节电路(可调8占空比)

两线串行接口(CLK、DIO)

振荡类型:内置RC振荡器

MLX90614:

MLX90614 温度传感器无需接触即可测量特定物体或表面的温度该传感器用于测量它所指向的物体发射的红外光量,它使用斯特凡-玻尔兹曼定律的原理,该定律指出包括生物在内的所有物体都会根据物体的温度或存在。因此,通过测量发出的红外线能量,我们可以计算出物体的温度。

mini_20220815_185543_KzqtLGmLd5.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 

特征:

· 工作电压:3.6V 至 5V

·工作电流:1.5mA

· 温度范围:-70°C 至 382.2°C

所需组件:

mini_20220815_185756_Dc1G3P8oO0.jpg?auto=compress%2Cformat&w=740&h=555&fit=max
 

1)阿杜诺纳米

2) 4位7段显示

3) MLX90614 非接触式红外传感器

4) 连接线

5)定制PCB(PCBWAY

6) 9v电池

电路图:

ice_screenshot_20220818-144638_2hv2nWbv81.png?auto=compress%2Cformat&w=740&h=555&fit=max
 

传感器和 LCD 都在 2 线接口上工作,传感器使用连接到 Arduino 的 A4 和 A5 引脚的 I2C 通信。对于 LCD 时钟和数据,分别定义了数字引脚 D2 和 D3。7.4V 电池足以为整个装置供电。我正在使用串联组合的 18650 锂离子电池。LCD 和温度传感器都在 3.3 伏电压下工作,这可以从 Arduino 的线性稳压器获得。

PCB屏蔽层:

我根据连接图设计了这个屏蔽。只需将 Arduino、显示器和传感器插到它们的位置,我们就可以在为系统供电后开始工作了。

untitled_8BdkuGDO7X.png?auto=compress%2Cformat&w=740&h=555&fit=max
 

18650电池座可以直接安装在pcb上。

电路板更新:

您可能知道,我一直在我的项目中使用PCBWAY Prototypes ,现在直接为 PCB 制造下订单变得更加容易。现在 Gerber 文件可以直接从 KICAD 上传到 PCBWAY,只需单击一下即可获取有关该插件的更多信息并安装它,请阅读本文

当您在 Kicad 上点击PCBWay Plug-in 按钮时,我们将在您的项目中导出这些文件:

 

1.生产格式正确的Gerber文件

2.IPC-网表文件

3.Bom文件,包含所有组件信息

4.Pick and Place-file用于组装

您可以在上传文件后点击“保存到购物车”立即下单(通常只需要几秒钟),我们的工程师会在生产前仔细检查文件。

代码:

#include 
#include 
#include 
#define CLK 2
#define DIO 3
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
TM1637Display display = TM1637Display(CLK, DIO);
const uint8_t celcius[] = 
{                                 
  SEG_A | SEG_E | SEG_F | SEG_D
};
#define f mlx.readObjectTempF()
#define c mlx.readObjectTempC()

void setup() {
  Serial.begin(9600);
  mlx.begin();
  display.clear();
  delay(1000);
}

void loop() {
  display.setBrightness(7);
  Serial.println("Temperature from MLX90614:");
  Serial.print("Ambient:      ");
  Serial.print(mlx.readAmbientTempF());
  Serial.println(" °F");
  Serial.print("Contactless: ");
  Serial.print(f);
  Serial.println(" °F");
  Serial.println();
  Serial.print("Ambient:      ");
  Serial.print(mlx.readAmbientTempC());
  Serial.println(" °C");
  Serial.print("Contactless: ");
  Serial.print(c);
  Serial.println(" °C");
  Serial.println();
  display.showNumberDec(c, false, 3, 0);
  display.setSegments(celcius, 1, 3);
  delay(1000);
}

使用的库:

我从 Arduino IDE 的管理库部分为 tm1637 尝试了许多库,但没有一个适合我。然后我终于从 GITHUB 得到了这个库 TM1637,从这里下载这个库并将文件夹复制到计算机中 Arduino Location 的 Library 文件夹中。

在职的:

 

与 Tm1637 驱动器配合使用效果很好,但需要反射器离子阳光。要么使用 5v 电源为 LCD 供电,这样它看起来会更亮。我用烙铁测试了最高温度。

 

I2C 接口优于热电堆电阻接口,精度高且易于使用内置库进行计算。

 


声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.lene-v.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'带显示屏的非接触式温度传感器',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.lene-v.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);