Arduino mega + esp

I’m having a problem using esp as a wifi shield on arduino mega, the serial monitor says the esp is not responding. I tried connecting TR to TR and TR to RX(Arduino to esp connections) but it still doesn’t work. I also tried changing the serial Band but nothing. please help!


It’s a common issue due to hardware connection (ground issue) and some times to power supply.

1 Like

It’s always Tx to Rx.
The Arduino and ESP need to be talking to each other at the same baud rate and if you’re using SoftwareSerial then preferably 9600.
You change the baud rate of the ESP using AT commands.


1 Like

I tried using a separate power supply for esp earlier but it didnt work, Ill check my connections

Thanks sir, I’m using 9600 band on the code for serial, I didn’t know I also had to change the one in the esp, whats the default band of the esp?

How do I use the AT commands to change the band in the esp?

Google, or the search feature of this forum will give you all the answers you need.


1 Like

I successfully changed the esp bandrate to 9600 and apploaded the sketch to arduino mega, but the serial monitor in arduino says

connecting to Mbeva
esp not responding

But I can see the esp under connected devices in my phone, yet the Blynk app says “it wasn’t online yet”

What can I do?

What exactly do you mean by this?



Open the attached picture, The esp is not connecting but I can see it under connected devices in my phone(hotspot connection)

You’re saying that you can see it in the list of Wi-Fi SSIDs on your phone?
What name does it have, and what happens if you try to connect to it?
Screenshots would be good.

Have you ever uploaded a sketch to your ESP-01 ?


I’ve never uploaded a sketch to the esp, I only sent AT commands to it. When I search it using my phone I can’t see it, but when I use arduino ide and program it to connect to my phone it does(The attached pic is the evidence)

Okay, that makes sense now.

People often have problems with Blynk when using a mobile hotspot, as some mobile data providers block the Blynk protocol.
Try connecting the Uno/ESP directly to a regular Wi-Fi network, or try connecting to a mobile hotspot that uses a different data provider, or swap the SIM card from a friend into your phone.


Post your sketch

Sorry, i read wrong

it’s all ok. i had a lot of troubles with this type of connection, and most of the times it was the ground issue.

have you flashed your esp with the correct firmware?

No, How do I do that?

@TIYANI please edit the post where you posted your sketch and use triple backticks at the beginning and end of your code rather than the characters that you have used.
Triple backticks look like this:


Thanks I couldn’t tell if they were apostrophes or back ticks

#define BLYNK_PRINT Serial

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "eCSiYtVdVgVC1*****pwcPMG5kT9Z";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "ke***ch";
char pass[] = "Keat***1";

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

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(0, 1); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600

ESP8266 wifi(&EspSerial);

void setup()
  // Debug console

  // Set ESP8266 baud rate

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);

void loop()

I found a esp_flasher.exe to deal with the esp firmware but the files seems to be corrupted, can you give me a link to another one that I can use