Single transistor voltage level shifter that you can actually make yourself

An experiment in making a helper circuit for communication between devices of different voltages.
May 17, 2022 — 2 mins read — Electronics

Single transistor voltage level shifter that you can actually make yourself

You probably have heard the saying that necessity is the mother of all inventions.

I was recently sent a GPS module to make a project with and when I started exploring the module, I immediately noticed in the datasheet that the module only worked with a voltage of 1.8V.

In terms of the module, this is all great because of its extremely low power usage, but for me, this was a problem because I don't have a microcontroller that operates at that voltage. My typical use of NodeMCUs and Arduinos only operate at 3.3V or 5V so connecting the GPS sensor directly to them would definitely damage it.

There are commercial ICs (TXS0108E) and modules that allow you to shift voltages for this purpose but at the moment I do not own any of them so I decided to give it a go and make a logic shifter with what I had on hand.

The module communicates over UART so, in order to be able to send proper commands and also receive data from it, we need to have a way of first lowering the voltage from 3.3V down to 1.8V, but we also need to do the opposite and step up the 1.8V to 3.3V so the NodeMCU can recognize it as a logical high.

In similar cases when we need to reduce some voltages, we can use a voltage divider. When connecting two same value resistors in series, the voltage at the midpoint will be exactly half of the input voltage. Since our input voltage is 3.3V, the midpoint will be at around 1.65V which is close enough for it to be considered a logical high.

Now, for the other part of the communication, we need some sort of an active circuit that can output a higher voltage than what we have on the input. I found online that a typical circuit for this purpose is done with a BSS138 N-channel MOSFET, but, yet again, I did not have that MOSFET on hand so I decided to try and replicate the circuit by using a 2N2222 transistor.

To my surprise, the circuit worked without any issues and I was also able to make a module for it on a piece of perfboard to make it more permanent. You can see the full test and build video below.

Tools and materials used in the video:

i2c soldering prototype uart
Read next

I failed to repair a stud finder from the flea market

In this video, I'm attempting and failing to repair a stud finder that I found at the flea market. This post is sponsored b...

You might also enojy this

Introducing the ATtiny Device PCB - I2C slave devices

Ever since I started playing with Arduinos and microcontrollers, I was always fascinated by one very specific chip.The Attiny85!Attiny85I kn...