Free shipping for orders above 60 €

How to Connect Four TMP117 Sensors on the I²C Bus

This high-precision temperature sensor from Texas Instrument has four I²C addresses and using them is very easy! You can connect up to four TMP117 at the same time on the I²C bus without using any kind of I²C Multiplexer. The four I²C addresses are 0x480x490x4A and 0x4B.

Let’s start connecting the sensors:

  • VCC pin from all four sensors to either 3.3V or 5V. If you are using an Arduino Uno, use the 5V pin.
  • GND pin from all four sensors to the GND pin on your Arduino.
  • SCK pin from all four sensors to the I²C clock SCL pin on your Arduino. On the Arduino Uno that would be the pin A5.
  • SDI pin from all four sensors to the I²C data SDA pin on your Arduino. On the Arduino Uno that would be the pin A4.
  • You can leave the ALERT pin unconnected.

Selecting the I²C Addresses

How you connect the AD0 pin will define the I²C address for that sensor.

  • First sensor: leave the AD0 pin unconnected for the default address (0x49).
  • Second sensor: connect the AD0 pin to the GND pin for the alternative address (0x48).
  • Third sensor: connect the AD0 pin to the SDA pin for the alternative address (0x4A).
  • Fourth sensor: connect the AD0 pin to the SCL pin for the alternative address (0x4B).

When you leave the AD0 pin unconnected, you are actually letting the VCC potential reach the ADD0 pin from the sensor through one of the resistors. But when you connect the AD0 pin to either GND, SDA, or SCL, you are changing the signal to the ADD0 pin. The sensor recognizes which signal is connected to this pin and changes the I²C address.

The picture below shows four boards with TMP117 sensors connected to the same I²C bus. The four sensors are connected as described above, with the AD0 pin from each sensor connected differently. As you can see, no more than four wires are still needed to connect to your microcontroller: VCC, GND, SDA, and SCL.

Example Sketch for four TMP117 Sensors

Now we need the software. The TMP117 library written by Nils Minor offers a great way to connect to a single TMP117. Using his library as a starting point, the library below adds a new sketch that enables the connection of four TMP117 sensors on the I²C bus.

After installing the library, run the example for multiple sensors on the I²C bus. Open up File -> Examples -> TMP117-Arduino -> BlueDot_TMP117_Test_4-Sensors.

After uploading the code into your Arduino,  open up the Serial Monitor at 115200 baud speed to get the temperature values from all four sensors at the same time.

Leave a Reply

Your email address will not be published. Required fields are marked *