IntermediateSensors & Measurement
TMP117 Digital Thermometer with Pico
Read the TMP117 signed temperature register over I²C and print Celsius values to the USB serial console.
Parts from the database
- TMP117AIDRVR × 1Digital temperature sensor on breakout
- Raspberry-Pi-Pico × 1I²C host
Other supplies
- 3.3 V-compatible TMP117 breakoutCommon build supply
- I²C pull-ups if not fittedCommon build supply
- breadboardCommon build supply
- jumper wiresCommon build supply
- MicroPython installedCommon build supply
Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.
Connections
- Use a breakout for the small surface-mount sensor. VDD to Pico 3V3, GND to GND, SDA to GP0, SCL to GP1.
- Tie ADD0 low for address 0x48; verify breakout pull-ups go to 3.3 V.
- Place the sensor away from warm regulators and the Pico processor.
Build steps
- Run the code below; it reads the two-byte register at 0x00.
- Compare with a room thermometer after the board settles.
- Warm the sensor gently and confirm readings rise.
- Keep it away from heat sources for ambient measurements.
Software and firmware setup
from machine import I2C, Pin
from time import sleep
i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=100000)
address = 0x48
while True:
data = i2c.readfrom_mem(address, 0x00, 2)
raw = (data[0] << 8) | data[1]
if raw & 0x8000:
raw -= 0x10000
print('Temperature: {:.3f} C'.format(raw / 128.0))
sleep(1)Test your build
The terminal shows a stable Celsius value. TMP117 temperature counts are signed with 1/128 °C per count.
Troubleshooting
- I²C error: scan bus and check 0x48, SDA/SCL and 3.3 V pull-ups.
- Zero value: verify power and register 0x00.
- Reading is warm: move sensor away from Pico and regulator.
Safety and limitations
Use 3.3 V-compatible breakout and observe sensor limits; not a clinical or certified safety measurement.
Manufacturer and platform documentation
Community Notes for This Project
These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.
Set up the comments service to load community notes.