Master RESET ESP8266 Wifi Module using Arduino mega 2560

Reset ESP8266 connection diagram

Master Reset ESP 8266 Wifi Module

Sometimes when working with ESP8266, the module stop replying to AT commands. To solve this issue, we have created a simple Master Reset Program to reset ESP8266 Module using Arduino Mega2560, however one can use Arduino UNO using Software Serial Library to achieve the same.

Connection Diagram:

Reset ESP8266 connection diagram

Connect ESP8266 with Arduino mega 2560 as shown in figure above.

Arduino Pins ESP8266 Pin
RX1 (19) TX
TX1 (18) RX
3.3 V EN or CH_PD
5 (Digital pin 5) RESET
3.3 V VCC


After connections, compile the following program and upload it to Arduino Mega 2560.

[box type=”shadow” align=”aligncenter” class=”” width=””]

void setup()
pinMode(5, OUTPUT);
digitalWrite(5, LOW);

for(int i=0;i<=200;i++)

digitalWrite(5, HIGH);
digitalWrite(5, LOW);
Serial.println(“RESET Complete”);

void loop()
if(Serial.available() > 0)

if(Serial1.available() > 0)



Download the Arduino Sketch to Reset ESP8266 Wifi Module: Reset ESP8266 Arduino Sketch

It may take 10 to 15 seconds to reset, and once it is done you will receive some unknown bytes on Serial monitor as shown in Figure below:

reset esp8266 output after reset


To Test ESP8266, if it is working or not, download a simple Sketch after executing this sketch, Serial Monitor should show “OK“.

reset esp8266 verify




Version: 1.0 (dated: 22-03-2017)

4 Comments on “Master RESET ESP8266 Wifi Module using Arduino mega 2560”

  1. boa tarde tem uma parte do programa que nao funciona.
    como faço para corrigir isso.

    1. Re-write this line by yourself in the code, sometimes when you copy the code, some of the characters are changed, that’s why the compiler shows syntax errors.

Leave a Reply

Your email address will not be published. Required fields are marked *