Projects > Hardware Projects >

Bidirectional Logic Level Shifter using 2N7000


Yesterday I was trying to interface a Nokia 5110 LCD module I bought from InkOcean with my Arduino Uno. But then I realized that the LCD module works with 3.3V instead of 5V. Luckily Uno has a 3.3V output which can be used to power the module. But that alone isn't the problem. The control and data pins also work at 3.3V and has a maximum limit of 3.6V. I could still connect the module directly to Arduino using some series resistors. That would work. But it'll reduce the life of the LCD. I didn't want to do that.

One solution is to use voltage dividers to level down the 5V to 3.3V. For example using 4.7K and 10K resistor pair. I had tried this with an original Nokia 1100 LCD I salvaged from an old phone. I was using a breadboard then. But it's not a good idea to set up voltage dividers in breadboard especially if you have a voltage sensitive device. That is the most probable reason why I destroyed the Nokia 1100 LCD. Yes it stopped working just after I successfully displayed some text on it.

So I decided to not to make that mistake again with this new LCD module. What I could do was to buy a Bidirectional Logic Level Shifter module from any online store. Then I realized that such a module doesn't use any hard to find parts. It just uses N-MOSFETS that are designed for logic level applications. Below is typical configuration used in many available level shifter modules.


Logic Level Shifter


It uses BSS138, N-MOSFET and two 10K pull up resistors. LV = 3.3V and HV = 5V. If you make the LV1 low, the HV1 will also become low and vice versa. Here's the link to the logic level shifter from SparkFun and hookup guide.

But I didn't have the time to buy one. So I decided to build one myself. I used 2N7000 N-MOSFET for my design. It's a small signal FET, but enough for our application. The schematic is similar to the above, but just replace the BSS138 with 2N7000.


Level Shifter



I made a six channel one and used SMD resistors, also salvaged. It has total of 14 pins; 6 for 3.3V inputs, 6 for 5V inputs, 1 for 5V supply and 1 for 3.3V supply.


Level Shifter Schematic



I soldered all components to a general purpose board and tested with my benchtop PSU. It worked fine.


Level Shifter Board


Level Shifter Board



Note that the low side input voltage must be smaller than the high side voltage; means do not apply 5V to a 3.3V input pin. This could damage the FET. I damaged one accidentally. That's why there's one missing in the above picture. I didn't have a replacement then. There's a possible alternative configuration using a single 5V supply with the addition of a 100K resistor.


Level Shifter Schematic



One thing to note is the transition time. Although the above circuits will work fine when you check with multimeters like I did, that doesn't have to be the case when you interface it with a circuit that requires level shifting. The resistors and long wires may affect the transition time of digital signals (square wave) going through. This could have a deleterious effect on some device interfaces. The longer the current path and any devices in series with it, longer will be the delay. You need a DSO/CRO to get a clear understanding of the effects. I don't have a DSO, so I couldn't check it. I hope you could :)

There are dedicated level shifter and buffer ICs that could be used for this application. Some are,

  1. SN74LVC125 - Quadruple non-inverting 3-state buffer with Vcc = 3.6V and 5V tolerant inputs.
  2. 74LVX245 - Octal non-inverting bidirectional buffer with Vcc = 3.6V and 5V tolerant inputs.
  3. HEF4050B - Hex non-inverting buffer with Vcc = 3-15V and high voltage tolerant inputs.