adafruit_tc74

CircuitPython library for the Microchip TC74 Digital Temperature Sensor

  • Author(s): Bryan Siepert, Garrett Koller

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_tc74.TC74(i2c_bus: I2C, address: int = 72)

Driver for the Microchip TC74 Digital Temperature Sensor.

Parameters:
  • i2c_bus (I2C) – The I2C bus the TC74 is connected to

  • address (int) – The I2C device address for the sensor. Default is 0x48

Quickstart: Importing and using the TC74

Here is an example of using the TC74 class. First you will need to import the libraries to use the sensor

import board
import adafruit_tc74

Once this is done you can define your board.I2C object and define your sensor object

i2c = board.I2C()   # uses board.SCL and board.SDA
tc = adafruit_tc74.TC74(i2c)

Now you have access to the temperature using temperature.

temperature = tc.temperature
data_ready = 1

Read-only bit that indicates when the temperature register is ready to be read from, especially after power-on or when switching from the shutdown to the normal state.

shutdown = 1

Set to True to turn off the temperature measurement circuitry in the sensor. While shut down the configurations properties can still be read or written but the temperature will not be measured.

property temperature: int

Returns the current temperature in degrees Celsius. Resolution is 1 degrees Celsius.