Esp8266 Simple 3.3v to 5v level conversion

I'm thinking that the output of an esp8266 can upshifted to drive a 5v device input with a simple series diode and resistor to a 5 V supply. That would mean the esp8266 would see about 4.4v on it's output pin. Supposedly the esp8266 pins are 5V tolerant so I assume this is workable.

I know it's not the best solution, but I am low on PCB space and I think I can squeeze this in. I'd probably use a 10k pullup with the diode as the switching frequency is below 1000hz.

Any comments are welcome.
Thanks,
Frank

1 Like

How many signals to be modified thusly?

Do you really need to shift the voltage up to 5V if the input being driven is digital ?

What is the voltage threshold for a signal to be regarded as HIGH on the input pin ?

What is the input, exactly? There may be other options.

  • For 3V to 5v, you can’t get much smaller than a SN74AHCT1G125 SOT23-5

  • I also use the SN74AHCT1G08 SOT23-5

IMG_3113

Is this for hobby stuff, or for a device that has to work reliably for 20+ years.
Leo..

Thread DOA. Oh well.

Wow, thanks everyone for the replies. I’ll try and answer all of the questions raised in this note.

  1. The minimum high level for the chip I’m driving is 3.15v, maximum low level is 1.35v.
  2. There are 3 inputs that I have to drive.
  3. The chip is a stepper motor driver and is described as a CMOS device and the only input impedance spec I could find says max 20ua leakage.
  4. It’s not really for hobby use, there will be maybe 20 or so units made for other people.
  5. I’m not sure what the “DOA” comment refers to.

I have been driving this chip on a couple of devices without any level shifting for about 4 years. Lately I’m seeing some intermittent operation that I’m guessing is related to the poor driving logic level voltages. I am aware of logic level chips that can handle multiple channels and can save space for many circumstances. However, these chips necessarily concentrate a lot of circuit tracks to themselves. In my already crowded PCB design that would be tough to accommodate. Alternatively diodes and resistors can be distributed over some small existing spaces and they can bridge over existing tracks to some extent.

I suppose the primary issue depends on the supposed fact that the esp8266 chips are indeed 5v tolerant. Are there any other issues?

Thanks,
Frank

BTW, I found this suggestion below that clamps the voltage seen by the esp8266 at maybe 3.9v. But it requires another diode that I would like to avoid.

image

Do you have a part number.
If the logic part of that chip can be powered from 3.3volt, then you won't have to level-convert.
Leo..

I would think of a transistor and two resistors. No idea how much space it will need.

It will invert the signal which might or might not be an issue.

BSS138, one resistor.
Gate to 3.3volt, source to ESP output, drain pulled up to 5volt with 1-10k resistor.
Does not invert.
Leo..

1 Like

They aren't. The datasheet allows for Vcc + 0.3v as it's maximum rating.

I have used single gates similar the ones shown in post #5.
I still have a few 74LVC1G32 SOT-353, which do the trick.

A simple NPN transistor connected to one of the non-strapping pins will also work just fine, though generally slower.

There are also really small mosfets available.

If the data sheet says 3.3V or 5V I tend to keep to it, so I use level conversion.

My way is the same as @Wawa's, except I currently use a AO400 - got quite a few free from a kind friend. Works well.

I'd diagnose that properly if I were you!

Shall we have a look at it? The best solution really would be to properly shift up to 5V logic level. Several suggestions have been offered in this thread already. They don't take up much space. Odds are there's some space that can be made on your board by optimizing the design a bit.

Ok, you guys have convinced me to do it right. I think I’ll try Wawa’s mosfet technique as that also only uses two components.
My big problem is my poor knowledge of PCB design tools so keeping changes to a minimum is desirable. Not to mention soldering some of the small surface mount IC’s is a challenge for my old eyesight.

I’ll keep some of the other suggestions in-mind for any future new designs. BTW, there seems to be a lot of credible message board chatter that the esp8266 I/O is 5V tolerant, but it’s not clear if that applies to output or if it’s just input pins. Anyway if the datasheet doesn’t say that I guess it should be avoided.

Here’s a diagram from Microchip’s tips and tricks pdf that looks like Wawa’s solution. I’ll have to see if I have an appropriate mosfet.

Thanks, everyone for the great help.
Frank

Some CEO had mentioned on facebook that they are that statement has been retracted. They are not, they may break, as far as i can tell it's mainly exposure to 5v while in output mode and HIGH (3.3v) even with current limitting resistors. But if you want to minimize chances of something breaking (and i've thrown quite a few of them) Avoid 5v exposure at all times. The datasheet is quite clear about it being a maximum of Vcc + 0.3v as a maximum.

What is 'credible message board chatter' anyway ?

That is always a challenge, but thank the lord for magnifying glasses.

@frank2644 see this publication for a good explanation of the level shifter technique using a FET.

  • Please show us your board layout ? :thinking:

Also, when selecting the N-channel FET, select a FET that has a lower
Vgs threshold voltage than the Voh of 3.3V output.

You may find one with a max Vgs(th) of only 2.5V but that does not guarantee a low Rds(on) at 3.3V

Also if you pick one with an min Vgs(th) that is too low, Vol may not be low enough to turn it off.

More great replies thank you,

First I’ll look through my supply of small signal Mosfets and hope one of them satisfy’s the specs I need. Otherwise there were a couple of Mosfets mentioned on this thread that I’ll look to buy.

As requested, here is my PCB layout. I use EasyEda which I found to be quicker to learn then others I looked at. I still struggle as may be evident in the layout below. I'm not sure if anyone can make sense of this layout, but you asked for it. The level shifting involves the pins in the lower left side where the stepper driver IC (U5) is mounted on the back side of he PCB.

Thanks again,
Frank