ESP8266

Hi guys,
I'm new to this forum and Arduino technology.
Firstly i'm a web application developer but i'm learning Arduino.
Now coming to problem.
I've been using nodemcu to communicate with the server and i wrote a menu driven program using 4*4 keypad where you have to choose the numbers for further process like customer care (Press 1 or this, press 2 for that, blah blah blah). It works fine. But now i want to attach the RC522 module. Even the RC522 is also working properly. But if i add both the RC522 and keypad to the nodemcu, i don't have enough pins. So i thought of working with some board that have more Digital pins, after googling i came to know about Mega boards, but mega boards doesn't have inbuilt WiFi like nodemcu. So after googling i came up with esp8266(ESP-01) module and i bought it. Now i'm able add the keypad and RC522 to the mega and it works fine. But when i add the esp-01, the port section of the IDE becomes disabled. So i googled it and tried every method but its not working. Then i tried it with UNO board, same things happening. Then i saw a video where the guy suggests to remove the micro-controller, then upload it, some suggests while uploading make the esp rx-tx as parallel, after uploading change it. I'm really getting confused. I tried serial communication between nodemcu and mega, its working, but i want to use only one development board i.e mega board. So can you suggest me what should i do to make this thing working

you remove the MCU if you want to use only the USB chip. it is a workaround if you don't have an USB-to-TTL-Serial adapter. (it is not necessary to remove the chip, only the sketch should not use Serial.begin())

you can:

  • add an i2c module for more pins
  • use an esp32 for your project.
  • throw away the keypad and make a webpage accessible from a smart phone or tablet

Hi Juraj thanks for replying
add an i2c module for more pins -> How to do that? please provide me some tutorials
throw away the keypad and make a web page accessible from a smart phone or tablet -> can't do that, because i want to make a menu driven program. Actually i'm making an rfid controlled door, and i don't want to open the door by using a web page every time. I'm using the nodemcu because i just want to store how many times the door is just opened. I planning to add a LCD also. But i'm out of pins, that's why i opted for mega board & esp8266, Another option is to display the message using serial communication from nodemcu to uno/mega where the LCD will be connected to the uno. but for that i'll have to use 2 development boards, but i want to achieve this using 1 development board i.e mega. so how to make client server communication using esp 01 & mega. & 1 more thing The code is already written for nodemcu, can i use the same code in mega board by changing the pin nos? I'm asking this because I'm not comfortable with AT Commands

Look for port extenders. Lots of tutorials out there. PCF8574 and MCP23017 are two commonly used parts. Alternative (even cheaper parts but takes one more pin) is to use shift registers for this, such as the 74HC165. A bit more of a learning curve, though. The I2C port extenders are easier to understand.

If it's just the extra storage you're after and you have no use for the WiFi part: use an Uno/Nano and add a Flash memory chip to it (communicate over I2C or SPI) and you won't run out of pins that quickly. Add an RTC and you can keep track of when the door opened even (though if you use the ESP and have WiFi you can get an even more accurate time over NTP).

esp-01 is a module with esp8266 and nodemcu is a dev board with esp8266. you still have two MCU if you combine one of them with Mega (or Uno). you can program esp-01 with Arduino IDE same way like the NodeMcu. only you must use an USB-to-TTL-Serial adapter to program it (and put it in flashing mode before you upload to it).

if you want to use the esp-01 with AT commands as it is, the WiFiEsp library works over the AT commands and has similar API like the esp8266 WiFi library