Arduino to NodeMcu wiring

Hello, I'm trying to get serial communication from arduino to nodemcu. I'm wondering that given that the arduino runs off 5v and NodeMcu runs off 3V, if this particular wiring is safe between the RX and TX ports? If not, could I be directed to a safer hookup between the RX and TX pins? much appreciated.

This wiring was taken from this tutorial; Serial communication between NodeMCU and Arduino - Iotguider

Upon further research, it looks like I'll be needing a logic converter. I think I understand how to work one, but I'll send through a wiring diagram shortly to confirm.

I would connect the NodeMCU via a software serial port on different pins to save the hardware serial port (pins 0 & 1) for program upload, monitoring program flow and variable values (debugging).

Besides following groundFungus's suggestion, you can make a simple level shifter with 2 10k ohm resistors in series between arduino softserial TX and gnd. Have esp RX connected between the resistors. Then esp TX directly connects to arduino softwareserial RX. Don't use very long wires and you can go up to 115200 baud with this.

liuzengqiang:
Besides following groundFungus's suggestion, you can make a simple level shifter with 2 10k ohm resistors in series between arduino softserial TX and gnd. Have esp RX connected between the resistors. Then esp TX directly connects to arduino softwareserial RX. Don't use very long wires and you can go up to 115200 baud with this.

thank you for the suggestions, I think I'll just stick with the logic converter for simplicity though

Ok is this the correct way to hook up the logic converter between the boards? thank you!!

logic converter.JPG - Google Drive

I don't know. What exact level converter is that? any link?

jtardu:
This wiring was taken from this tutorial; Serial communication between NodeMCU and Arduino - Iotguider

Well, that just shows how dangerous "helpful" articles on the Internet are. :roll_eyes:

For at least one version of that "logic level converter" you indicate, the conversion from 5 V to 3.3 V actually is no more than the two resistors liuzengqiang cites but with different values, so saying "for simplicity" is somewhat nonsensical.

A significant problem is that you are proposing to connect the primary serial ports of the two boards together. For each board, these ports are already connected to a USB interface chip, by 1k resistors in the Nano and 470 Ohm on the NodeMCU. These resistors will load down whatever you use to connect the boards together and the particular "logic level converter" may not reliably drive them.

As explained, it is generally not necessary to convert the 3.3 V to 5 V level for the Nano as the latter will accept 3.3 V logic and a direct connection will overcome the 1k resistor. In the other direction, a diode with cathode to Nano TX and anode to NodeMCU RXD will drive it perfectly well using the 470 Ohm resistor in series with the USB chip as a pull-up.

One single diode as the level converter. :sunglasses:

The overarching question is if you have a NodeMCU which is a substantially more powerful processor, why would you even want to use a Nano at all? :astonished:

Seems to me that you can use a 1k/2k voltage divider, just like you would/should with Bluetooth.

Diode is simpler! :sunglasses:

liuzengqiang:
I don't know. What exact level converter is that? any link?

https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide

Here's the converter. judging by the hookup diagrams, I seem to be correct

Nick_Pyner:
Seems to me that you can use a 1k/2k voltage divider, just like you would/should with Bluetooth.

Aah ok thank you. just checked out a few diagrams, seems a lot simpler. that's what I'll do!

Paul__B:
The overarching question is if you have a NodeMCU which is a substantially more powerful processor, why would you even want to use a Nano at all? :astonished:

I'm hooking up a current sensor to an arduino, and the data is sent to the nodemcu. The nodemcu also has quite a few other functions, which get slowed down significantly when I run the current sensor on it as well. :slight_smile:

OK, that logic level converter is quite suitable.

I suspect the 1k/ 2k voltage divider will not work in this situation as 1k and 2k in parallel is 666 Ohms. :roll_eyes:

The diode would be the proper way.

Paul__B:
OK, that logic level converter is quite suitable.

I suspect the 1k/ 2k voltage divider will not work in this situation as 1k and 2k in parallel is 666 Ohms. :roll_eyes:

The diode would be the proper way.

i see, thanks mate.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.