I have connected my Arduino with an ESP8266.

When I check the ESP8266, by manually entering commands at serial monitor, I get correct results.

However, when I run this program


SoftwareSerial esp8266(2,3);

void setup() {

void loop() {
  String command="AT";

      char c=esp8266.read();

I get garbage values where sometimes it has an OK in between the output:

" Received: "ÁT OK " Received: "AÔ ÏË " Received: "AÔ OK " Received: "ÁT ÏË " Received: "ÁT OË " Received: "ÁÔ OK " Received: "Á¬ OK " Received: "ÁT OË "

Could someone help me?

  • 1
    Is your serial monitor configured for 115200? Did you check the ESP with a serial monitor at 115200? Can you post the garbage? Did you look on the wires with an oscilloscope?
    – frarugi87
    Nov 25, 2015 at 15:11
  • Yeah frarugi87. I kept the serial monitor at 115200. Nov 25, 2015 at 16:01
  • Ok @abdul rahuman, try using if(esp8266.available()) { Serial.print("Received: \""); while(esp8266.available()) { char c=esp8266.read(); Serial.write(c); } Serial.println("\""); } and post back the output of the serial monitor
    – frarugi87
    Nov 25, 2015 at 16:26
  • @frarugi87 i got this upon your code. " Received: "ÁT OK " Received: "AÔ ÏË " Received: "AÔ OK " Received: "ÁT ÏË " Received: "ÁT OË " Received: "ÁÔ OK " Received: "Á¬ OK " Received: "ÁT OË " Nov 26, 2015 at 6:37
  • @frarugi87 as you could see it prints OK sometimes at but it prints some garbage combination with OK. so please help me. Nov 26, 2015 at 6:38

4 Answers 4


As noted by Matt, the baud rate for the ESP8266 can vary depending on the firmware version/manufacturer. 9600 and 115200 are the most common. If you can connect using a serial terminal program (like CoolTerm) you can then test the baudrate.

It sounds like the ESP8266 is set to 115200, but in my experience (and others') SoftwareSerial isn't capable of 115200 baud rate (despite "allowing" this as a setting). Some reports suggest as high as 57600 is workable, though in my experience 9600 is best for reliability. But you can reset this and see what the max reliable value is for you in your configuration.

How to change the baud rate on the ESP8266 will depend on the firmware version. I've had success with AT+IPR=9600. You only need to run this command once (it's a persistent setting). I'd suggest, based on your description, that this is the most likely culprit that's causing the intermittent "garbage" output you describe.


Using 115200 has too many instructions for the Arduino Uno to reliably decode characters and that's where the garbage is coming from.

The ESP8266 default baud is 115200, so you need to connect at the default rate and issue an AT command to reduce the baud rate to 9600.

Each time you reset, the ESP8266 goes back to the default baud rate.

Here's an example script that connects at the default baud rate and then reduces it to 9600. You'll connect the Serial Monitor at 9600. At the lower baud rate, I'm not getting any garbage characters.

#include <SoftwareSerial.h>
SoftwareSerial ESPserial(2, 3); // RX | TX

void setup() 
  // Start the software serial for communication with the ESP8266


void loop() 
    // listen for communication from the ESP8266 and then write it to the serial monitor
    if ( ESPserial.available() )   {  Serial.write( ESPserial.read() );  }

    // listen for user input and send it to the ESP8266
    if ( Serial.available() )       {  ESPserial.write( Serial.read() );  }

An odd thing that happened to me is that I tried to use a baud rate of 4800 and I bricked one ESP8266 module. I don't know if that was a glitch or just a coincidence.

  • Great. After trying this, my esp8266 blinks blue led repeatedly stuck in a loop. Good answer. +1000.
    – GeneCode
    Mar 16, 2019 at 14:09

Using AT+IPR is a very dangerous command. Many ESP8266 will get bricked after the command. The only way to do it is by flashing your ESP to a 9600 baudrate.

I just had to do this myself with a friend today after using the AT+IPR command and loads of websites tell you to never use the command.


Finally, solved garbage symbols in serial monitor by lowering the ESP's baud rate from 115200 to 9600 with the following command: AT+UART_DEF=9600,8,1,0,0 The root cause of the problem is speed limitations of the SoftwareSerial. On hardware Serial connection, it should work ok with speeds up to 115200.

There is my ESP AT+GMR info:

AT version: 14 2016 18:54:01)
SDK version:2.0.0(5a875ba)
Mar 13 2018 09:37:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.