热电堆扩展板¶
热电堆扩展板为 OpenMV Cam 提供一个通过 I2C 连接的 16x4 热传感器阵列,用于低分辨率热成像和逐像素温度测量。
完整数据手册、照片以及订购信息请参见 热电堆扩展板产品页面。
亮点¶
16x4 热传感器阵列,60 度 x 16 度视场
物体温度范围从 -50 C 到 300 C
引脚分布¶
引脚参考¶
引脚 |
功能 |
|---|---|
P4 |
I²C SCL——通往热电堆阵列的时钟 |
P5 |
I²C SDA——通往热电堆阵列的数据 |
3.3V 电源轨 |
为热电堆供电 |
GND 电源轨 |
公共接地 |
用法¶
通过 fir 模块从板载热电堆阵列捕获热图:
import fir
import image
import time
fir.init()
clock = time.clock()
while True:
clock.tick()
try:
img = fir.snapshot(x_scale=10, y_scale=10,
color_palette=image.PALETTE_IRONBOW,
hint=image.BICUBIC,
copy_to_fb=True)
except OSError:
continue
print(clock.fps())
以 16×4 的摄氏度浮点 ndarray 形式读取逐像素原始温度。fir.read_ir() 还会返回环境温度以及该帧中观察到的最小/最大值:
import fir
import time
from ulab import numpy as np
fir.init()
w = fir.width()
h = fir.height()
while True:
try:
ta, ir, to_min, to_max = fir.read_ir()
except OSError:
continue
grid = np.array(ir).reshape((h, w))
print("Ambient: %.1f C, range: %.1f to %.1f C, mean: %.1f C"
% (ta, to_min, to_max, np.mean(grid)))
time.sleep(1)