Arduino Uno interfacing with ESP8266-01

Have connected Arduino UNO to ESP8266-01 module.

Using serial monitor of Arduino UNO, by manually entering "AT" command I am able to get response from ESP8266 without any problem.

However, I not getting response from ESP module, when I uploaded a sketch to Arduino UNO containing "AT" command. Sample sketch is as follows:

int errorLED=13;
void setup() {
Serial.begin(115200); // Serial connection over USB to computer


void loop()
Serial.println("AT"); // Serial connection on Tx / Rx port to ESP8266
delay(1000); // Wait a little for the ESP to respond
if (!Serial.find("OK"))
{ digitalWrite(errorLED, HIGH);}
{Serial.println("Serial OK");}; // check if the ESP is running well

Any suggestion or recommendation?

My objective is to make Arduino Uno use ESP8266-01 to connect web /internet.

Can you share your wiring setup? I am also trying to get an UNO to communicate with the ESP but not sure I'm wiring correctly. Also which library are you using to interface with the ESP?

Maybe using println is adding additional characters. I recall AT commands being sensitive to newline and carriage returns

You're trying to use Serial to talk to the ESP8266 and Serial Monitor. That won't work. To do that you will need to use the SoftwareSerial library and connect the ESP to pins other than 0 and 1. Remember that you need to connect RX-TX, TX-RX. If you want to use Serial to communicate with the ESP8266 then you won't be able to use Serial Monitor via the USB cable on the Uno and you will also need to disconnect the ESP8266 to upload code to your Uno.