ESP is not responding #Arduino Mega #ESP01

Hi Blynk Community! I am having an error showing “ESP is not responding”. May I ask what I might have done wrong to cause this error? Thank you very much in advance! All the information is shown as follows:

Board: Arduino Mega
Wifi Module: ESP01
(ESP 01) AT version: v1.3.0.2
Blynk Library version: v1.0.1
Connection:

Arduino Mega > ESP01
RX1 > TXD
TX1 > RXD
GND > GND
3.3V > 3.3V & CH_PD
Not Connected - RST, GPIO2 & GPIO 0

Code:

// I created 4 buttons in Blynk and wanna use these buttons to turn on LEDs using digital pins on Arduino Mega

#define BLYNK_TEMPLATE_ID "xxx"
#define BLYNK_DEVICE_NAME "xxx"
#define BLYNK_AUTH_TOKEN "xxx"

// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxx";
char pass[] = "xxx";

// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

// 1 LED Widget is blinking

BLYNK_WRITE(V1){

  //TOP LEFT OPTION
  int topLeftOpt = param.asInt();

  if(topLeftOpt == 0){
    Serial.println("Top Left LED: off");
    digitalWrite(22,LOW);
  }
  else{
    Serial.println("Top Left LED: on");
    digitalWrite(23,HIGH);
  } 
}

BLYNK_WRITE(V2){

  //TOP RIGHT OPTION
  int topRightOpt = param.asInt();

  if(topRightOpt == 0){
    Serial.println("Top Right LED: off");
    digitalWrite(23,LOW);
  }
  else{
    Serial.println("Top Right LED: on");
    digitalWrite(23,HIGH);
  } 
}

BLYNK_WRITE(V3){

  //BOTTOM LEFT OPTION
  int bottomLeftOpt = param.asInt();

  if(bottomLeftOpt == 0){
    Serial.println("Bottom Left LED: off");
    digitalWrite(12,LOW);
  }
  else{
    Serial.println("Bottom Left LED: on");
    digitalWrite(12,HIGH);
  } 
}

BLYNK_WRITE(V4){

  //BOTTOM RIGHT OPTION
  int bottomRightOpt = param.asInt();

  if(bottomRightOpt == 0){
    Serial.println("Bottom Right LED: off");
    digitalWrite(13,LOW);
  }
  else{
    Serial.println("Bottom Right LED: on");
    digitalWrite(13,HIGH);
  } 
}

void setup()
{
  pinMode(22,OUTPUT);
  pinMode(23,OUTPUT);
  pinMode(12,OUTPUT);
  pinMode(13,OUTPUT);
  Serial.begin(115200);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Blynk.begin(auth, wifi, ssid, pass);
  
}

//In the loop function include Blynk.run() command.
void loop()
{
  Blynk.run();
}

Please edit your post and add triple backticks ( ``` ) before and after your sketch.

I’ve taken an indefinite hiatus from µC and Blynk, so I might not be up to speed with Blynk 2.0 and everything that comes with it…

However; doesn’t Ardunio Mega use 5.0 V on RX/TX while ESP-01 only uses 3.3 V? That might screw things up!

Also, Arduino Mega only have a 50 mA current output on the 3.3 V pin. ESP-01 needs about 80-250 mA (I did a quick search on Google) to function.

Just my 50 cents! But I’m sure Pete has a different solution for the problem :wink:

Try baud rate 9600 instead of 115200 and use an external power source.

Right, so you should use circuit like this
ebc5141ec8b2884ea57842d6a56deca394562c25_2_690x333

Use an external power source for example a voltage regulator

I totally agree you

Thank you so much for both of your advices @John93 @distans! I tried the above wiring and connected the ESP01 to an external power supply but still the serial monitor is showing “ESP01 is not responding”. I even tried to use the wifi adapter module but it is still having the same problem. May I ask is there anything else I can try to fix this issue? Thank you so much and really appreciate for your time!

Are you using pins (18, 19 ) ?
Is your power source supplying enough power ?

What EXACTY does that statement mean?

@John93 has already flagged-up that the baud rate that you are using to communicate with the ESP-01 may be wrong, but you’ve not responded to this.

Providing some info about how you’ve established this information…

would be helpful in us understanding what baud rate the ESP-01 is actually using.

Pete.

Sorry for not responding to that baud rate. I am sure the baud rate is 115200. I checked the serial monitor after flashing the ESP01.

Below is what I have tried but NOT working:

  1. I tried both 9600 & 115200 baud rates in Arduino code.
  2. I tried to use an external power supply that supplies 3.3V. The power supply that I used is a 12V1A power adapter, I connected it to a buck converter and stepped down the voltage to only 3.3V. The output voltage is checked using a multimeter.
  3. I tried to use both 16 & 17 and 18 & 19 Arduino Mega pins to connect ESP01 TX & RX but both don’t work. The wiring is exactly the same as what @John93 suggested.
  4. I tried to use an ESP01 serial wifi adapter module and connected it to the Arduino Mega board but the same error came out.
  5. I tried to replace the ESP01 with a new one.

The ESP01 flashes blue light (+ constant red light) after I uploaded my code but just that the serial monitor is still showing “ESP01 is not responding”. I am connecting my Arduino Mega to lots of other components such as RFID, is there any chance that this might affect my WiFi connection? However, the good news is when I used RemoteXY instead of Blynk everything works out perfectly.

You need to clarify exactly what you are doing here.
What firmware are you flashing the ESP-01 with, and what software are you using to do this?
Why are you doing this at all?

What hardware are you using to flash your ESP-01 ?

Pete.

To simplify, when using more than one PSU, you have to connect them so they share the same (common) GND.

1 Like