Level shifting is often required to make different electronic boards communicate with each other. Even on the same board it is common to find chips working at different voltages. One good example is I2C: you can find I2C parts working with supplies ranging from as low as 1.5V all the way up to 5V. The I2C protocol is half-duplex, so bidirectional level translation is required.
Figure 1 shows a very simple circuit to achieve bidirectional level shifting using a single FET and two resistors. Quite elegant, isn’t it? The two ICs U1 and U2 want to communicate via I2C but they run at different voltages VL and VH, where VL < VH. The N-MOSFET Q has the gate biased with VL. Pull-up resistors are applied at each side of the FET, each to their relative supply voltage.
Here is how the circuit works. When U1 wants to transmit a logic "one" it turns off its internal FET thus letting RL pull the voltage of node A to VL. This will turn-off the FET Q, opening the circuit and allowing B to be pulled to a high voltage, VH in this case. U1 effectively “transmitted” a logic "one" to U2.
When U1 wants to transmit a logic zero, it pulls A to ground. This turns Q on and begins the discharge of the node B. Eventually both nodes A and B are at the ground potential. A logic zero has been passed from U1 to U2. Note that the same behavior is observed if the direction of the communication is inverted.
I have used this circuit in several projects. It is simple and reliable. However there are few things that needs to be considered before using it:
- If you are using this circuit to translate the voltage level out of a full CMOS output, keep in mind that the voltage will now have a much slower rising edge compared with the falling one. This is due to the fact that the voltage is pulled high not by a strong/low-resistance FET, but instead by a rather large resistance.
- Moreover, the circuit draws constant current when a logic zero is transmitted. Make sure this is compatible with the power budget of your project.
- Commercial FETs are not symmetric. There are several differences between the source and the drain. The biggest difference, as far as this circuit is concerned, is the presence of the body diode. Off-the-shelf transistors usually have the body shorted with the source, and this is represented by a diode in antiparallel with the drain and the source. Figure 4 shows the equivalent circuit when U1 transmits a zero. When U1 pulls A low, the diode turns on first and the voltage across the FET is VD. The FET goes from saturation to ohmic region and causes the diode to turn off. However, if RH is too small or the FET is too weak, it is possible that the diode never turns off and the FET stays in saturation. This could cause thermal problems for the FET and, more importantly, could make U2 misinterpret the voltage at B (VD) for a logic high. Make sure you size both the resistors and the FET to guarantee that the body diode always turns off.
In conclusion this a useful and elegant way to do level shifting of digital signals between circuits or ICs working in different voltage domains.