How do I use a 3.3v micro with 5v signals & transistors?

I need some help with a gap in my electronics knowledge.
How do I use a 5v signal as input to a 3.3v micro controller, and inversely how do I switch a transistor with 5v load, from the same micro's output pin? (@3.3v)?

Can I just use a suitable resistor on the input pin, and for the output can I simply drive the 5v transistor with 3.3v at the base?

orksecurity6 years ago
(Whups, I misread this initially as 5v power source rather than 5v input. As the others have said: buffer chips.)
I'd've suggested CMOS, but they will be waaaayy to slow for modern devices, especially at low supply volts.
MANY processors are "5v" tolerant on their inputs and outputs, so check for that.,
BEWARE issues of noise margin when you are working with conversions - you'll see some grim hacks that use resistors etc for hacky interfaces.

You can maintain noise margins if you use 74HCT vith 5V Vcc for conversion from 3V3 to 5V. To convert inputs from 5V to 3v3 there is the 74LVC4245. The 74LVC4245 can be used in the other direction as well.