Electrical – 3.3v to 5v conversion with non-5v tolerant part. (single npn transistor?)

3.3vlevel-shiftingnpnpnptransistors

I was wondering if I can convert 3.3v to 5v when the 3.3v part isn't 5v tolerant.

I was thinking of using this layout:
diagram with npn transistor

However I'm not sure if the gpio pin will get 5v "for a second" or if this is safe? Additionally, I'm not sure how to work out if 1MHz or 10MHz is possible here.

Would it be better to use a pnp transistor instead (SS8050?) so that the gpio could trigger the base directly?

If this is the wrong way to do this, is there a cheap unidirectional 3.3v to 5v converter IC which ideally has a schematic in Eagle?

EDIT: To clarify. I'm hoping to use the 5v to communicate with a shift register (which needs around 3.7v input minimum). Not to power the shift register.

Best Answer

A 74HC595 has the characteristics of 74HC logic families, and so has an input LOW maximum of 1.0V, and an input HIGH minimum of 3.5V.

So the circuit does need a signal level shifter to drive the 74HC595 inputs from a 3.3V GPIO.

However 74HCT will register a LOW at 0.8V, and a HIGH at 2.0V.

See table "Characteristics of Selected 7400 Series Families" at Wikipedia 7400 series for the signal thresholds.

A 74HCT595 would also run at 5V. Assuming your 3.3V device is CMOS, it will drive its GPIO outputs close to the power rails, about 0.6V LOW and 2.7V HIGH for modest current, so it has some headroom.

If you need to drive several inputs of the 74xx595 shift register, then the 74HCT595 would save a set of signal level shifting components.

If the extra cost of the 74HCT595 is an issue, you could use the fact that 74HCTxx logic inputs would work with your 3.3V while the outputs would drive a 74HC595. Effectively use 74HCTxx logic as a level shifter.

So, for example, a 74HCT04 hex inverter could be used to level shift 6 signals, which might be enough to interface to several 74HC595 shift registers. Hence, 6 sets of signal level shifting components could be replaced with a 74HCT04 plus a decoupling capacitor.