Thermopile Shield¶
Thermopile Shieldは、OpenMV CamにI2C経由で16x4のサーマルセンサーアレイを提供し、低解像度のサーマルイメージングとピクセルごとの温度測定を可能にします。
完全なデータシート、写真、注文については Thermopile Shield製品ページ を参照してください。
ハイライト¶
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)