Become a subscriber (Free)

Join 29,000 other subscribers to receive subscriber sale discounts and other free resources.
Don't worry -- youre-mail address is totally secure. I promise to use it only to send you MicroZine.

How to make your own logic level Converter

This page is all about logic level converters that allow you to easily change between different logic voltage levels.

You know when you just bought that nice shiny new chip to play with, you get it in the post and only then do you think: What about voltage levels? Then you see that the new chip only works at 3V3 and the only microcontroller you have works at 5V! See this project for an example of using the logic converter circuit.

Logic Level Converter using resistors

First of all you think that's easy, I'll just use a voltage divider tro drop the high side voltage to 3V3 and problem solved. Maybe it is, but if your device is an I2C device (where you need bidirectional communication on the data line), using a divider on the high side won't allow the voltage to go the other way at a reliable level.

The solution is to use a level converter which only requires a MOSFET, and two pull up resistors.

This method uses a MOSFET and relies on the parasitic diode between Source and Drain (this is usually a problem rather than a benefit!), to allow full bidirectional communication with low and high side voltages. The operation is explained below.

Logic Level Converter using MOSFET

This is a very useful bit of electronics that also happens to be extremely simple, but extremely clever. It lets you easily convert between different voltage level systems using only a simple enhancement mode logic level MOSFET and a couple of 10k resistors.

Note: The actual voltages used can be anything that the MOSFET is specified for - but there will be a voltage drop across the parasitic diode of 0.7V to be accounted for (low-side to high-side drop).

Since the 10k resistors pull up inactive lines, they have to charge any stray capacitance so for fast speed use 1k resistors. The rate of voltage rise will therefore be faster.

TIP: For faster operation reduce the pull up resistor values.

MOSFET Level converter diagram

2N7000 pinout

2N7000 pinout

MOSFET level converter circuit

Logic Level Converter Operation

wrt = with respect to.

High side '1'

When the high side outputs a '1' (5V) drain and source are pulled towards the high voltage so the source is high wrt. gate (reverse Vgs voltage) so the MOSFET is off so the low side pullup is active and pulls the low side to 3V3.

Note: This action also happens when the high side is tristated (the pullup pulls the high side to 5V anyway - this is why I2C interfaces work.

High side '0'

When the high side outputs a '0' (0V) the source is pulled low wrt gate, so the gate is higher than the source and the MOSFET is on (Vgs is positive). The MOSFET then conducts the zero through to the low side pulling down the low side.

Low side '1'

When the low side outputs a '1' (3V3) the gate source voltage is zero so the MOSFET is off. The high side pullup is active and pulls the high side to 5V.

Note: This action also happens when the lowside is tristated (the pullup pulls the high side to 3V3 anyway - this is why I2C interfaces work.

Low side '0'

When the low side outputs a '0' (0V) the gate source voltage is 3V3 and the MOSFET is on. The MOSFET then conducts the 0V through to the high side pulling down the high side.

Note: It is up to your program to decide when to switch from driving the output connected to the high side to becoming an input. For I2C there are defined time periods for this to happen.

Level converters and SPI

For a 4 wire SPI interface there is no bidirectional requirement (data out: SDO, and data in: SDI use separate pins) so you could use the divider method and that requires 3 dividers with a total of 6 resistors.

Note: Data in from the low side driver is usually high enough in a 3V system to signal a logic one to the 5V high side.

To go from 5V to 3V needs a resistive divider with 22k and 33k (which drops the output to 3V) (or you can replace the 33k with 39k for a drop of 3V2 (for a 3V3 system).

A 3 wire SPI interface requires a bi-directional data I/O conversion - the data I/O pin uses bi-directional signals.

New! Comments

Have your say about what you just read! Leave me a comment in the box below.

Privacy Policy | Contact | About Me

Site Map | Terms of Use

Visit our Facebook Page:

   Click Here

  1. How to use the ADXL345 for movement sensing and more.

    With the ADXL345 acellerometer you can detect up to 16g! You can also find out how to use it for tap detection and more.

    Read more

  2. How the HMC5883L 3-axis digital magentomter works

    HMC5883L - How make a digital compass, Find out the differences between the HMC5883L and the QMC5883L and whether they are compatible.

    Read more

  3. ESP8266 Arduino IDE setup.

    Easily use an ESP8266 with the Arduino IDE and program your first sketch into the ESP8266

    Read more

  4. How to use the MCP4725, a versatile and tiny (SOT-23-6) analogue output device

    The MCP4725 chip is a 12 bit DAC with memory that outputs voltage that you can use for many dfferent purposes. Find out what they are in this page.

    Read more

  5. PCF8591: An 8 bit ADC you can easily connect using I2C

    PCF8591: A four input ADC with single DAC. How good is this 8 bit ADC, and should you use it in your next project?

    Read more

  6. How to use an arduno Nano as an ISP (In System Programmer)

    Arduino Nano ISP: How to program an ATmega328P using an Arduino Nano as the ISP programmmer. One common problem: Programming a sketch into the chip without a reset control - solved here.

    Read more

Readers Comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's


- Ranish Pottath

"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan


"Awesome site,
very, very easy and nice
to navigate!"

- Matt

Learn Microcontrollers

"Interested in

Sign up for The
Free 7 day guide:


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."

- Dave


"Your site is a great
and perfect work.

- Suresh


"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.

- Anon

Back to Top