I've got a project that involves a 5V Arduino and a Raspberry Pi Zero (3.3V) that need to communicate through a serial interface. The easy solution here would be to connect them through USB, but I'll be using an Arduino pro mini type board, which does not have a USB to serial adapter and thus does not have USB. So I'll be connecting them directly, but I've heard the Raspberry Pi does not like getting 5V through its serial pins, which means I've got to have a level shifter (at least on the Arduino tx to Pi rx line).

I have a few hex non-inverting buffers (the CD4050BCN), and from what I understand, if I have VDD set to the Pi's logic voltage (3.3V), it will only output a maximum of 3.3V. Then I can connect the Arduino's tx pin to VIN of the non-inverting buffers to ensure the output will be 3.3V at most.

Am I not understanding part of this? I just want to make sure--I don't have much knowledge of electronics past basic microcontroller wiring.

  • \$\begingroup\$ How fast will you be operating the serial interface. It's kind of important to know. Also, are the lines unidirectional? Or will any of them be bidirectional for any reason? Finally, this kind of question has been answered a million times on the web, if not a billion -- it's a really, really common need. Have you looked, already? Finally, do you know the absolute maximum specifications for the protection diode currents in the Raspberry Pi Zero? \$\endgroup\$
    – jonk
    Jun 28, 2020 at 2:39
  • \$\begingroup\$ I have updated my answer, please check it before implementing the hardware. It is important to add a similar voltage divider on the Pi Tx line. \$\endgroup\$
    – paki eng
    Jun 28, 2020 at 4:34
  • \$\begingroup\$ There are a lot of ways to solve this. Your CD4050BCN should work. The voltage divider answer will also probably work assuming you are just using a normal baud rate like 115200 baud. It is possible to add "speed up" capacitor in parallel with R1 to maintain higher signal bandwidth. \$\endgroup\$
    – user57037
    Jun 28, 2020 at 5:22

1 Answer 1


Use a voltage divider from Arduino Tx to Pi Rx like this. You can connect the Pi Tx to Arduino Rx directly.

Important Update: Connect a similar voltage divider on the Pi Tx - Arduino Rx line also. This is necessary to protect Pi in case of accidental 5 V on the Arduino Rx pin (due to bug in code etc.). I have updated the circuit.


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I have high confidence it will work. Please try this solution and share the results in the comment. If it works fine, please select my answer as the correct answer. \$\endgroup\$
    – paki eng
    Jun 28, 2020 at 2:51
  • \$\begingroup\$ Alright, I'll try this in a week or so once i have everything setup, thanks. \$\endgroup\$ Jun 28, 2020 at 4:16
  • \$\begingroup\$ Not seeing how the protection works. If Pi Tx is 5V, R4 won't help. R3 will limit the current and may provide some protection. A small capacitor in parallel with R1 may help preserve bandwidth. Like somewhere between 2pF and 22pF. You can fine tune it with an oscilloscope. If you get voltage overshoot use a smaller capacitor. \$\endgroup\$
    – user57037
    Jun 28, 2020 at 5:26
  • \$\begingroup\$ @mkeith This is to protect Pi (3.3 V logic) from the wrath of Arduino (5V logic). If Arduino pin has 5V, the voltage dividers will only allow 3V on the Pi pins. When the Pi sends 3.3 V on the pins, it will reach unharmed to the Arduino (albeit a bit loaded). The OP intended to use the circuit with serial port, so I assumed the maximum frequency may be 115.2 kHz. This kind of frequencies don't require any special considerations, so I tried to keep as simple as possible while still providing the intended functionality. \$\endgroup\$
    – paki eng
    Jun 28, 2020 at 13:35
  • \$\begingroup\$ Oh, I was thinking backwards. I thought you had the divider the wrong way around but I was the one who was wrong way around. I agree that the speedup cap may not be needed for 115200 which is the fastest normal baudrate. But if a speedup cap can be added the resistor divider could maybe be increased to reduce loading. Just a suggestion. \$\endgroup\$
    – user57037
    Jun 29, 2020 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.