How to Level Shift 5V to 3.3V

In this tutorial, I show how you can shift a signal from 5V to 3.3V. This is very useful if you want to connect an Arduino (operates at 5V) to an ESP8266 (operates at 3.3V).

The following Figure describes what we want to accomplish by the end of this tutorial.

FEATURED level shifter - Copy

Method #1 – Voltage Divider

Warning: This method works for slow signals, but it’s not very reliable. I recommend using Method #2.

A voltage divider is a simple circuit which reduces a large voltage into a smaller one.

Using 2 resistors and an input voltage, we can create an output voltage that is a fraction of the input. Below you can see the formula that you need to use to calculate the resistors that you need in your circuit:

voltage divider equation

Solving the formula above with Vin=5V, R1=1000ohms and Vout=3.3V.

This is our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks!  SIGN UP NOW »

This is our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks! SIGN UP NOW »

We get R2~=2000ohms.

voltage divider

So, here’s how the final circuit looks like:

voltage divider circuit

Method #2 – Bi-Directional Logic Level Converter

A Bi-Directional Logic Level Converter (LLC) also reduces the voltage from a signal. This the recommended method to level shift signals that require high speed communication (serial at a high baud rate, I2C, etc…).

You can check this page to find the bi-directional logic level converter module best price.

12009-06

You simply connect the signal with the High Voltage to the HV pins and it outputs the signal with the lower voltage on the other side (LV). With the board shown in the Figure above you have 4 channels available.

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Download our Free eBooks and Resources


Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »

Learn how to program and build projects with the ESP32 and ESP8266 using MicroPython firmware DOWNLOAD »


Enjoyed this project? Stay updated by subscribing our weekly newsletter!

11 thoughts on “How to Level Shift 5V to 3.3V”

  1. …or method 3 – cheaper and more elegant if moving from bread-board to say prototype or strip board – using a couple of resistors and a mosfet.

    Schematics here: i.imgur.com/RdGAN6D.jpg

    Feel free to use. Enjoy your work – it is a great help for the Arduino beginner. Though (*cough*) I’ve spotted the odd programming error here and there that a C newbie may not be able to fix.

  2. In fact, the recommended level converter board is just the same resistor divider, only using 10k and 2x 10k resistors, therefore even slower than your 1k/2k divider due to the RC constant of parasitic capacitances of wires, breadboard etc. Those two transistors are there only to shift up. It is the worst converter board you can find on eBay. You can buy better, bidirectional (suitable for I2S) for the same price.
    Will work OK for common UART bitrates, but not good enough for high speed protocols.
    For SPI and other higher speed protocols I recommend to use a proper buffer/driver level shifter IC.

  3. Im using level shifter on a turbidity sensor and esp32. It gave me only 4095 readings. I knew that the sensor is ok because id already try it in arduino uno.. We all know that esp32 only accepts 3 v as input. Whats the problem with the level shifter or how can i fix it?

Leave a Comment

Download our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.