Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use Adafruit TXB0104 4-channel Bi-Directional Level Shifter: Examples, Pinouts, and Specs

Image of Adafruit TXB0104 4-channel Bi-Directional Level ShifterDesign with Adafruit TXB0104 4-channel Bi-Directional Level Shifter in Cirkit Designer

Introduction

The Adafruit TXB0104 is a versatile 4-channel bi-directional level shifter designed to interface between devices operating at different voltage levels. This component is essential for mixed-voltage level circuits, allowing for safe and reliable communication between devices such as microcontrollers, sensors, and other integrated circuits that operate at varying logic levels.

Explore Projects Built with Adafruit TXB0104 4-channel Bi-Directional Level Shifter

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ESP32-Based Motion Tracking System with ICM20948 Sensor: A project utilizing Adafruit TXB0104 4-channel Bi-Directional Level Shifter in a practical application
ESP32-Based Motion Tracking System with ICM20948 Sensor

This circuit features a SparkFun ESP32 Thing Plus microcontroller interfaced with an Adafruit ICM20948 9-axis motion sensor via an Adafruit TXB0104 4-channel bi-directional level shifter. The ESP32 reads data from the ICM20948 sensor, calculates orientation angles such as pitch, roll, yaw, and azimuth, and outputs these values to the serial monitor. The level shifter ensures compatibility between the 3.3V logic levels of the ESP32 and the 1.8V logic levels required by the ICM20948.

Open Project in Cirkit Designer
Image of Raspberry Pi 4B and mlx90614 Infrared Thermometer with Logic Level Conversion: A project utilizing Adafruit TXB0104 4-channel Bi-Directional Level Shifter in a practical application
Raspberry Pi 4B and mlx90614 Infrared Thermometer with Logic Level Conversion

This circuit connects a Raspberry Pi 4B to an MLX90614 infrared temperature sensor using an Adafruit 4-channel I2C-safe Bi-directional Logic Level Converter. The level converter is used to safely step down the 5V I2C signals from the Raspberry Pi to the 3.3V needed by the MLX90614 sensor, ensuring compatibility between the devices. Ground connections are shared among all components, and the sensor is powered by the Raspberry Pi's 5V supply through the level converter.

Open Project in Cirkit Designer
Image of Raspberry Pi 4B-Controlled Bipolar Stepper Motor with tb6600 Driver and Level Shifting: A project utilizing Adafruit TXB0104 4-channel Bi-Directional Level Shifter in a practical application
Raspberry Pi 4B-Controlled Bipolar Stepper Motor with tb6600 Driver and Level Shifting

This circuit is designed to control a bipolar stepper motor using a Raspberry Pi 4B as the main controller and a tb6600 micro stepping motor driver. The Raspberry Pi interfaces with the motor driver through GPIO pins, with signal voltage levels adjusted by an Adafruit TXB0104 4-channel bi-directional level shifter. Power is supplied to the motor driver by a switching power supply, which is connected to a 12V 5A power supply, and the Raspberry Pi is powered via a micro USB cable connected to the same 12V power supply.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Description
1 OE Output Enable (active-high)
2-5 B1-B4 High-voltage side pins
6 GND Ground reference for the low-voltage side
7-10 A1-A4 Low-voltage side pins
11 GND Ground reference for the high-voltage side
12 VCCA Low-voltage supply (1.2V to 3.6V)
13 VCCB High-voltage supply (1.65V to 5.5V)
14 NC No Connection (do not connect)

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect VCCA to the lower voltage supply and VCCB to the higher voltage supply. Ensure that both grounds (pin 6 and 11) are connected to the common ground of your system.
  2. Signal Connections: Connect the low-voltage signals to A1-A4 and the corresponding high-voltage signals to B1-B4.
  3. Output Enable: Connect the OE pin to a high logic level (usually to VCCB) to enable the device. If you need to disable the level shifter temporarily, you can pull this pin low.

Important Considerations and Best Practices

Example Connection with Arduino UNO

// Example code for interfacing a 3.3V sensor with a 5V Arduino UNO using the TXB0104 level shifter

// Define the sensor's data pin connected to the level shifter's low-voltage side (A1)
const int sensorPin = 2; // Arduino pin connected to TXB0104 A1

void setup() {
  // Initialize the sensor's data pin as an input
  pinMode(sensorPin, INPUT);
}

void loop() {
  // Read the sensor's data
  int sensorValue = digitalRead(sensorPin);
  
  // Process the sensor data (for demonstration purposes, we'll just print it)
  Serial.begin(9600);
  Serial.println(sensorValue);
  
  // Add a delay between reads for stability
  delay(500);
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: Can the TXB0104 be used for I2C or SPI communication? A: The TXB0104 is not recommended for I2C due to the lack of open-drain structure. For SPI, it can be used if the clock speeds are within the component's operating range.

Q: What happens if VCCA is higher than VCCB? A: The TXB0104 is designed to have VCCA at a lower voltage than VCCB. Applying a higher voltage to VCCA can damage the device.

Q: Is it necessary to connect all channels even if they are not in use? A: No, it is not necessary to connect all channels. Unused channels can be left unconnected. However, ensure that unused input pins are not left floating.

Q: Can the TXB0104 be used in a permanent installation? A: Yes, the TXB0104 can be used in permanent installations, provided that the design follows the recommended best practices for signal integrity and power supply stability.