Step up 3.3V to 5V for digital I/O
Since Dave Tweed has pointed out the flaw in the other answer, I have basically copied my answer to Single transistor level up shifter ... Note also the interesting solution by Nicolas D in the question.

I have a few solutions (some solutions provided by Microchip HERE):


Direct connection: If Voh (high-level output voltage) from your 3.3V logic is greater than Vih (high-level input voltage), all you need is a direct connection. (it is also required for this solution that Vol (low-level output voltage) of the 3.3V output is less than the Vil (low-level input voltage) of the 5V input). This solution is most often rejected due to insufficient margins.
If the above conditions are close, you can often boost the high-level output voltage slightly with a pull-up resistor (to 3.3V) and direct connect the signals.
The pull-up resistor can provide a small amount of high-level voltage increase. For more, you can use diodes and pull-up to 5V. The circuit shown will not pull-up clear to 5V, but it will increase the high-level input voltage to the 5V logic by the amount of one diode voltage drop (appx 0.7v). Care must be taken with this method that you still have a valid low-level as that is also raised by one diode drop. Schottky diodes may be used for a slight increase in high-level voltage while minimizing the undesired increase in low-level voltage. Refer to the above mentioned app note for more on this circuit.:








simulate this circuit &ndash; Schematic created using CircuitLab


If you can deal with a logic inversion (and don't require active pull-up), a mosfet and pull-up resistor may be used:








simulate this circuit


There are also many logic ic solutions such as: MC74VHC1GT125 which is a "Noninverting Buffer /
CMOS Logic Level Shifter with LSTTL−Compatible Inputs" in a SOT23-5 or SOT-353 package. Small simple and fairly inexpensive. Use of this solution should also include a decoupling capacitor close to the IC.