Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Is there any IC that interfaces any 3.3V Input/Output to 5V Output/Input? I need it primarily for an Arduino Due but if there any bidirectional IC that works like that it would be great.

Some people advised me to use the SN74AHC125 and CD4050 ICs, but I don't understand how they work or how to interface with them.

share|improve this question
    
You'd better provide info about why or how you don't understand how they work or how to interface with them... –  Dzarda Jan 28 at 8:49
    
What is the intended frequency range? –  alexan_e Jan 28 at 8:51
    
For example assume I want to connect 5V device to a 3.3V arduino. I couldn't figure out where to connect the 5V output and the 3.3V input. And what about output a 3.3V from an arduino for example to a 5V device ? What do you mean by frequency range ? –  3bdalla Jan 28 at 8:59
    
What will be he frequency of the signal you are going to transfer, it can be 10KHz or 100KHz or 1MHz... –  alexan_e Jan 28 at 9:07
    
I'm not sure that I got your point, I haven't dealt with frequencies before, my purpose is for simple electronics :| –  3bdalla Jan 28 at 9:15

5 Answers 5

up vote 11 down vote accepted

A very simple bidirectional level translator can be made with a single N-mosfet:

enter image description here

The mosfet used should be a model with a low Vgs threshold, so that it can have a relatively low Rds-ON (ON resistance) at the intended input voltage level (3.3v in this case).
BSS138 in one such example, it has a Vgs-th of 1.5v max and is specified to have a low drain-source resistance with Vgs voltages as low as 2.5v (maybe slightly lower too).

The shown example uses 3.3v <-> 5v translation but it can also work with 2.5v <-> 3.3v or 2.5v <-> 5v, even between 2.5v <-> 12v. The range is only limited by the characteristics of the mosfet used.

The shown circuit is based on an application note from NXP
AN97055 Bi-directional level shifter for I2C-bus and other systems
New shorter version: AN10441 Level shifting techniques in I2C-bus design

When L1 is high (3v3) or floating R1 keeps the mosfet off so R2 pulls the drain side high (to 5v).

When L1 is pulled low then the mosfet conducts and the drain becomes low.

When a low level (0) is applied to H1 then that voltage is transferred through the substrate diode to the source side (L1)

Please note that the resistance size can affect the speed (image source)

enter image description here

Alternative transistor solution enter image description here


Relevant articles you may find useful:

share|improve this answer
    
+1 Good ................................ –  Russell McMahon Jan 28 at 9:47

Another thing you should consider is whether you actually need level shifting at all. Many chips have 5V tolerant input pins even when running at a voltage lower such as 3.3. The atmega CPU also interprets anything above 0.6*Vcc or 3V for an arduino as a logic high, so a 3.3V signal can directly drive an arduino pin with no level shifting.

Assuming you are using a 5V arduino and need to talk to a 3.3V part, if the part has 5V tolerant inputs (many do nowadays), just connect em up and it will work. If your bidirectional line is an open collector design, such as i2c where the devices only pull the line low then just attach the pull up resistors to 3.3V instead of 5V and things will just work.

Otherwise all you need to do is make sure the line doesn't go above 3.3V, you can do that with a resistor and zener, put a resistor on the arduino line then a zener to clamp the voltage to 3.3V. zener resistor clamp

You may be tempted to live dangerously and just use the 10k resistor and nothing else. The reason this (sometimes!) works is that there is a clamping diode inside the recieving chip that shunts excess voltage to vcc or 3.3V. This diode will burn out if you try to pull the entire 3.3V line up to 5V through it (in addition to whatever damage caused by pulling that line to 5V), however with the resistor not much current will flow and assuming your 3.3V line has a non-trivial load on it it won't change the level of your power line substantially but there are lots of caveats. So, in general, don't do this unless you have a local, isolated 3.3V bus and really can't spare the extra two cents for the zener. I only mention it because you will see it in schematics for dirt cheap breakout boards you get on ebay and might be tempted to copy it, just don't let it sneak past the breadboard into a production design. :)

Edit just noticed you were using the newer 3.3V arduino, so just invert what I said above, the zener resistor trick will still work although apparently some of the i/o lines on the due may be 5v tolerant, there seems to be some disagreement on the forums. The teensy 3.1 is also a nice little ARM board that has all 5V tolerant pins and is less than half the cost of the due and better designed IMHO http://www.pjrc.com/store/teensy31.html

share|improve this answer

Since the question seems oriented towards an IC that provides bidirectional level shifting, consider the Texas Instruments TXB010x family of parts: TXB0102 has 2 channels, TXB0104 has 4 channels, and TXB0108 has 8 channels.

The stand-out feature of this family of ICs is that signal direction is automatically sensed, so a separate direction setting pin is not needed.

Switching speeds up to 10 MHz work reliably. The theoretical maximum speed may be higher - the datasheets are not explicit about this from what I can determine.

I have a TXB0108 working between a 3.6 Volt MSP430 Launchpad and a 5 Volt Arduino Nano, so the use case of the question is covered.

For the purposes of trying it out, Adafruit offers a prebuilt module incorporating the TXB0108, which saves you the trouble of soldering an SMD part. There may be similar options for the 0102 and 0104 from them or others.

8-channel Bi-directional Logic Level Converter - TXB0108

If the intent is to level-shift an I2C signal, which isn't ideally suited to the TXB series ICs, an option that specifically addresses the pull-up resistor and open collector topology of I2C is a module like this, again sold by Adafruit and other vendors.

I2C level shifter

This module uses BSS138 MOSFETs in the way described in the answer by alexan_e. While it is not a single IC such as the question asks for, it perhaps fulfills the intended purpose. Alternatively, it is simple to build this circuit yourself using MOSFETs.

share|improve this answer
    
+1 Nice find! ... Your link to TXB0102 is actually to the TXS0102. I haven't determined the difference, but this is noted in the datasheet of the TXS0102: "Its primary target application use is for interfacing with open-drain drivers on the data I/Os such as I2C or 1-wire, where the data is bidirectional and no control signal is available. The TXS0102 can also be used in applications where a push-pull driver is connected to the data I/Os, but the TXB0102 might be a better option for such push-pull applications." Here is the actual link to TXB0102 –  Tut Jan 30 at 12:17
    
@Tut Oops, slip-up, thanks. My own needs are met by the TXB0108, so the others are more of a "nice to know" for me. :-) –  Anindo Ghosh Jan 30 at 12:49

The most simple solution is to run all your circuits at 3.3V. HC chips will happily run at that level.

When that is not possible, you can make things much more simple when you restrict yourself to one direction. A HCT chip at 5V will accept 3.3V levels just fine, and a simple two-transistor divider can reduce 5V to 3.3V. Some uC are 5V tolerant on their pins, so you don't need the divider. And if you put 5V pullups on the pins, and switch between ground and open (=input), you have a passable 0-5V output.

For coupling open-collector busses (I2C, dallas 1-wire) the BS138 trick is a way to go. There are small chips for I2C that put the two FETs in one housing. (PCA9306 etc.)

But if you really want bi-drection level translation: such chips do exist, check for instance TXB0108.

share|improve this answer

Well, there are many. You need to specify what is your maximum frequency, how many bits you need, etc. In short, you can use any voltage level translator IC. Texas Instruments has a neat selection tool for the very same purpose: http://www.ti.com/logic/docs/translationresults.tsp?sectionId=458&voltageIn=5.0&searchDirection=2&voltageOut=3.3#voltintf

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.