Interfacing NodeMCU ESP8266 with Arduino Uno

Hello everyone!
It can be said that i am pretty new to Arduino and hardware as it is. Guys, I need your help!
Short background:
I decided to do an IoT project for school that measures the gas concentrations with MQ-XX sensors, then sends the data to ThingSpeak or database in order to be stored and analyzed... (Not the point of this topic)
However I decided to use Arduino Uno and I needed a Wi-Fi connection to send the data (obviously). I bought an ESP8266 NodeMCU: (At the time I did not know that it can be used as micro-controller itself and is even more powerful than ArduinoUNO)
But that does not matter right? it can be still used as just a Wi-Fi Module?

I am having a very HARD time wiring up the nodeMCU and Arduino together. Looked on every possible website but nothing eventually helped.


So you have a clear picture, this is my hardware and how I tried to connect it in the first place.
Everything works, except the communication between NodeMCU and Arduino.
I even flashed the NodeMCU with AT commands (It was flashed with NodeMCU firmware).
Now, when i connect to the NodeMCU directly with USB, I can send the AT commands through serial monitor and it works (I can even connect to my wifi...)
But because I want to use it just as a Wifi Module, I want to talk to it via Arduino Serial communication (Send AT commands via Arduino for example) And THIS does not work.
I tried several connections, as on one website it was said to connect tx-tx and rx-rx and on another tx-rx and rx-tx. In another example someone used a level shifter. I bought one but it did not work with it as well.

  1. Is it possible that I am using too much hardware and Arduino cannot power the ESP8266?
  2. Do I need the level shifter and how should be the connection?
    https://www.instructables.com/Get-Started-With-ESP8266-Using-AT-Commands-Via-Ard/
    I tried this tutorial and did as it said but it did not work. The AT command did not even appear on the serial monitor when I sent it.
  3. How to deal with the RESET pins of the esp as well as of the Arduino? Do i need first to set the RESET pin of Arduino Low? I am really confused. :confused:

So I am trying to use the NodeMCU just as a connection to WiFi and try to configure it via Arduino. It should be possible right?

Thank you very much for any answer!


this is the one I am using (could not paste more than one file)

wire transmit to receive. TX to RX

You have a nodemcu. It's not programmed with the AT deal, so that tutorial is not applicable. The nodemcu is programmable via the arduino IDE.
Focus like a laser beam on communications (hello world from nodemcu turns on uno LED; goodbye world turns it off).

I flashed it with AT commands and it is responding to it when I connect it directly with my PC and start the serial monitor.
What do you mean with:

??? I do not understand what do you mean by that

Sorry I said anything.
Best of luck.

That's right. Early projects were a nightmare because the esp (a 3.3V device) has to be connected to something like an Uno (a 5V device), which requires level shifting, the esp has to be powered correctly, often requiring extra voltage regulator circuitry, and then there are the difficulties of communicating between the Arduino and the esp, which is done with serial communications, and most Arduino have only one hardware serial port which is dedicated to sketch upload and serial monitor, so software serial had to be used instead, bringing it's own problems, and then there is the AT command set which is not easy to use...

Then there was a breakthrough that made everything so much easier. Some clever guys worked out how to use an esp as an arduino, so you didn't need an Arduino as well as the esp. all those problems above went away.

It's still not perfect. Esp are 3.3V device and some sensors and displays are only compatible with 5V, but you can usually avoid those and find 3.3V compatible replacements. And esp only has one analog input. But there are ways to add more, for example using analog multiplexers or i2c modules to add more analog inputs.

My suggestion would be to remove the Uno and program the esp directly with the Arduino code. Because you need 3 analog inputs for your sensors, get an ads1115 module, or maybe a 74hc4051.

You need to think about power for those gas sensors. They contain heaters, so can consume a lot of current. Why are you using 3 anyway?

1 Like

Thank you so much for your answer and suggestions!
I am afraid I cannot afford to change hardware and speculate how to interface it from the beginning. I am very short on time :frowning:

Because they detect different types of gases and I wanted the values to "calculate" the Air Quality index.

But is there a way how to do it with the hardware I have? So you are basically saying that the arduino is "exhausted" and is not able to provide enough power to the esp?

I think you missed my comment

You are right! I missed it. Thank you! I tried it once but it did not help. Fortunately, now it works!
However, I had to connect the ESP to my laptop via usb. Now I am using the code from the tutorial I mentioned above and opened two instances of Arduino IDE to see both serial monitors. It works (see screenshots)

Arduino port
NodeMCU port

It does not work when the ESP is not connected to my laptop.

power the Nodemcu with 5 V to Vin

I tried a direct connection from Vin to 5V of Arduino. I also tried a direct connection from 3V3 (NodeMCU) to 3V3 of Arduino. It seems that the nodemcu does not receive any power.
Should the GND, RST and EN pins of the NodeMCU be wired? and how?
I just have GND to GND but i am not sure with the other two

don't wire RST or EN

Ok, thanks. It does not work anyway though :frowning:

do you know that the power rails of the long breadboard are split in the middle?

1 Like

Unfortunately, I did not know that :smiling_face_with_tear:. I cannot believe that it was such a dumb error. I am ashamed of myself...
Anyway, thank you very much Juraj!

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