Handling 3.3v to 5v Logic Level conversion

Most projects using a 5v Arduino board for robots are going to run into some 3.3v circuits at some point. This might be the serial line coming from a G1 Android phone or an inexpensive Bluetooth module. To deal with this properly you’ll want to be able to convert the voltage going in and out of the Arduino to work properly with these devices.

Let’s look at two options, starting with the least expensive, but more complicate method we started with in 2009. This involves using a $0.25 hex inverter chip such as an 74LS04 chip and two resistors. We used this to send the 3.3v signal from the phone into the chip, back out at 5v but inverted (0’s were 1’s and 1’s were 0’s), and then through again to come out properly at 5v.

Handling the 5v to 3.3v side of things is even easier with two resistors. We used a 20k and a 39k resistor as described here on Make Things, but we’ve also used a 1.8k and a 3.1k as described here. Both did the job just fine and made sure we didn’t fry our phone or Bluetooth module.

Two resistors to handle 5v to 3.3v

The above method has served us well but we’re moving on to using this $2 logic level converter from Sparkfun.

Logic level converter from Sparkfun

It supports two channels of conversion and we’re only using one so far. You simply connect it to your 3.3v and 5v power sources and it handles converting the signal in and out. You can use the Arduino for both power sources since they typically provide you one of each level, even though the RX/TX pins are always 5v. All you need is a little soldering when you get the board to connect the header pins and it will plug right into your breadboard.

Soldering the logic level converter circuit board

Some of you have pointed out that the Arduino will often treat as 3.3v RX serial input just fine. We’ve tested this as well and found it usually works. You’ll still want to lower the returning TX voltage going back down to 3.3v  to not damage your phone or Bluetooth module. To be safe though we recommend using the proper conversion each way to avoid headaches by eliminating the chances that something isn’t reading right.

We’ve posted some additional pictures of what we’re doing in our gallery and embedded it below for convenience. Read the captions to see what is going on in each shot and reach out to the Cellbots discussion group if you need a hand or want to share some tips of your own.

This entry was posted in How-To. Bookmark the permalink.

9 Responses to Handling 3.3v to 5v Logic Level conversion

  1. Pingback: Powering A Robot From The Phone’s Battery « Cellbots.com

  2. Maintain them arriving… a person just about all perform this type of congrats from this kind of Ideas… cannot let you know just how much We, for just one value whatever you perform!

  3. Pingback: Serial Communication Between an Arduino and the TL-MR3220 Router | hackup.net

  4. Tom says:

    Great stuff! Keep it up. I was just wondering how to connect my TP-Link MR3020 directly to Arduino. Will definitely get that SparkFun logic level inverter.

    I just need to think of something cool to do with my Arduino now that is has wireless internet access via OpenWRT/MR3020. This is cheaper and more interesting than the WiFi shield.

  5. GAurav says:

    Hii
    i have one problem. i have silicon lab microcntroller and its operate max. 3.3 volt and i interface microcntroller and LCD. but LCD switch on 5 volt. so which circuit or IC i m use. because 3.3 to 5 volt and 5 to 3.3 volt both i required at interface

  6. Oliver says:

    Regarding GAurav’s issue: A lot of 5v LCD modules will actually run from 3.3v, provided that a negative voltage is supplied to the bias pin. Also often the display is wired as write-only, in which case a 3.3v micro will drive a 5v display.

  7. goh says:

    Hi I need to do up a stepdown converter from 5v TTL to 3.3V TTL using logic level converter from sparkfun. I am using USB charger PSU and a adjustable PSU to supply 5v and 3.3v respectively. Equipment A will be supplying a 1PPS (5v TTL) then go through the converter to stepdown to 3.3v TTL to equipment B. Can you kindly provide me a connection diagram if possible and advice whether does the converter work.

  8. Thanks for your personal marvelous posting! I actually enjoyed reading it, you could be a great author.I will make certain to bookmark your blog and will eventually come back at some point.
    I want to encourage you to ultimately continue
    your great posts, have a nice day!

  9. Link exchange is nothing else but it is just placing
    the other person’s blog link on your page at proper place and other person will also do similar for you.

Leave a Reply

Your email address will not be published. Required fields are marked *