"How to Make a Level Shifter
Level shifting is an essential concept in electronics, particularly when dealing with different voltage domains. A level shifter is a device that converts logic signals from one voltage level to another. If you're a DIY enthusiast, hobbyist, or even a professional looking to build your own level shifter, you've come to the right place. This article will guide you through the process of making a level shifter using a popular and reliable method: the digital isolator IC.
Before we dive into the process, let's understand why we need a level shifter. Modern systems often involve different power domains, such as 3.3V for digital circuits and 5V for older or analog components. Without a level shifter, signals can be lost or misinterpreted due to voltage mismatches. Let's ensure your signals remain clear and crisp, regardless of voltage differences.
Components Needed
The main component in our DIY level shifter is the digital isolator IC. Popular choices include the TXS010X from Texas Instruments and the ISO7841 from STMicroelectronics. Other necessary components are easy to source and include resistors, capacitors, and a few passive components.
For this guide, let's use the TXS0104E as an example. It's a low-cost, high-speed, and popular digital isolator IC that works perfectly for our level shifter project. Here's a list of components needed:
- 1x TXS0104E Digital Isolator IC
- 2x Single-channel Opto-isolator (e.g., PC817)
- 2x 1kΩ Resistors
- 2x 10pF Capacitors
- 2x Capacitors between 10µF and 100µF (depending on required isolation voltage)
- 1x USB Mini-B Cable (for programming the TXS0104E)
- Breadboard and jumper wires
Setting up the TXS0104E
The TXS0104E is a UART isolator, meaning it's designed to isolate UART signals. It's compact, easy to use, and perfect for our level shifter project. Before using it, we need to configure and program it. We'll use an FTDI USB-to-UART cable (found in many Arduino boards) and the following steps:
- Connect the FTDI cable to your computer and install any necessary drivers.
- Connect the VCC, GND, and D1-D4 pins of the TXS0104E to the FTDI cable's 5V, GND, and TxD-RxD lines, respectively.
- Download and install the Texas Instruments "Level Shifter Configurator" software.
- Open the software and follow the user guide to configure and program the TXS0104E.
Once programmed, the TXS0104E is ready for use in our level shifter circuit.
Building the Level Shifter Circuit
Now that the TXS0104E is configured, let's build the level shifter circuit. We'll use two opto-isolators to create the isolation barrier and the TXS0104E to communicate across it. Here's a step-by-step guide to constructing the circuit:
- Insert the TXS0104E, two opto-isolators (PC817), and the capacitors into the breadboard.
- Connect the power pins of all components (VCC, GND, and additional Ccu, Cio capacitors) as shown in the schematic.
- Connect the data lines (TxD, RxD, D1-D4) as indicated in the schematic.
- Add two 1kΩ resistors between the VCC and D1-D4 pins of each opto-isolator.
- Add two 10pF capacitors between the data lines and their respective GND connections.
The completed circuit should resemble the schematic, with both the input and output sections isolated from each other.
Testing the Level Shifter
Now that our level shifter is built, let's test it to ensure it's working correctly.
For this test, we'll use an 3.3V microcontroller (like an Arduino Nano 33 BLE) as our input and another 5V microcontroller (like an Arduino Uno) as our output. Here's how to connect and test the level shifter:
- Connect the TXS0104E's VCC and GND to the 5V and GND pins of the Arduino Uno, respectively.
- Connect the Arduino Nano 33 BLE's TxD to the input (D1) of the TXS0104E.
- Connect the Arduino Uno's RxD to the output (D2) of the TXS0104E.
Once connected, upload the following sketches to their respective microcontrollers:
- For the Arduino Nano 33 BLE: Send a simple serial string, like "Hello, Level Shifter!"
- For the Arduino Uno: Read and print the received data
If your level shifter is working correctly, you should see "Hello, Level Shifter!" printed on the serial monitor of the Arduino Uno.
With that, you've successfully built and tested your own level shifter, ensuring clear communication across different voltage domains. Happy making, and until the next project!