Thermopile Shield¶
De Thermopile Shield geeft de OpenMV Cam een 16x4 thermische-sensorarray via I2C voor thermische beeldvorming met lage resolutie en temperatuurmeting per pixel.
Voor de volledige datasheet, foto’s en bestelinformatie, zie de productpagina van de Thermopile Shield.
Hoogtepunten¶
16x4 thermische-sensorarray, gezichtsveld van 60 graden x 16 graden
Objecttemperaturen van -50 C tot 300 C
Pinout¶
Pinreferentie¶
Pin |
Functie |
|---|---|
P4 |
I²C SCL — klok naar de thermopile-array |
P5 |
I²C SDA — data naar de thermopile-array |
3.3V-rail |
Voedt de thermopile |
GND-rail |
Gemeenschappelijke massa |
Gebruik¶
Leg een warmtebeeld vast vanaf de thermopile-array aan boord via de fir-module:
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())
Lees de ruwe temperaturen per pixel als een 16×4 ndarray van celsius-floats. fir.read_ir() retourneert ook de omgevingstemperatuur en de waargenomen min/max in het frame:
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)