There are so many times when we want to connect two devices with different voltage values, mostly a 5V with a 3.3V. No matter it is a 5V Arduino device with a 3.3V sensor or a 3.3V ESP8266/ESP32 with a 5V clarkwise touch screen.
Normally if you connect a 5V signal to a 3.3V pin, there is a good chance that the 3.3V device is burnt or at least can’t working properly. So, how can we make them work?
Solution 1: A TTL coverter
There are some 5V<->3.3V TTL converter modules on the market, and they are at a very reasonable price.
These kinds of converters are capable of converting in high-speed communication like SPI. But you still need to read the datasheet before using it in your project. Especially about the speed and current sections.
Solution 2: A voltage divider circuit
Referring to the two articles on next-hack.com, there are quite some circuits that can do the job. They are great options when you don’t have a converter in your hands. All you need are resistors and diodes.
Of course, there are limitations, like the speed level probably cannot be as high as a TTL converter, but still can be a good emergency solution.
Since the clarkwise touch screen can’t communicate with ESP8266 directly in UART, we tested with the two circuits from next-hack. They are only use 2 x 4.7kOhm resistors and 2 x 1N4148 diodes.
And we made this:
We have tested this circuit for over 20 hours. It works very stable. Also, no matter the baud rate is 9600bps or 115200bps, it works the same.
If you are also facing the TTL problem, we are hoping this article could help you out.