2
\$\begingroup\$

Before doing any mistake, can you confirm me that it is not possible to connect directly UART pins of Arduino UNO on UART pint of ESP32 ?

I see on the datasheet a voltage of 3.3V. I would like to make communicating both boards by TX/RX pins.

Thank you,

\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

You should use a level converter (also called level shifter) from 3.3V to 5V (and around). These devices are bi-directional.

You connect:

  • 3.3V to the LV (Low voltage) pin
  • 5V to the HV (High Voltage) pin
  • RX of the ESP to A0, A1, A2 or A3, e.g. A0
  • TX of the ESP to A0, A1, A2 or A3, e.g. A1
  • RX of the Arduino opposite of the TX of the ESP, e.g. B0
  • TX of the Arduino opposite of the RX of the ESP, e.g. B1
  • Connect the GNDs, for clearity better put them on the same row (ESP next to A4, Arduino next to B4).

See bi-directionional-logic-level-converter-hookup-guide for more details.

enter image description here

\$\endgroup\$
6
  • \$\begingroup\$ Thanks a lot for your useful answer ! A bridge with a voltage divider could it be another solution to convert voltage ? \$\endgroup\$ Commented Nov 2, 2018 at 17:16
  • \$\begingroup\$ That will work too, however, I doubt you can make it much smaller (unless you use also SMD components), you can get a cheaper one from AliExpress high likely if cost is an issue. Also if you look at the circuit, a MOSFET is used, which makes the low/high voltage completely independent from each other. \$\endgroup\$ Commented Nov 2, 2018 at 17:24
  • 1
    \$\begingroup\$ Actually, even a divider made of through hole resistors would be smaller than the usually sold 4-channel MOSFET boards... and a lot more likely to be sourceable without placing a new parts order by an experimentor. And it's worth keeping in mind that these MOSFET boards usually rely on a 10K pullup, so they are only more firm in driving low, not high. While they can be used in some UART applications, their real reason for existence is I2C. \$\endgroup\$ Commented Nov 2, 2018 at 19:26
  • 1
    \$\begingroup\$ Thank you both of you for your help ! It is really helpful. \$\endgroup\$ Commented Nov 3, 2018 at 11:08
  • 1
    \$\begingroup\$ one more thing: Arduino reads 3.3 V as HIGH. so only the RX of esp needs protection by logic level conversion from 5 V of Uno to 3.3 V of esp \$\endgroup\$ Commented Nov 3, 2018 at 15:36
0
\$\begingroup\$

Arduino with 5 V AVR MCU reads 3.3 V as HIGH. But the RX of the 3.3 V MCU's RX pin could be damaged by 5 V TX of the 5 V MCU. A voltage divider will do it.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.