Level shifter 5v supply - Page 1
Forum section: electronics / beginners

author: scarr999
author_rank: Contributor
timestamp: April 11, 2022, 12:44:36 pm
content: Hi,Siure this is a quite one for someone, looking for a 5v powered bi-directional level shifter 5v one side 3.3v on the other.Thanks

author: Zero999
author_rank: Super Contributor
timestamp: April 11, 2022, 03:24:39 pm
content: https://shop.pimoroni.com/products/sparkfun-logic-level-converter-bi-directional?variant=7493045377

author: AndyC_772
author_rank: Super Contributor
timestamp: April 11, 2022, 05:15:07 pm
content: https://www.ti.com/logic-voltage-translation/voltage-translators-level-shifters/direction-controlled/products.html

author: scarr999
author_rank: Contributor
timestamp: April 12, 2022, 07:40:19 am
content: Sorry, didn't clarify I ideally want a single 5v supply IC that is bi-directional between 3.3v and 5v saves me adding a 3.3v reg as the 3.3v device is powered from 5v but is only 3.3v tolerate on the I/O lines.ThxSteve

author: RoGeorge
author_rank: Super Contributor
timestamp: April 12, 2022, 08:00:48 am
content: Bi-directional level shifter for I²C-bus and other systems - PHILIPS AN97055https://cdn-shop.adafruit.com/datasheets/an97055.pdfSimilar idea works with bipolar transistors, too.http://www.hagtech.com/pdf/iic.pdf

author: kjr18
author_rank: Regular Contributor
timestamp: April 12, 2022, 08:04:24 am
content: I don't think you will find something like that, closest to what you need would bethis module.. I think that depending on your needs it will be cheaper and easier using an LDO, than using something else. If your device uses 5V as supply voltage but needs 3,3V on data pins then it should have it's own LDO. Would it be possible to take it out from it to use for level shifting?

author: AndyC_772
author_rank: Super Contributor
timestamp: April 12, 2022, 08:11:22 am
content: Quote from: scarr999 on April 12, 2022, 07:40:19 amThis sounds... unexpected. It would help to see the relevant portion of your schematic.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2022, 09:49:53 am
content: Also we need to know Vih.minof the 5V logic level device. The easiest option to avoid much asking of questions and waste of time is to give us part numbers (and preferably datasheet links) for both devices, and if there's more than one signal involved, a schematic of their interconnects.http://www.catb.org/~esr/faqs/smart-questions.html

author: scarr999
author_rank: Contributor
timestamp: April 12, 2022, 12:42:50 pm
content: Hi,Atmega328P to IoD-09THhttps://uk.rs-online.com/web/p/lcd-colour-displays/1647079Thx

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2022, 01:05:51 pm
content: ATmega328P Vih.minis 0.6 x Vcc, which is 3.0V @5V Vcc, so you may not need level shifting (but only 0.3V margin isn't good for EMI resistance). Series resistors + precision clamping to 3.3V on the IoD-09TH side may be sufficient. Unless this is a low power design, I would suggest a TL431 to shunt regulate the clamping rail.OTOH if you do need 'real' level shifting we'd need to know what signals are involved, and how fast they are.

author: Peabody
author_rank: Super Contributor
timestamp: April 12, 2022, 02:30:30 pm
content: The datasheet for the IoD-09 says it uses a nominal 5V supply, but requires a minimum of 4V. So is it the Atmega328P that's running at 3.3V? It seems you could just run everything at 5V.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2022, 03:02:30 pm
content: Its ESP8266 based with an in-module 3.3V regulator so I *ASS*U*ME* the 5V device is the ATmega328P . . .

author: Zero999
author_rank: Super Contributor
timestamp: April 12, 2022, 04:18:09 pm
content: A BJT will work in both directions, although the hFEis lower in reverse, but that doesn't matter with this circuit. The base is biased to just above 3.3V, by R1 & R2, to the emitter floats are just over 3V. When IO1 is pulled low, current flows through R1 to Q1's base, turning it on and pulling IO2 to 0V. When IO2 is pulled low, Q1's bas-collector junction acts as a diode, pulling R2 to 0.6V, but the voltage on IO2 is even lower. The small parasitic capacitance on IO1 will discharge, as Q1 will work in reverse.

author: Peabody
author_rank: Super Contributor
timestamp: April 12, 2022, 04:54:44 pm
content: Quote from: Ian.M on April 12, 2022, 03:02:30 pmYes, I didn't read far enough. All of the I/O pins are 3.3V. So maybe the ATmega328P could be run at 3.3V. Anyway, I just have no good experience trying to do bidirectional level shifting, and always ended up makng each line unidirectional.

author: tepalia02
author_rank: Regular Contributor
timestamp: April 26, 2022, 01:44:01 pm
content: https://www.waveshare.com/logic-level-converter.htmhttps://www.sparkfun.com/products/12009

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 26, 2022, 01:50:23 pm
content: TXS0108E

author: Terry Bites
author_rank: Super Contributor
timestamp: April 26, 2022, 05:24:26 pm
content: https://www.ti.com/logic-voltage-translation/voltage-translators-level-shifters/direction-controlled/overview.htmlhttps://www.ti.com/product/SN74LXCH1T45something here?

author: kjr18
author_rank: Regular Contributor
timestamp: April 27, 2022, 01:21:19 pm
content: Atmega328p can run on 3.3V just fine, but only at 8MHz. What are you going to use? SPI, I2C or serial? How about using one of these transistor based boards and using one of unused IoD-09TH pins set to provide 3.3V for level shifting? You don't need much current for this?

author: Ian.M
author_rank: Super Contributor
timestamp: April 27, 2022, 02:20:34 pm
content: OTOH those 'transistor' (actually MOSFET) level shifter boards (based on the classic Philips I2C level shifter app note) are actually fairly useless for fast signals. They typically have 10K pullups either side of the MOSFET which interacting with the MOSFET gate and Miller capacitance results in rather slow risetimes. As-is, its probably usable for a few tens of Khz signals without grossly excessive duty cycle distortion, or with much lower pullups e.g. 1K you can push it to a few hundred KHz. Don't expect it to 'play well' with fast SPI!Have a play with this LTspice sim which shows a 3.8us risetime on the 5V side just due to the MOSFET miller capacitance without any additional wiring capacitance

author: Zero999
author_rank: Super Contributor
timestamp: April 27, 2022, 02:56:28 pm
content: Quote from: Ian.M on April 27, 2022, 02:20:34 pmA MOSFET is a type of transistor, so the name is correct.The BJT circuit I posted is faster, even with the resistor values I posted above. Reducing them makes it faster.

author: Ian.M
author_rank: Super Contributor
timestamp: April 27, 2022, 03:17:17 pm
content: Yes, 'transistor' is correct for both but as their characteristics are notably different, its worth recognizing the distinction between BJT and MOSFET level shifters.I've modded your sim to use my switched sources (tristatable push-pull output equivalent) for test signals , at ten times the speed, and changed the R3 pullup to 10K, to enable an 'apples to apples' comparison with my MOSFET sim. Its also worth noting that if you have a 3.3V rail available the R1:R2 potential divider can be replaced with a single resistor, giving your circuit the cost advantage as well as the speed advantage.

author: Zero999
author_rank: Super Contributor
timestamp: April 27, 2022, 05:38:34 pm
content: The original poster needs it to run offa single 5V supply. Either way, small BJTs are cheaper than the 2N7000, so my circuit has a cost advantage, regardless of whether two or three resistors are used.Heck, use a digital transistor which costs the same as an ordinary BJT and only two or one resistor(s) need to be added, depending on whether a 3.3V rail is available, or not.https://uk.rs-online.com/web/p/bipolar-transistors/0287667

author: Ian.M
author_rank: Super Contributor
timestamp: April 27, 2022, 05:46:54 pm
content: Thanks for reminding me of the single supply requirement. That makes the MOSFET version even less attractive as it requires a fairly 'stiff' 3.3V rail. If using a potential divider its going to need good decoupling on the tap, as even 1K Thevenin equivalent resistance will make the edges *fugly*.