Using the Unit Thermal2 ・ 使用 Unit Thermal2
M5StackのUnit Thermal2をコントローラーに接続する最小構成。配線とBOMつき。
この構成をエディタで開く・編集する →| 部品 | 役割 | ポート | リンク・価格 |
|---|---|---|---|
| M5Stack CoreS3 | Controller | grove_i2c, grove_analog, grove_uart, mbus, usb_c, sdcard | official page — $59.9 |
| Unit Thermal2 | unit | grove_i2c | official page — $69.9 |
M5Stack CoreS3とUnit Thermal2で作る、非接触温度測定装置です。Unit Thermal2が赤外線アレイセンサーで物体の表面温度を計測し、CoreS3の画面に表示します。配線はGrove I2Cケーブル1本で完了する、かんたんな構成です。
# M5Stack CoreS3 + Unit Thermal2 (MLX90640)
# Wiring: Unit Thermal2 -> CoreS3 red Port.A (I2C)
import time
from machine import Pin, I2C
from m5stack import lcd
# Initialize I2C on Port.A (CoreS3: sda=2, scl=1)
i2c = I2C(0, scl=Pin(1), sda=Pin(2), freq=400000)
# MLX90640 I2C address is 0x33
MLX90640_ADDR = 0x33
# Check if sensor is present
if MLX90640_ADDR not in i2c.scan():
lcd.clear()
lcd.print('Thermal2 not found!', 10, 20)
raise SystemExit('Sensor not found')
# Simple read: get raw temperature data (requires library for full functionality)
# For demonstration, we read a few registers and show a placeholder
lcd.clear()
lcd.print('Thermal2 detected', 10, 20)
while True:
# Read 2 bytes from register 0x00 (dummy read)
data = i2c.readfrom_mem(MLX90640_ADDR, 0x00, 2)
# Display raw value (not actual temperature)
raw = data[0] << 8 | data[1]
lcd.clear()
lcd.print('Raw: %d' % raw, 10, 20)
lcd.print('Use MLX90640 lib', 10, 50)
time.sleep(2)
この作り方はAIが構成から生成したものです(未検証)。通電前に配線とコードをご確認ください。
この構成はAIが実在するM5Stack部品から設計し、ポート互換をサーバで検証したものです。編集・共有できます。
エディタで開く →UnitKit は M5Stack® 製品向けの非公式ツール。作りたいものを書くと、部品リストと配線図が出ます。