sts1_sensors.edu.TMP112

Module Contents

class TMP112(conversion_rate=1, extended_temp_range=True, address=None, bus=None)

High-accuracy temperature sensor.

Parameters:
  • conversion_rate (int) – Conversion rate. Allowed values: [0.25, 1, 4, 8]. Defaults to 1.

  • extended_temp_range (bool) – If True, range: -55°C - 150°C, if False range: -55°C - 128°C, defaults to True.

  • address (hexadecimal) – Physical address of the sensor on the board (see i2cdetect command). Allowed values: [0x48, 0x49, 0x4A, 0x4B]. If None, the environment variable STS1_SENSOR_ADDRESS_TMP112 will be used. If environment variable is not found, 0x48 will be used.

  • bus (SMBus) – A SMBus object. If None, this class will generate its own, defaults to None.

Example:

temp = TMP112(conversion_rate=1, extended_temp_range=True)
print(f"{temp.get_temp():.2f} °C")
property conversion_rate
get_temp()

Get temperature in Celcius.