:::: MENU ::::
Posts tagged with: pi pico w

GY-906 / MLX90614 on Pi Pico

This’ll be a placeholder for the other lost souls I found trying to hook-up an infrared thermometer module to the Raspberry Pi Pico (W) using MicroPython.

You need SoftI2C instead of the hardware I2C – and stuff will just work, the issue relates to clock stretching, here be a snippet to get you back on the path (that doesn’t require you to go into a frenzy of replacing resistors, adding new ones, breaking out the oscilloscope and so on).

I’ll write more about what I’m doing…eventually.


i2c = SoftI2C(sda=Pin(0), scl=Pin(1), timeout=100_000, freq=100000)
t = i2c.readfrom_mem(0x5a,0x07,15)
u = ustruct.unpack('<H',t)[0]
tC=str((u*0.02)-273.15)
temperature = float(tC)