There will be occasions when you need to interface with 5-volt devices from your Raspberry Pi's 3.3-volt GPIO pins. This interfacing may be for the purpose of GPIO input, output, or bi-directional I/O. The technique used to convert between logic-level voltages is known as logic-level conversion or logic-level shifting.
There are a variety of techniques that can be used to shift voltages, and we will cover two of the more common ones in this section. One uses a voltage divider circuit, which we discussed under the previous heading, while the other uses a dedicated logic-level shifting module. Our first example of logic-level conversion will be to look at a resistor-based solution known as a voltage divider.