# Adafruit LTC4316 I2C Address Translator

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/129/106/medium800/adafruit_products_5914-00.jpg?1712062603)

Adafruit has hundreds of designs that use I2C - a two-wire protocol that can let you quickly connect sensors, OLEDs, GPIO expanders, and more. [Folks love I2C because you can simply connect 4 wires for power and data, and even better, share those wires with multiple devices](https://learn.adafruit.com/working-with-i2c-devices)!

![](https://cdn-learn.adafruit.com/assets/assets/000/129/107/medium800/adafruit_products_5914-05.jpg?1712062668)

One things folks _don't like_ about I2C is that each device requires it's own unique 'address'. You can only have one device with a 0x20 address, for example, so while in theory you could have up to 127 device, each for the 7-bits of address space available, in reality you will quickly bump into two sensors with the same address.

Many I2C components have jumpers or switches that allow changing the address, but not all. And some only let you pick between two values. [One solution is to use an I2C multiplexer](https://www.adafruit.com/search?q=i2c+multiplexer), and these work pretty well, but they [require some noodling in your code to set up the multiplexer and then switch between the devices being 'plexed](https://learn.adafruit.com/working-with-i2c-devices/address-conflicts).

![](https://cdn-learn.adafruit.com/assets/assets/000/129/108/medium800/adafruit_products_5914-03.jpg?1712062723)

The **Adafruit LTC4316 I2C Address Translator** is another solution, with some magic sprinkled inside. This chip does _on the fly address translation_. There's an 'input I2C' half, and an 'output I2C' half. And any devices on the 'output' half will automatically have their addresses translated from the input half.

Specifically, each device will have bit A6 flipped (most-significant-bit of the address) and then bits A4 and A5 can also be flipped or kept the same, with the two DIP switches on board. To determine the translated address, we use XOR bitwise math.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/109/medium800/adafruit_products_5914-04.jpg?1712062807)

Ok, that's a little confusing, so let's work through an example. Say we have an AHT20 connected on the output side of this breakout. The AHT20 does not have an adjustable I2C address: it's fixed at 0x38. If both DIP switches are ON, then only A6 is flipped. That means the I2C controller on the input side will see **0x38 XOR 0x40 = 0x78** address. If we flip the A5 switch off, now it will be **0x38 XOR 0x60 = 0x58** and if both switches are off, now bits A4, A5 and A6 will be flipped, so **0x38 XOR 0x70 = 0x48.**

As far as the AHT20 is concerned, it will happily still see I2C writes and reads on 0x38, but from the I2C controller's perspective, the device is responding on the new address.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/110/medium800/adafruit_products_5914-02.jpg?1712062839)

If you need more than 4 address translation options (two switches give you 4 options) we also have a spot where you can solder an XOR\_LOW resistor for setting the 'bottom' 3 bits by soldering in a resistor value according to the datasheet.

It can get confusing quickly, so we definitely recommend using an I2C scanner to debug. Note also that you have to reset the LTC if you change the translation address with resistors or the DIP switches: the translation value is picked up on chip boot and isn't on-the-fly adjustable without a toggle of the Enable pin.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/111/medium800/adafruit_products_5914-01.jpg?1712062875)

While this chip is magical, there's a few things to watch for: it doesn't seem to support clock-stretching so [not for funky chips like BNO055](https://learn.adafruit.com/working-with-i2c-devices/clock-stretching). Just because you can change the address on the fly, doesn't mean the software driver supports it!

Some firmware is expecting a specific address and it may not be trivial to change the address. Check the driver to make sure you know how to change the address to the new value.

To get you going fast, we spun up a custom-made PCB in the [**STEMMA QT** form factor](https://www.adafruit.com/?q=stemma%20qt%20sensor "STEMMA QT form factor"), making it easy to interface. The [STEMMA QT connectors](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt) on either side are compatible with the [SparkFun Qwiic](https://www.sparkfun.com/qwiic) I2C connectors. This allows you to make solderless connections between your development board and the LTC4316 or to chain it with a wide range of other sensors and accessories using a [**compatible cable**](https://www.adafruit.com/?q=stemma%20qt%20cable). [**QT Cable is not included** , but we have a variety in the shop](https://www.adafruit.com/?q=stemma+qt+cable&sort=BestMatch).

# Adafruit LTC4316 I2C Address Translator

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/129/148/medium800/adafruit_products_double.jpg?1712086479)

## Power Pins

- **VIN** - this is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V.
- **GND** - common ground for power and logic.

## I2C Logic Pins

- **SCI** - I2C clock pin for the input side, connect to your I2C controller I2C clock line. There is a **10K pullup** on this pin.
- **SDI** - I2C data pin for the input side, connect to your I2C controller I2C data line. There is a **10K pullup** on this pin.
- **SCO** - I2C clock pin for the output side, connect to the clock line on the sensor whose I2C address you want to change. There is a **10K pullup** on this pin.
- **SDO** - I2C data pin for the output side, connect to the data line on the sensor whose I2C address you want to change. There is a **10K pullup** on this pin.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) -** These connectors allow you to connectors to dev boards with **STEMMA QT** connectors or to other things with [various associated accessories](https://www.adafruit.com/category/619).
  - The connector on the left of the board, above **VIN** , is for the input side.
  - The connector on the right of the board, above **ENA** , is for the output side.

## DIP Switches

The two DIP switches are located at the top center of the board. The top switch ( **1** ) controls bit **A5** and the bottom switch ( **2** ) controls bit **A4** for the I2C address connected to the output side. This allows for four address translation options:

- If **both switches are on** , then only **A6 will be flipped**. 
- If the **A5 switch is off** , bits **A5 and A6 will be flipped**.
- If the **A4 switch is off** , bits **A4 and A6 will be flipped**.
- If **both switches are off** , bits **A4, A5 and A6 will be flipped**.

XOR bitwise math is used to calculate the translated I2C address. This can get very complicated very quickly, so it's recommended to use an I2C scanner program to debug. Note also that you have to reset the LTC4316 if you change the translation address.

Warning: You need to reset the LTC4316 if you change the translation address.

## XORL Resistor Spot

Directly below the DIP switch is a spot to solder a XOR\_LOW resistor for setting the 'bottom' 3 bits by soldering in a resistor value according to the [datasheet](https://cdn-learn.adafruit.com/assets/assets/000/129/112/original/4316fa.pdf?1712063113) (_Table 2. Setting the Resistive Divider at XORL_).

Just like with the DIP switches, this can get very complicated very quickly, so it's recommended to use an I2C scanner program to debug.&nbsp;

## Additional Pins

- **RDY -** This is the Ready pin. It is an output that indicates if the I2C device on the output side is ready for address translation. The pin releases high when the LTC4316 has completed configuration of the address translation byte.
- **ENA -** This is the Enable pin. It is an input to the LTC4316. You can toggle the pin low to restart the LTC4316. This restarts the configuration of the address translation byte.

## Power LED and LED Jumper

- **Power LED** - In the upper left corner, above the STEMMA connector, on the front of the board, is the power LED, labeled **on**. It is a green LED.
- **LED jumper** - This jumper is located on the back of the board, to the right of the board label on the silk. Cut the trace on this jumper to cut power to the "on" LED.

# Adafruit LTC4316 I2C Address Translator

## CircuitPython and Python

This page shows how to perform an I2C scan to demonstrate how to use the LTC4316 for both a CircuitPython microcontroller and a Raspberry Pi single board computer running Linux. You'll connect two AHT20 sensors, which have the same I2C address ( **0x38** ), to experiment with translating the address for one of them. Remember that you need to restart the LTC4316 every time you adjust the DIP switch.

Then, you'll use the [Adafruit\_CircuitPython\_AHTx0](https://github.com/adafruit/Adafruit_CircuitPython_AHTx0) driver to use two AHT20 sensors, with the help of the LTC4316, to read temperature and humidity data.

You can use the AHT20 driver with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Warning: Remember that you need to restart the LTC4316 every time you adjust the DIP switch.

### Adafruit AHT20 - Temperature & Humidity Sensor Breakout Board

[Adafruit AHT20 - Temperature & Humidity Sensor Breakout Board](https://www.adafruit.com/product/4566)
The AHT20 is a nice but inexpensive temperature and humidity sensor [from the same folks that brought us the DHT22](https://www.adafruit.com/product/385). You can take sensor readings as often as you like, and it uses standard I2C so its super easy to use with any Arduino or...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4566)
[Related Guides to the Product](https://learn.adafruit.com/products/4566/guides)
![Angled Shot of the Adafruit AHT20 Temp+Hum Sensor - Assembled PCB](https://cdn-shop.adafruit.com/640x480/4566-04.jpg)

## CircuitPython Microcontroller Wiring

First wire up the sensors and LTC4316 to your board exactly as follows. The following are the breakouts wired to a Feather RP2040 using the STEMMA connector:

- **Board STEMMA 3V** to **sensor 1** **VIN (red wire)**  
- **Board STEMMA GND** to **sensor 1 GND (black wire)**  
- **Board STEMMA SCL** to **sensor 1 SCL (yellow wire)**  
- **Board STEMMA SDA** to **sensor 1 SDA (blue wire)**
- **Sensor 1 VIN** to **LTC4316 VIN (red wire)**
- **Sensor 1 GND** to **LTC4316 GND (black wire)**
- **Sensor 1 SCL** to **LTC4316 SCI (yellow wire)**
- **Sensor 1 SDA** to **LTC4316 SDI (blue wire)**
- **LTC4316 VIN** to **sensor 2 VIN (red wire)**
- **LTC4316 GND** to **sensor 2 GND to (black wire)**
- **LTC4316 SCO** to **sensor 2 SCL (yellow wire)**
- **LTC4316 SDO** to **sensor 2 SDA (blue wire)**

![adafruit_products_featherStemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/172/medium640/adafruit_products_featherStemma_bb.jpg?1712158310)

The following are the sensors wired to a Feather RP2040 using a solderless breadboard:

- **Board 3V** to **sensor 1** **VIN (red wire)**  
- **Board GND** to **sensor 1 GND (black wire)**  
- **Board SCL** to **sensor 1 SCL (yellow wire)**  
- **Board SDA** to **sensor 1 SDA (blue wire)**
- **Sensor 1 VIN** to **LTC4316 VIN (red wire)**
- **Sensor 1 GND** to **LTC4316 GND (black wire)**
- **Sensor 1 SCL** to **LTC4316 SCI (yellow wire)**
- **Sensor 1 SDA** to **LTC4316 SDI (blue wire)**
- **LTC4316 VIN** to **sensor 2 VIN (red wire)**
- **LTC4316 GND** to **sensor 2 GND to (black wire)**
- **LTC4316 SCO** to **sensor 2 SCL (yellow wire)**
- **LTC4316 SDO** to **sensor 2 SDA (blue wire)**

![adafruit_products_featherBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/173/medium640/adafruit_products_featherBB_bb.jpg?1712158327)

## CircuitPython I2C Scan

Before running the AHT20 temperature and humidity example, you'll run an I2C scan to check the translated I2C address for the second AHT20 sensor. Update **code.py** with this script. Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/I2C_Scanners/circuitpython/code.py

The I2C scanner code runs an I2C scan on each valid bus found and returns the device addresses found.

Both AHT20 sensors are on address **0x38**. The sensor on the input side of the LTC4316 will remain on **0x38** , but the sensor on the output side of the LTC4316 will be translated depending on the position of the DIP switches. To start, run the scanner code with the LTC4316 with **both the A4 and A5 switches off** , you'll see this result in the serial monitor:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/198/medium800/adafruit_products_cpSwitchOff.jpg?1712159141)

Set **switch A5 to on** and power cycle the board. Now you'll see these addresses in the serial monitor:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/206/medium800/adafruit_products_cpA5switchOn.jpg?1712159329)

Set switch **A5 to off and A4 to on**. Power cycle the board and you'll see these addresses in the serial monitor:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/207/medium800/adafruit_products_cpA4switchOn.jpg?1712159338)

Finally, set **both A5 and A4** to on and power cycle the board. The translated address for sensor 2 is **0x78** , which is a [reserved I2C address](https://learn.adafruit.com/i2c-addresses/the-list) so it won't show up in CircuitPython. You'll only see **0x38** for sensor 1:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/233/medium800/adafruit_products_bothOnCP.png?1712174438)

## Raspberry Pi Wiring

Since there are _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Here's the Raspberry Pi wired with I2C using the STEMMA connector. When you're working with I2C devices on a Raspberry Pi, it's important to plug everything in _before_ powering up the Pi and **do not** unplug/replug devices while the Pi is running. This can cause errors on the filesystem.

Warning: Do not remove/insert I2C devices while the Raspberry Pi is running. It can cause errors on the filesystem.

- **Pi 3V** to **sensor 1** **VIN (red wire)**  
- **Pi GND** to **sensor 1 GND (black wire)**  
- **Pi SCL** to **sensor 1 SCL (yellow wire)**  
- **Pi SDA** to **sensor 1 SDA (blue wire)**
- **Sensor 1 VIN** to **LTC4316 VIN (red wire)**
- **Sensor 1 GND** to **LTC4316 GND (black wire)**
- **Sensor 1 SCL** to **LTC4316 SCI (yellow wire)**
- **Sensor 1 SDA** to **LTC4316 SDI (blue wire)**
- **LTC4316 VIN** to **sensor 2 VIN (red wire)**
- **LTC4316 GND** to **sensor 2 GND to (black wire)**
- **LTC4316 SCO** to **sensor 2 SCL (yellow wire)**
- **LTC4316 SDO** to **sensor 2 SDA (blue wire)**

![adafruit_products_piStemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/235/medium640/adafruit_products_piStemma_bb.jpg?1712256960)

Here's the Raspberry Pi wired with I2C using a solderless breadboard:

- **Pi 3V** to **sensor 1** **VIN (red wire)**  
- **Pi GND** to **sensor 1 GND (black wire)**  
- **Pi SCL** to **sensor 1 SCL (yellow wire)**  
- **Pi SDA** to **sensor 1 SDA (blue wire)**
- **Sensor 1 VIN** to **LTC4316 VIN (red wire)**
- **Sensor 1 GND** to **LTC4316 GND (black wire)**
- **Sensor 1 SCL** to **LTC4316 SCI (yellow wire)**
- **Sensor 1 SDA** to **LTC4316 SDI (blue wire)**
- **LTC4316 VIN** to **sensor 2 VIN (red wire)**
- **LTC4316 GND** to **sensor 2 GND to (black wire)**
- **LTC4316 SCO** to **sensor 2 SCL (yellow wire)**
- **LTC4316 SDO** to **sensor 2 SDA (blue wire)**

![adafruit_products_piBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/236/medium640/adafruit_products_piBB_bb.jpg?1712257200)

## Raspberry Pi I2C Scan

You can [run an I2C scan easily on a Raspberry Pi](https://learn.adafruit.com/scanning-i2c-addresses/raspberry-pi) using `i2cdetect` in a terminal window.&nbsp;If not already done, be sure to enable I2C on the Raspberry Pi via&nbsp;`raspi-config`. If the `i2cdetect` command is not found, install it with:

```terminal
sudo apt-get install i2c-tools
```

And then to run a scan, use `i2cdetect` with the following command line parameters:

```terminal
i2cdetect -y 1
```

Here is the output in the terminal with **switch A5 on and switch A4 off** :

![](https://cdn-learn.adafruit.com/assets/assets/000/129/237/medium800/adafruit_products_Screenshot_from_2024-04-03_15-31-06.png?1712257942)

Now that you've completed the I2C scan on either a CircuitPython microcontroller or a Raspberry Pi, you can run an example for both of the AHT20 sensors.

## Python Installation of AHTx0 Library

You'll need to install the **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-ahtx0`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the **Adafruit\_CircuitPython\_AHTx0** library, and its dependencies, into the **lib** folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy the **entire**  **lib**  **folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following folders and file:

- **/adafruit\_bus\_device**
- **/adafruit\_register**
- **adafruit\_ahtx0.mpy**

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/ahtx0_ahtx0_simpletest.py.png )

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file:

`python3 code.py`

## Example Code

For this example, you'll have the **LTC4315 switch A5 on and switch A4 off**. This will give the translated AHT20 sensor an I2C address of **0x68**.

**If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

**If running Python:** The console output will appear wherever you are running Python.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/LTC4316_Examples/LTC4316_CircuitPython_Example/code.py

First, both sensors are instantiated over I2C. The first AHT20 is instantiated with its default address **0x38**. The second AHT20 is instantiated with its translated address at **0x68**. In the loop, readings from both sensors are printed to the serial monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/238/medium800/adafruit_products_aht20_cpSerial.png?1712258721)

# Adafruit LTC4316 I2C Address Translator

## Python Docs

# Adafruit LTC4316 I2C Address Translator

## Arduino

This page shows how to perform an I2C scan to demonstrate how to use the LTC4316 for with Arduino. You'll connect two AHT20 sensors, which have the same I2C address ( **0x38** ), to experiment with translating the address for one of them. Remember that you need to restart the LTC4316 every time you adjust the DIP switch.

Then, you'll use the [Adafruit\_AHTx0](https://github.com/adafruit/Adafruit_AHTX0) library to use two AHT20 sensors, with the help of the LTC4316, to read temperature and humidity data.

Warning: Remember that you need to restart the LTC4316 every time you adjust the DIP switch.

### Adafruit AHT20 - Temperature & Humidity Sensor Breakout Board

[Adafruit AHT20 - Temperature & Humidity Sensor Breakout Board](https://www.adafruit.com/product/4566)
The AHT20 is a nice but inexpensive temperature and humidity sensor [from the same folks that brought us the DHT22](https://www.adafruit.com/product/385). You can take sensor readings as often as you like, and it uses standard I2C so its super easy to use with any Arduino or...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4566)
[Related Guides to the Product](https://learn.adafruit.com/products/4566/guides)
![Angled Shot of the Adafruit AHT20 Temp+Hum Sensor - Assembled PCB](https://cdn-shop.adafruit.com/640x480/4566-04.jpg)

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the breakout VIN.

Here is an Adafruit Metro wired up to the two AHT20 sensors and the LTC4316 using the STEMMA QT connector:

- **Board 5V** &nbsp;to **sensor 1** **VIN (red wire)**  
- **Board GND** to **sensor 1 GND (black wire)**  
- **Board SCL** to **sensor 1 SCL (yellow wire)**  
- **Board SDA** to **sensor 1 SDA (blue wire)**
- **Sensor 1 VIN** to **LTC4316 VIN (red wire)**
- **Sensor 1 GND** to **LTC4316 GND (black wire)**
- **Sensor 1 SCL** to **LTC4316 SCI (yellow wire)**
- **Sensor 1 SDA** to **LTC4316 SDI (blue wire)**
- **LTC4316 VIN** to **sensor 2 VIN (red wire)**
- **LTC4316 GND** to **sensor 2 GND to (black wire)**
- **LTC4316 SCO** to **sensor 2 SCL (yellow wire)**
- **LTC4316 SDO** to **sensor 2 SDA (blue wire)**

![adafruit_products_metroStemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/178/medium640/adafruit_products_metroStemma_bb.jpg?1712158383)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Board 5V** &nbsp;to **sensor 1** **VIN (red wire)**  
- **Board GND** to **sensor 1 GND (black wire)**  
- **Board SCL** to **sensor 1 SCL (yellow wire)**  
- **Board SDA** to **sensor 1 SDA (blue wire)**
- **Sensor 1 VIN** to **LTC4316 VIN (red wire)**
- **Sensor 1 GND** to **LTC4316 GND (black wire)**
- **Sensor 1 SCL** to **LTC4316 SCI (yellow wire)**
- **Sensor 1 SDA** to **LTC4316 SDI (blue wire)**
- **LTC4316 VIN** to **sensor 2 VIN (red wire)**
- **LTC4316 GND** to **sensor 2 GND to (black wire)**
- **LTC4316 SCO** to **sensor 2 SCL (yellow wire)**
- **LTC4316 SDO** to **sensor 2 SDA (blue wire)**

![adafruit_products_metroBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/179/medium640/adafruit_products_metroBB_bb.jpg?1712158393)

Info: There are no additional libraries needed for the I2C scan.

## I2C Scan Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/I2C_Scanners/arduino/i2c_scanner/i2c_scanner.ino

Both AHT20 sensors are on address **0x38**. The sensor on the input side of the LTC4316 will remain on **0x38** , but the sensor on the output side of the LTC4316 will be translated depending on the position of the DIP switches.

To start, setup the LTC4316 with **both the A4 and A5 switches off**. Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 9600 baud. You'll see this result in the Serial Monitor:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/248/medium800/adafruit_products_arduinoSwitchOff.jpg?1712263106)

Set **switch A5 to on** and power cycle the board. Now you'll see these addresses in the Serial Monitor:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/249/medium800/adafruit_products_arduinoA5on.jpg?1712263117)

Set switch **A5 to off and A4 to on**. Power cycle the board and you'll see these addresses in the Serial Monitor:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/250/medium800/adafruit_products_arduinoA4on.jpg?1712263128)

Finally, set **both A5 and A4 to on** and power cycle the board. In this iteration, sensor 2's translated address is **0x78** , which is a [reserved I2C address](https://learn.adafruit.com/i2c-addresses/the-list) and is usually not used. However, it does show up in with this scan:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/251/medium800/adafruit_products_arduinoBothOn.jpg?1712263138)

Now that you've run the I2C scan test, you can run an example for both of the AHT20 sensors.

## Library Installation

You can install the **Adafruit AHTX0** library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/239/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1712259262)

Click the **Manage Libraries...** menu item, search for **Adafruit AHTX0** , and select the **Adafruit AHTX0** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/241/medium800/adafruit_products_aht20_lib.png?1712260175)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/129/242/medium800/adafruit_products_depends.png?1712260183)

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!

## AHT20 Example

For this example, you'll have the **LTC4315 switch A5 on and switch A4 off**. This will give the translated AHT20 sensor an I2C address of **0x68**.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/LTC4316_Examples/LTC4316_Arduino_Example/LTC4316_Arduino_Example.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the two AHT20 sensors recognized over I2C. The first is on its default address of **0x38**. The second is on the translated address of **0x68**. Then, temperature and humidity readings from both sensors will be printed to the Serial Monitor.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/240/medium800/adafruit_products_serialAHT20.png?1712260142)

# Adafruit LTC4316 I2C Address Translator

## Arduino Docs

# Adafruit LTC4316 I2C Address Translator

## Downloads

## Files

- [LTC4316 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/129/112/original/4316fa.pdf?1712063113)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-LTC4316-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20LTC4316%20I2C%20Address%20Translator.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/129/113/medium800/adafruit_products_schem.png?1712063381)

![](https://cdn-learn.adafruit.com/assets/assets/000/129/114/medium800/adafruit_products_fab.png?1712063387 dimensions are in inches)


## Primary Products

### Adafruit LTC4316 I2C Address Translator

[Adafruit LTC4316 I2C Address Translator](https://www.adafruit.com/product/5914)
Adafruit has hundreds of designs that use I2C - a two-wire protocol that can let you quickly connect sensors, OLEDs, GPIO expanders, and more. [Folks love I2C because you can simply connect 4 wires for power and data, and even...](https://learn.adafruit.com/working-with-i2c-devices)

In Stock
[Buy Now](https://www.adafruit.com/product/5914)
[Related Guides to the Product](https://learn.adafruit.com/products/5914/guides)

## Featured Products

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets

[STEMMA QT / Qwiic JST SH 4-pin Cable with Premium Female Sockets](https://www.adafruit.com/product/4397)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium female headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and...

In Stock
[Buy Now](https://www.adafruit.com/product/4397)
[Related Guides to the Product](https://learn.adafruit.com/products/4397/guides)
### STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable

[STEMMA QT / Qwiic JST SH 4-pin to Premium Male Headers Cable](https://www.adafruit.com/product/4209)
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert...

In Stock
[Buy Now](https://www.adafruit.com/product/4209)
[Related Guides to the Product](https://learn.adafruit.com/products/4209/guides)
### JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic

[JST SH 4-pin Cable with Alligator Clips - STEMMA QT / Qwiic](https://www.adafruit.com/product/4398)
This cable will make it super easy to use our plug-and-play STEMMA QT boards with boards like Circuit Playground. On one end you get a Qwiic / STEMMA QT connector (technically known as a JST SH 4-pin plug)&nbsp; into 4 individual wires with grippy alligator clips. We're carrying these to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4398)
[Related Guides to the Product](https://learn.adafruit.com/products/4398/guides)

## Related Guides

- [Working with Multiple Same Address I2C Devices](https://learn.adafruit.com/working-with-multiple-i2c-devices.md)
- [Adafruit AirLift Shield - ESP32 WiFi Co-Processor](https://learn.adafruit.com/adafruit-airlift-shield-esp32-wifi-co-processor.md)
- [CNC Rotary Macropad](https://learn.adafruit.com/cnc-rotary-macropad.md)
- [Adafruit Slider Trinkey](https://learn.adafruit.com/adafruit-slider-trinkey.md)
- [Ambient Sound Machine](https://learn.adafruit.com/ambient-machine.md)
- [Adafruit DS1841 I2C Logarithmic Resistor](https://learn.adafruit.com/adafruit-ds1841-i2c-logarithmic-resistor.md)
- [ANO Directional Navigation and Scroll Wheel Rotary Encoder and Breakout](https://learn.adafruit.com/ano-rotary-encoder.md)
- [Creating and sharing a CircuitPython library](https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library.md)
- [Adafruit Feather 32u4 Adalogger](https://learn.adafruit.com/adafruit-feather-32u4-adalogger.md)
- [Matrix Portal Creature Eyes](https://learn.adafruit.com/matrix-portal-creature-eyes.md)
- [Raspberry Pi Care and Troubleshooting](https://learn.adafruit.com/raspberry-pi-care-and-troubleshooting.md)
- [Gravity Falls Memory Gun](https://learn.adafruit.com/gravity-falls-memory-gun.md)
- [ScoutMakes DRV5032 Hall Sensor](https://learn.adafruit.com/scoutmakes-drv5032-hall-sensor.md)
- [No-Solder Visualizer Capacitive Touch Controller](https://learn.adafruit.com/no-solder-visualizer-capacitive-touch-controller.md)
- [Adafruit 2.8" TFT Touch Shield v2 - Capacitive or Resistive](https://learn.adafruit.com/adafruit-2-8-tft-touch-shield-v2.md)
