NodeMCU ESP8266-12E and Arduino

Hello,

I'm trying to create an authentication system using an RFID reader, a keyboard and a server over the web which will do all the processing. The issue is that I got myself an NodeMCU ESP8266-12E and I can't seem to find a way to connect it to the Arduino. I would like to use the NodeMCU as a simple wifi adapter for the arduino. I know that I can program the esp itself, but I'd rather do everything from the Arduino. Is that doable? Can anyone share some insights?

Thank you.

silviub:
The issue is that I got myself an NodeMCU ESP8266-12E and I can't seem to find a way to connect it to the Arduino.

I'm not at all surprised. Connecting the two introduces quite a number of unnecessary problems, inducing level conversions, committed pins, serial buffering and having an efficient communications protocol. It is something far better avoided.

silviub:
I would like to use the NodeMCU as a simple WiFi adapter for the Arduino.

That is a bit like using a Semitrailer to deliver Uber Eats. :astonished:

If you have a NodeMCU, there is clearly no need for an Arduino.

If the RFID reader is a MFRC522 then it is a 3.3. V device as is the ESP8266 so you avoid the interface problems you would encounter if you want to connect it to an Arduino.

Suggest you sit back and take a sensible approach to this and "lose" the Arduino. :roll_eyes:

https://www.arduino.cc/reference/en/libraries/mfrc522/

"This library is compatible with the avr, megaavr, STM32F1, teensy, esp8266, esp32, samd architectures. . ."

The issue is that the NodeMCU doesn't have enough pins. I'm having a keyboard which uses 7 pins, an LCD display (it will use i2c in the future), the rfid reader and 3 buttons. This is why I want to use the Mega to gather all the data (keypass, rfid tag ID and data, button states) and to show a message on the display + light up some LEDs.

So, how are people connecting Arduino Mega to the internet? :smiley:

I started writing some code on the ESP and communicate with the mega over serial, but it's something I'd avoid if possible.

silviub:
I'm having a keyboard which uses 7 pins, an LCD display (it will use i2c in the future), the rfid reader and 3 buttons. This is why I want to use the Mega to gather all the data (keypass, rfid tag ID and data, button states) and to show a message on the display + light up some LEDs.

Are you using a 4x3 keypad? Save some pins, wire the buttons as a 4th column of the keypad, wiring the buttons between the 4th column pin and the row pins.

Since you intend to use an I2C LCD display, use PCF8574/PCF8574A I/0 expanders to interface the keypad (see the I2CKeyPad library ) and the LEDs. That would allow you to run everything off the NodeMCU.

The interface between an Arduino and NodeMCU is usually a serial connection, using the NodeMCU as a simple wifi connection and doing all the processing on the Arduino. Since the Arduino is 5 volt and the NodeMCU is 3.3 volt, there should be a level shifter on the Tx line from the Arduino, a simple resistor voltage divider will work. No need for a level shifter on the NodeMCU Tx to Arduino Rx.

Hello,

Thank you for your suggestions. Still, why is everyone pushing to a single nodeMCU instead of it being used as an adapter?
I mean, how is people using ESP8266 with all the above I mentioned, for example? What do you do if you don’t have enough pins on the esp (nodemcu or other) and need to use an arduino mega / uno?

I have connected the TX of the Arduino to D1 and the RX of the Arduino to the D2, using a software serial on the ESP. No voltage divider. It’s working for the last 3 - 4 hours. Do you think that long term will cause some damage? Is there any ESP8266 dev board that uses 5V?

Thank you.

“Still, why is everyone pushing to a single NodeMCU. . .”

You didn’t mention all of the other stuff till later (Reply_4).

silviub:
Thank you for your suggestions. Still, why is everyone pushing to a single nodeMCU instead of it being used as an adapter?

Because it gives you vastly more WiFi capability, is easier to code, avoids many interfacing problems, is cheaper and more compact.

silviub:
I mean, how is people using ESP8266 with all the above I mentioned, for example? What do you do if you don’t have enough pins on the esp (nodemcu or other) and need to use an arduino mega / uno?

There should never be any need to use something as clumsy as an Arduino Mega or UNO. :astonished:

You use I2C “port expanders” as explained by David, to interface other things such as keyboards or LCD displays. I2C requires only two pins, so you can build a whole system around an ESP-01(S) which has only four I/O available, :sunglasses:

silviub:
I have connected the TX of the Arduino to D1 and the RX of the Arduino to the D2, using a software serial on the ESP. No voltage divider. It’s working for the last 3 - 4 hours. Do you think that long term will cause some damage?

This abuse of the ESP is a longstanding point of heated discussion. Some suggest that the ESP can tolerate it, others not.

silviub:
Is there any ESP8266 dev board that uses 5V?

No, apart from the input to the regulator, since the ESP is a 3.3 V device. :roll_eyes:

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