随着我国防疫政策的放宽,各地抗疫也掀起了一波新浪潮。
例如在神学方面,诸多平时不打赏,直播就白嫖的网友纷纷转发起郭襄、杨迪(阳敌)等名人的人名,祈祷自己一辈子没“阳过”。
以及但凡大灾大难,必然顶风作案的朋友圈,除却众口铄金的某某清瘟胶囊不谈,各类防疫物资也成了各个朋友圈疯转抢购的热销品。核酸检测长队难排,抗原试剂一剂难求,民声鼎沸,看得我们这些孤寡打工人瑟瑟发抖。
那么作为天选打工人,成功避过三年危险期,怎么封都封不住打工路的我们,如何在这最后时期维持自己仅存不多的尊严(工资)呢。
今天云恒制造就带大家一起动手DIY一款红外测温扫描仪,没事就biu biu测一测咱未老先衰的大脸,提前知晓并抵御新冠的危险!
【一、准备材料】
FireBeetle ESP32主板——1只
MLX90614非接触式红外测温传感器——1只
Gravity IIC OLED-2864 显示屏——1只
3.7V 400mAh锂电池——1只
6mm直径红光激光发射器——1只
C&K滑动开关——1只
3D打印外壳上盖和下盖——1套
【二、制作步骤】
▼1.如上图所示焊接好各个部件。
▼2.使用PCtoLCD2002液晶取模软件将需要用到的图片和16X24字体转换为16进制代码,按照上图模式来进行设置和取模。
▼3.使用uPyCraft MicroPython IDE 进行编程,烧写代码到FireBeetleESP32主板上,并测试程序是否可以工作。
代码内容:
import MLX90614
from machine import Pin,I2C
import time
import ssd1306
from piclib import *
# This code will show you how to make a Infra Red Thermometer using the MLX90614 sensor.
i2c = I2C(scl=Pin(22), sda=Pin(21), freq=100000)
ir=MLX90614.MLX90614(i2c)
lcd=ssd1306.SSD1306_I2C(128,64,i2c)
#Display a picture 72*64
def DisplayPicture(x,y,picture):
for line in range(0,64):
for bytes in range(0,9):
for bits in range(0,8):
if picture[9*line+bytes]&0x80>>bits:
lcd.pixel(x+bytes*8+bits,y+line,1)
else:
lcd.pixel(x+bytes*8+bits,y+line,0)
return
#Display a character 16*24
def DisplayCharacter16X24(x,y,character):
for line in range(0,24):
for bytes in range(0,2):
for bits in range(0,8):
if character[line*2+bytes]&0x80>>bits:
lcd.pixel(x+bytes*8+bits,y+line,1)
else:
lcd.pixel(x+bytes*8+bits,y+line,0)
return
#---------------------run here------------------------------------
#display logo
DisplayPicture(28,0,picture)
lcd.show()
time.sleep(1)
lcd.fill(0)
#display O:123.4C
# A:123.4C
DisplayCharacter16X24(0,0,charArray[10]) #O
DisplayCharacter16X24(16*1,0,charArray[12]) #:
DisplayCharacter16X24(16*7,0,charArray[13]) #C
DisplayCharacter16X24(0,24,charArray[11]) #A
DisplayCharacter16X24(16*1,24,charArray[12]) #:
DisplayCharacter16X24(16*7,24,charArray[13]) #C
lcd.show()
while True:
time.sleep(0.2)
Object = ir.getObjCelsius() # *C
Ambient = ir.getEnvCelsius() # *C
#Object = ir.getObjFahrenheit() # *F
#Ambient = ir.getEnvFahrenheit() # *F
#print("Object %s *C"% Object)
#print("Ambient %s *C"% Ambient)
#print()
ObjectInt = int(Object*10)
AmbientInt = int(Ambient*10)
if ObjectInt < 0:
ObjectInt = abs(ObjectInt)
DisplayCharacter16X24(16*2,0,charArray[15])# -
temp1 = (ObjectInt%1000)//100
if(temp1 == 0):
DisplayCharacter16X24(16*3,0,charArray[16]) # space
else:
DisplayCharacter16X24(16*3,0,charArray[temp1])
DisplayCharacter16X24(16*4,0,charArray[(ObjectInt%100)//10])
DisplayCharacter16X24(16*5,0,charArray[14]) # .
DisplayCharacter16X24(16*6,0,charArray[ObjectInt%10])
else:
temp1 = ObjectInt//1000
temp2 = (ObjectInt%1000)//100
if temp1 == 0:
DisplayCharacter16X24(16*2,0,charArray[16]) # space
else:
DisplayCharacter16X24(16*2,0,charArray[temp1])
if temp1 == 0 and temp2 == 0:
DisplayCharacter16X24(16*3,0,charArray[16]) # space
else:
DisplayCharacter16X24(16*3,0,charArray[temp2])
DisplayCharacter16X24(16*4,0,charArray[(ObjectInt%100)//10])
DisplayCharacter16X24(16*5,0,charArray[14]) # .
DisplayCharacter16X24(16*6,0,charArray[ObjectInt%10])
if AmbientInt < 0:
ObjectInt = abs(AmbientInt)
DisplayCharacter16X24(16*2,24,charArray[15])# -
temp1 = (AmbientInt%1000)//100
if temp1 == 0:
DisplayCharacter16X24(16*3,24,charArray[16]) # space
else:
DisplayCharacter16X24(16*3,24,charArray[temp1])
DisplayCharacter16X24(16*4,24,charArray[(AmbientInt%100)//10])
DisplayCharacter16X24(16*5,24,charArray[14]) # .
DisplayCharacter16X24(16*6,24,charArray[AmbientInt%10])
else:
temp1 = AmbientInt//1000
temp2 = (AmbientInt%1000)//100
if temp1 == 0:
DisplayCharacter16X24(16*2,24,charArray[16]) # space
else:
DisplayCharacter16X24(16*2,24,charArray[temp1])
if temp1 == 0 and temp2 == 0:
DisplayCharacter16X24(16*3,24,charArray[16]) # space
else:
DisplayCharacter16X24(16*3,24,charArray[temp2])
DisplayCharacter16X24(16*4,24,charArray[(AmbientInt%100)//10])
DisplayCharacter16X24(16*5,24,charArray[14]) # .
DisplayCharacter16X24(16*6,24,charArray[AmbientInt%10])
lcd.show()
▼4.根据部件尺寸设计外壳。
▼5.使用使用价值6999元的Overlord 3D打印机把测温枪的外壳打印出来。
▼6.使用热熔胶和胶水将部件安装到打印的外壳内。
大功告成!
可以去人多的场合嘚瑟了!