henradrie
Posts: 7
Joined: Wed May 09, 2018 1:58 pm

favorite replacement for 8-channel Bi-directional Logic Level Converter - TXB0108

Wed Jul 04, 2018 1:49 am

We need to use a pi to communicate with component that runs using 5V logic. So we bought this level shifter https://www.adafruit.com/product/395 . Unfortunately it didn't work, most likely because the component had a higher load than the level shifter could match.

We are looking for another level shifter, it doesn't have to be bidirectional. One chip we are considering is https://www.adafruit.com/product/735.

I'm sure it will work but does anybody have any favorites they would like to recommend?

JohnsUPS
Posts: 267
Joined: Fri Jul 06, 2018 2:13 am
Location: USA

Re: favorite replacement for 8-channel Bi-directional Logic Level Converter - TXB0108

Tue Aug 14, 2018 12:32 am

In the past, I purchased several 4 bit bidirectional level shifters, all nice surface mount assemblies, but they were not very reliable. Instead, I have opted for a larger through-hole solution. It may be a bit more work if you need to shift many lines, but I have found the simple level shifter made from a 2N7000 and two resistors to be robust and reliable. Easy to breadboard and you have control over the pullup resistor values.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: favorite replacement for 8-channel Bi-directional Logic Level Converter - TXB0108

Tue Aug 14, 2018 1:26 am

henradrie wrote:
Wed Jul 04, 2018 1:49 am
We need to use a pi to communicate with component that runs using 5V logic. So we bought this level shifter https://www.adafruit.com/product/395 . Unfortunately it didn't work, most likely because the component had a higher load than the level shifter could match.

We are looking for another level shifter, it doesn't have to be bidirectional. One chip we are considering is https://www.adafruit.com/product/735.

I'm sure it will work but does anybody have any favorites they would like to recommend?

Logical Level Shifter/Converter

I have tried more than 10 kinds of logical level converters and found that every kind has its pros and cons. Below are my general suggestions. If you can give more details of your requirements, I might give more specific recommendations.

Requirements:

  • 1. Direction low to high or high to low or both
  • 2. Dirve light load or heavy inductive load, or long wires (over 20m)
  • 3. OE (Output Enable)or not, low or high level OE
  • 4. Channel number 1, 2, 4, or 8
  • 5. Open drain or push/pull or both
  • 6. Through hole DIP, or SMD assembled module
  • 7. Single or dual power supply
  • 8. For I2C only , SPI, or UART (5V TTL), or all in 1.
  • 9. Max data rate (TxS0108E can do 100Mbps push/pull, or 1Mbps open drain, but only between PCI/PCI/E boards
  • 10. Max distance (I2C at 100kHz/400kHz, over 1 meter, you might need an extender, such as P82B715)
  • 11. Many more requirements I forgot. ;)
What I have tried or hope to try include the following:

  • 1. 2N7000 mosfet (dual power 3V3/5V0, one channel)
  • 2. 2N2222 open drain (single 3V3 power, one channel)
  • 3. HC03 open drain (single 3V3 power, 4 channel)
  • 4. MCP23S 08/17, MCP230 08/17 GPIO port set to open drain (single 3V3 power, 8 or 16 channel)
  • 4. HC14 schmitt inverter (single 5V power, 6 channel)
  • 5. HC125/HCT125 (dual 3V3/5V0 power, 4 channel with OE)
  • 6. TXS 02/04/08 (B or S type, dual power)
  • 7. ULN2803 (4 channel sink driver, with flyback diode)
  • 8. UDN2981 (4 channel source driver, with flyback diode)
  • 9. CD4049 (single (3V3) power supply (input 5V tolerant), high to low (5V to 3V3) inverting 25mA 6 channel)
  • 10. LVC245 (Vcc 3V3, down shift only, input 5V tolerant, 8 channel)
  • 11. A couple of more good, bad, or ugly ones I forgot. :)
Warning: I am only an electronics hobbyist, doing Micky Mouse DIY weekend/midnight projects at home, and started playing with 3V3 5V0 level shifting just some 4 years ago. I have not completed any project using level translation.I already fried one Rpi3 so far this season. So I don't guarantee that my suggested circuits won't generate burning smell, black/white smoke, fry a Rpi, or explode! :mrgreen:

My favourites

HCT125 and HC14 are my favourites. But wiring and soldering HCT125 is very messy. I attach such a messy wiring picture below.

Appendix - Some of my old posts on level shifting

(General) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-14
viewtopic.php?f=37&t=77158&p=1328090&hi ... r#p1328090

(HC14) RE: RELAY MODULE KY-019 5V -tlfong01 2018-Jun-23
viewtopic.php?f=37&t=77158&p=1332349&hi ... #p1332019

(HCT125) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-14
viewtopic.php?

viewtopic.php?f=37&t=77158&p=1328090&hi ... r#p1328094

(HC03) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-15
viewtopic.php?f=37&t=77158&p=1328090&hi ... r#p1328534

(2N2222) RE: RELAY MODULE KY-019 5V Post tlfong01 » 2018-Jun-15
viewtopic.php?f=37&t=77158&p=1328090&hi ... r#p1328573

(HC03 + HC04 as source driver) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-15
viewtopic.php?f=37&t=77158&p=1328090&hi ... r#p1328588

(ULN2803 sink driver UDN2981 sourc driver) RE: RELAY MODULE KY-019 5V Postby tlfong01 » 2018-Jun-15 Fri 5:06 pm
viewtopic.php?f=37&t=77158&p=1328090&hi ... r#p1328604

(TXS0104E) RE: RELAY MODULE KY-019 5V Post by tlfong01 » 2018-Jun-15
viewtopic.php?[/color]f=37&t=77158&p=13 ... r#p1328676

My Level Shifter Story - tlfong01 2018May5

There are many ways to do level shifting. I first learnt the idea from NXP.
https://www.nxp.com/docs/en/application ... N10441.pdf

I assembled a I2C level shifter using 2N7000 and I was happy to complete my first mosfet project.

Logical level shifting using HCT125 -Adafruit has a good tutorial, and rpi example.
https://www.adafruit.com/product/1787

I have been using HCT125 in some of my project, using 4 chips to up shift 16 rpi gpio pin signals. You can use OE to disable and mux to as many pins as you like. But the wiring is a bit messy.

Logic Level Up Shifting using HC04
Different approaches have different pros and cons, and you need to make an engineering tradeoff, or cost benefit analysis. If you wish to control 128 relays placed far far away, I2C MCP23017 is good; if you want to Mux/OE (Output enable/disable) the relay modules, then HCT125 is good; if you wish to up shift to different levels (not just 3v3 to 5v0, but 3v3 or 5v0 to 12/24/36V, then HC04 Quad Open Drain NAND gate is good. I tried HC04 the other day for a 817c photocoupler driven relay module and found it working OK.

Up shifter using 2N2222
And if you want to entertain only one relay module, then the 4 shifters in 1 chip HCT125/HC04 is a waste or overkill. Then you may consider single transistors (such as BJT NPN 2N2222, MosFet 2N7000). I tried 2N2222 the other day and found it OK.

.END
Attachments
bbLySl7[1].jpg
bbLySl7[1].jpg (109.16 KiB) Viewed 2180 times
Last edited by tlfong01 on Wed Aug 15, 2018 6:18 am, edited 7 times in total.
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: favorite replacement for 8-channel Bi-directional Logic Level Converter - TXB0108

Tue Aug 14, 2018 10:01 am

JohnsUPS wrote:
Tue Aug 14, 2018 12:32 am
In the past, I purchased several 4 bit bidirectional level shifters, all nice surface mount assemblies, but they were not very reliable. Instead, I have opted for a larger through-hole solution. It may be a bit more work if you need to shift many lines, but I have found the simple level shifter made from a 2N7000 and two resistors to be robust and reliable. Easy to breadboard and you have control over the pullup resistor values.

TX S/B 02/04/08 Reliability Problem

I had the same problem with surface mount assembled bidirectional level shifter modules. Some years ago when I first learned how to do level shifting, I read the NXP tutorial and started with 2N7000 and found everything OK.

I was too lazy to solder more boards with two 2N7000 and two resistors. So I bought some assembled no brand SMD modules. I guess those no brand modules also use MOSFETs similar to 2N7000, but as you experienced, I did not find them reliable.

Then I tried assembled modules with labelled ICs, such as TXS02/04/08, and TXB02/04/08 etc. I found 08 versions not reliable. But 02/04 are OK. So I have been using 02/04 for some time, without any problems.

My quick and dirty conclusion is that TXS/B/02/04 in open drain mode are OK for I2C 100 kHz, with wires shorter than 30cm, but usually not be reliable for push/pull mode applications.

It is only a couple of days ago I learnt that I2C wires can not be longer than 6 inches or so, or you might have transmission problems, and that I can use something called I2C extender to solve the problem. I just ordered some such I2C extenders and would try them soon.
I am an electronics and smart home hobbyist.

Return to “Interfacing (DSI, CSI, I2C, etc.)”