Go Down

Topic: 5v to 3.3v level shifter IC in DIP format (Read 36436 times) previous topic - next topic

pgmartin

I've been looking on the internet for simple through hole ICs for level shifting, from 5V to 3.3V, and I found lots of info but I'm pretty sure there is a lot of crap circuits and solutions around.
I bought the 74HC245, just to find a couple of Google searches later that it is not the best solution. Now it looks like the 74HCT4050 is a sure thing, but I wasn't able to find it in local shops.

I want it to interface Arduino with SD cards, accelerometers and such stuff, using soething "better" than just a resistor divider. What are the bes solutions?
Regards

dhenry

Philips has an application note on this very topic. Google Philips i2c level shift.

The best level shifter is to not do it.

Riva

Could you duplicate the Sparkfun version https://www.sparkfun.com/products/8745 using through hole components?
Don't PM me for help as I will ignore it.

Far-seeker

#3
Sep 28, 2012, 09:30 pm Last Edit: Sep 28, 2012, 09:33 pm by Far-seeker Reason: 1

Could you duplicate the Sparkfun version https://www.sparkfun.com/products/8745 using through hole components?


That shouldn't be difficult, the board is just an N-channel MOSFET and biasing resistors for each direction.  Getting two of an appropriately rated transistor in through-hole packaging might require going to one of the larger electronics suppliers, but that's not a problem.

Edit: Sorry, I initially overlooked the implication that you wanted a local source.  I don't know how it is in Argentina, but I imagine through-hole MOSFETs are still more likely to be available than specific ICs in the local shops.  

dhenry

Quote
Could you duplicate the Sparkfun version https://www.sparkfun.com/products/8745 using through hole components?


Yes. The sparkfun version is one implementation of the Philips bi-directional level shifter. It does have specific requirements on the devices - but none requires smt parts.

pgmartin

Thanks Riva, this is great. I'll have to do some research to find a suitable THT replacement for the BSS138.

Maybe the 2N7000 (like here http://husstechlabs.com/support/tutorials/bi-directional-level-shifter/). The Gate Threshold Voltage 0.8  - 2.1 - 3 (Min - Typical - Max). It's not as good as the BSS138 but it might work (if I can get them here, shouldn't be that complicated), is that right?

If someone knows an IC that solves the problem, it would be much easier. Don't now if the 74HCT4050 or the CD4050 are adequate.


Tom Carpenter

I use the TXB0108 as it is very versatile. Granted this is in a tiny TSSOP package, but there are breakout boards which bring out the pins into what is almost a dip package (it is actually 0.5" across not 0.6" like a standard wide format DIP package, but for most cases this doesn't matter), such as this one:
http://www.adafruit.com/products/395 .
~Tom~

Osgeld

Quote
If someone knows an IC that solves the problem, it would be much easier.


the 74HC4050 does exactly what you want

Quote
but I wasn't able to find it in local shops.


and thats why local shops suck, they are great to poke around, and maybe chit-chat, buts its guaranteed they never have what you want, go online, and find some other crap you need to justify the shipping charges and get what you need, rather than rolling your own out of transistors. Which btw, is better than resistors, but still not all that great.
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

dhenry

Quote
is that right?


Yes. It will work. And even a regular mosfet will work; or a NPN transistor in place of the mosfet, plus another resistor and an optional diode, will work as well.

And if your signal is active low (aka i2c or rs232), a resistor + a diode will work as well.

Docedison

The NXP (Phillips) app note AN10441 (attached) is a really great and simple/inexpensive Bi-Directional level shifter for IIC or SPI level shifting. The BSS138 is used in the adafruit  level shifter... I've built 2 Level Shifters using a 2N7000 for the Fet (2 required) and 2 pull-ups each for the 5V and 3V3 sides are also necessary but those are necessary anyway you try it. I would also recommend 1K (3V3) and 2K2 ohm (5V) pull-ups as the small amount of extra bus current will help the noise immunity of the bus as well..

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

pgmartin

Thanks Docedison. I´ll be buying the 2N7000 to buils it.

Regards.

Docedison

There is an alternate method with some extra parts and NPN transistors (2 1n4148's and a 3K3 resistor) I simulated it after having given it a day's thought and it worked (Valid Simulation) when I ran it through Multisim 11, as did the Mosfets, the diodes take the place of the Mosfet's "Body Diode" and the resistor is to set the base bias.
The level shifters are modeled after a TTL Gate input...

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

raschemmel

Thanks for the input.
I need a 3.3V to 5V level translator from my Adafruit thermocouple breakout bd and my Ruggeduino because
it doesn't work well with a 3.3V level input. My Genuine Arduino UNO and my Sainsmart UNO-R3 (has 3.3V-5V logic
Select Switch !) both work fine but not the Ruggeduino. Don't know why. 
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Tom Carpenter

presumably the resistance of the ruggeduino protection circuits drag the logic level down to below the threshold of the pins.
~Tom~

MarkT



I bought the 74HC245, just to find a couple of Google searches later that it is not the best solution. Now it looks like the 74HCT4050 is a sure thing, but I wasn't able to find it in local shops.

HC series is not level shifting, they have full protection diodes on the
inputs - trying to feed them 5V signals whilst powered from 3.3V will pull the 3.3V
rail up to 4.5V or so and probably damage something...

HCT series can only be used to raise 3.3V signals to 5V, they must be powered at 5V.

The LVC family are 1.6 to 3.3V powered and 5.5V input tolerant, although I can't recall
if they are readily available in DIP.  74LVC245 gives you 8 buffers from 5V -> 3.3V, but
can't map the other way (though you don't normally need to, Arduinos should read 3.3V
as HIGH).
Quote

I want it to interface Arduino with SD cards, accelerometers and such stuff, using soething "better" than just a resistor divider. What are the bes solutions?
Regards


Better means what exactly?  You do need fairly low impedance resistor dividers because
SDcards need fast edges, I've used 1k/2.2k before, but that's rather marginal for 8MHz
SPI.   

For I2C bus you just put pull-up resistors to 3.3V, it should just work (if the I2C
driver correctly uses open-drain).  True open drain and open collector outputs will drive any voltage from any voltage, Arduino I2C bus isn't true open-drain so you have to limit
the output to 5V.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up