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.

Estimated time: 1–2 hours · Skills: I²C wiring, signed registers, fixed-point conversion

Parts from the database

Other supplies

Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.

Connections

  1. Use a breakout for the small surface-mount sensor. VDD to Pico 3V3, GND to GND, SDA to GP0, SCL to GP1.
  2. Tie ADD0 low for address 0x48; verify breakout pull-ups go to 3.3 V.
  3. Place the sensor away from warm regulators and the Pico processor.

Build steps

  1. Run the code below; it reads the two-byte register at 0x00.
  2. Compare with a room thermometer after the board settles.
  3. Warm the sensor gently and confirm readings rise.
  4. 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)

Review the pin assignments in the sketch against the wiring table before uploading.

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.

Share a tip or question about this build

← Browse all projects