Main Content

TMP102 Temperature Sensor

Read ambient temperature in degree Celsius using TMP102 temperature sensor

Since R2024b

Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.

  • Rasspberry Pi TMP102 Temperature Sensor Block Icon

Libraries:
Simulink Support Package for Raspberry Pi Hardware / Sensors / Environmental Sensors

Description

Use the TMP102 Temperature Sensor block to read ambient temperature values from a TMP102 sensor, in degree Celsius.

Examples

Ports

Output

expand all

The port outputs ambient temperature that the TMP102 sensor reads in degree Celsius.

Data Types: double

Parameters

expand all

Main

Specify the I2C module on the Raspberry Pi® hardware to communicate with the TMP102 sensor.

To enable the secondary I2C bus on your Raspberry Pi hardware, follow the steps as mentioned in Enable Secondary I2C Bus of Raspberry Pi Hardware.

Specify the I2C peripheral device address from which you want to read the TMP102 temperature data.

You can connect up to four TMP102 temperature sensors to your Raspberry Pi hardware. The I2C address for the sensor connection is dependent on the state of the ADD0 pin of the sensor. This table provides the I2C addresses and their corresponding ADD0 pin connection details.

Raspberry Pi Pin ConnectionI2C Address
GND0x48
VCC0x49
SDA0x4A
SCL0x4B

Specify the frequency at which the block reads the temperature values from the TMP102 sensor.

Advanced

Enter the minimum and maximum temperature threshold limits to generate a signal on the alert pin of the TMP102 sensor when the ambient temperature equals or exceeds the maximum threshold value.

Version History

Introduced in R2024b