Kunkune

How to Use a Logic Level Converter with Arduino

How to Use a Logic Level Converter with Arduino

By Kunkune | Published: 2026-10-23

Category: How-to Guides

Learn how to connect 5V Arduino to 3.3V sensors using a logic level converter. Step-by-step wiring and code for I2C level shifting with TXS0108E.

Quick Answer

Use a bidirectional logic level converter like the TXS0108E to safely connect 5V Arduino pins to 3.3V I2C sensors. Wire the high-voltage side to 5V and the low-voltage side to 3.3V, then connect your SDA and SCL lines through the converter channels.

Why You Need a Level Shifter for I2C

Arduino Uno and many classic boards run at 5V logic, while popular sensors like the MPU6050, BMP280, and OLED displays operate at 3.3V. Connecting them directly can damage the sensor or cause erratic communication. A bidirectional level converter handles the voltage translation automatically without extra control pins.

The TXS0108E provides eight channels, so you can shift multiple signals at once. For simple I2C projects, you only need two channels (SDA and SCL), but extra channels remain available for other 3.3V peripherals.

Choosing Between 2-Channel and 8-Channel Modules

The 2 Channel IIC I2C Logic Level Converter Module (product ID 2426955) is compact and sufficient for most I2C sensor projects. It costs slightly more but includes pull-up resistors optimized for I2C. The TXS0108E 8 Channel Bidirectional Logic Level Converter (product ID 2426944) offers more channels at a lower per-channel cost, making it better for projects with multiple 3.3V devices or mixed signal types.

If you only need to shift one or two I2C lines, the 2-channel module keeps wiring simple. If you plan to expand later, the 8-channel version gives you room to add SPI or UART devices without buying another converter.

Step-by-Step Guide: Wiring and Using a Logic Level Converter

  1. Identify the High-Voltage and Low-Voltage Sides: On a typical level converter module, one side is labeled HV (high voltage, 5V) and the other LV (low voltage, 3.3V). Connect the HV pin to Arduino 5V and the LV pin to the sensor's 3.3V supply. Common mistake: reversing these voltages can damage the module or sensor. Double-check the silkscreen labels before powering the circuit.
  2. Connect the Ground Reference: Connect a ground wire from the Arduino GND to the GND pin on the level converter, and another from the converter GND to the sensor GND. Both sides must share a common ground for the level shifter to work. Common mistake: forgetting the ground connection causes erratic data or no communication. Use a breadboard rail to distribute ground to all devices.
  3. Wire the I2C Data Lines: Connect Arduino SDA (A4 on Uno) to an HV channel pin (e.g., HV1), then connect the corresponding LV channel pin (LV1) to the sensor SDA. Repeat for SCL (A5 on Uno) using a second channel (HV2 to LV2). Common mistake: crossing channels (e.g., SDA on HV1 and SCL on LV2) will not work. Keep the same channel number for each signal line on both sides.
  4. Add Pull-Up Resistors (If Needed): Many level converter modules include pull-up resistors on both sides. If your module lacks them or your I2C bus is longer than 10 cm, add 4.7kΩ resistors from SDA and SCL to 3.3V on the LV side only. Common mistake: adding pull-ups to 5V on the HV side can overdrive the sensor. Check your module datasheet; the 2-channel module includes them, the TXS0108E may not.
  5. Upload and Test with I2C Scanner: Upload the standard I2C scanner sketch (File > Examples > Wire > i2c_scanner) to your Arduino. Open the Serial Monitor at 9600 baud. If wiring is correct, you will see the sensor's I2C address. Common mistake: seeing no devices means check ground, power, and channel mapping. A successful scan confirms the level converter is working before you write your main sketch.

Product Facts

  • 5pcs 2 Channel IIC I2C Logic Level Converter Module 5V to 3.3V Arduino: The 2 Channel IIC I2C Level Converter bridges 5V and 3.3V systems, enabling efficient and stable communication between different voltage devices, perfect for a range of serial applications This module includes built-in pull-up resistors that match I2C timing requirements, so you can wire it directly without external components.
    5pcs 2 Channel IIC I2C Logic Level Converter Module 5V to 3.3V Arduino
    5pcs 2 Channel IIC I2C Logic Level Converter Module 5V to 3.3V Arduino
  • TXS0108E 8 Channel Bidirectional Logic Level Converter: TXS0108E 8 Channel Bidirectional Logic Level Converter Eight channels let you shift I2C, SPI, UART, and GPIO signals simultaneously, making it a flexible choice for multi-sensor projects.
    TXS0108E 8 Channel Bidirectional Logic Level Converter
    TXS0108E 8 Channel Bidirectional Logic Level Converter

Shop Related Products

5pcs 2 Channel IIC I2C Logic Level Converter Module 5V to 3.3V Arduino

5pcs 2 Channel IIC I2C Logic Level Converter Module 5V to 3.3V Arduino

$2.99 $4.90

Shop Now
TXS0108E 8 Channel Bidirectional Logic Level Converter

TXS0108E 8 Channel Bidirectional Logic Level Converter

$1.29 $1.90

Shop Now