Last chance to enter The Hackaday Prize.

Level converters to make all your hardware (5.5V and under) play with each other


I finally set aside some time for one of my own projects. I have been playing around with ARM microcontrollers a lot lately and wanted to try out my GLCD display that uses the KS0108 protocol. It’s 5V but I had heard that some of these displays will work with 3.3V TTL. But the datasheet tells me otherwise. I tried using a pull-up resistor to 5V and configuring the Stellaris Launchpad pins to open drain, but the low voltage wasn’t getting below the 0.3V threshold needed by my display. My only choice was to use some type of level conversion. I actually ended up driving the KS0108 using a pair of TXB0108 level converters.

I figured this had to have been done before so I check over at Sparkfun. Their offerings are either one-way or have a direction pin that you must drive yourself. I figured there had to be a bi-directional solution and a search over at Mouser led me to the TXB0108. It is exactly what I was looking for and as you can see I etched my own circuit boards to make the TSSOP chips breadboard compatible. I’ve documented the process you can find the code and board files at my post linked above.

Update: one of the Reddit comments mentions this chip is available on a breakout board from Adafruit if you’re interested.


  1. thegraynomad says:

    For my money the TXB series are only way to fly when it comes to level conversion.

  2. raer says:

    Depends on whether you have I²C, SPI or whatnot.
    There’s also resp., which might be much easier…

  3. jgmrequel says:

    In addition to Adafruit’s breakout board for the TXB0108, they also carry a breakout board using FETs ( It’s intended for I2C level conversion, since the TXB/TXS series direction sensing can get confused with the inclusion of pull-up or pull-down resistors (found that out the hard way). I’m still learning about this topic; in one project I have an Arduino TFT LCD shield at 5v, a Teensy 3.0 at 3.3v and a color sensing chip (TCS34717) which communicates over I2C at 1.8V. That being said, for most applications, if you can get the connections right the TXB/TXS series is definitely the way to go.

    • squalyl says:

      Texas Instruments have a very flexible I2C level converter in SOIC8 : the PCA9517 , also made by NXP, it seems.

      • jgmrequel says:

        That chip looks like a good packaged solution, although I am a bit more partial to the ‘simplicity’ of the FET design. I’m still trying to find some reasonable solutions to High Speed (3.4 MHz) I2C though, since neither the chips discussed or the FET solutions work well there.

    • signal7 says:

      I’ll second this post. The FET based solution has been around for many years and seems to work well. I even built a version of this for a breadboard by soldering wires onto surface mount FETs I had on hand in the parts bin.

  4. Jonnyw2k says:

    Can you clarify the bit about the 0 ohm resistor between PD and PB

  5. Phrewfuf says:

    Bidirectional Level-Converters with autosensing are a bit slower, you can’t go high speed with them. Texas Instruments has a big range of products there (surprise) and i got myself some of those with direction pins for use with SPI (µSD-Card to Atmega32u4) which would not work properly with autosensing converters.

  6. Karl says:

    I’ve been using the TXS0104E from TI for a while now to nterface between 5V & 3.3V.
    The SO14 package makes it easy to flywire to if you need to.

  7. Whatnot says:

    I’m continuously surprised about how little and uninteresting projects with ARM based boards are, it’s all things you could do with an arduino or even an atiny.

    But then I realize I myself also lack in the imagination department sand I’m all understanding again.

    It’s frustrating though. I like to be awed more :)

  8. Chris C. says:

    [Mike Szczys], regarding this:

    “But I still get some garbage on the display from time to time. This can usually be fixed by straightening out the jumper wires, which is what makes me thing it is a cross talk problem.”

    Could be. Another possibility is that some of your breadboard or female header connectors aren’t making a decent connection, which I find more common in recent years as both become more cheaply made. Rearranging wires can make it better (or worse), as it changes the tension on the connection.

    Fortunately, you don’t need an oscilloscope to diagnose this. Attach a 2.2K resistor across the terminals of a piezo tweeter. Output a steady, active logic high (or low if needed) at the source on all signal lines you want to check. Connect one terminal of the piezo to a signal destination, and the other terminal to ground (or VCC, if the signal is driven low). Wiggle the wire and connector. You’ll be able to hear the slightest fault as a crackle. Repeat with remaining signals.

    Piezo tweeters are very useful as cheap test equipment. Connected between VCC and GND (without the resistor of course), I’ve also used them to find locations where supply rails sag, and need additional bypass capacitors. And tracked the source of noise in an audio circuit to a poor switching power supply. I can hear fluctuations as small as 10mV in a quiet room, with the tweeter near my ear. In some cases, it will also reveal issues in digital signals, especially repetitive ones; for example, glitches or jitter in a PWM signal are easily heard.

  9. zlittell says:

    This is a good example of why you should go to Adafruit first next time.

  10. trottz says:

    And here I just do it with some 2N7000 transistors and a few resistors because I’m a uncreative bastard who hates SMD.
    An example of it:

  11. Pleiades says:

    I’ve used these before, they’re cheap ($0.48) 20pin DIP and have worked for my needs.

  12. Bracken says:

    I’ve got the original MSP430 launchpad at 3.3V driving a string of WS2801 LED drivers running at 5V. Out of spec but it will run fine at 4Mhz (not 8,certainly not the 25 from the datasheet). Hooray for de-rating.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 91,108 other followers