Program ESP8266 with Arduino UNO and blink built-in ESP LED [Solved]


I am using an Arduino UNO R3 to program an ESP8266 using a black version ESP-01. I found this guide: How to Program ESP8266 with Arduino UNO - Iotguider

ESP-01 black.jpg

Compilation information from Arduino IDE 1.8.10:

Executable segment sizes:

IROM   : 227612          - code in flash         (default or ICACHE_FLASH_ATTR) 

IRAM   : 26776   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 

DATA   : 1252  )         - initialized variables (global, static) in RAM/HEAP 

RODATA : 672   ) / 81920 - constants             (global, static) in RAM/HEAP 

BSS    : 24880 )         - zeroed variables      (global, static) in RAM/HEAP 

Sketch uses 256312 bytes (26%) of program storage space. Maximum is 958448 bytes.
Global variables use 26804 bytes (32%) of dynamic memory, leaving 55116 bytes for local variables. Maximum is 81920 bytes. v2.8
Serial port COM7
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 5c:cf:7f:c2:d0:6d
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 1MB
Compressed 260464 bytes to 190651...

Writing at 0x00000000... (8 %)
Writing at 0x00004000... (16 %)
Writing at 0x00008000... (25 %)
Writing at 0x0000c000... (33 %)
Writing at 0x00010000... (41 %)
Writing at 0x00014000... (50 %)
Writing at 0x00018000... (58 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (75 %)
Writing at 0x00024000... (83 %)
Writing at 0x00028000... (91 %)
Writing at 0x0002c000... (100 %)
Wrote 260464 bytes (190651 compressed) at 0x00000000 in 16.9 seconds (effective 123.2 kbit/s)...
Hash of data verified.

Hard resetting via RTS pin...

I only have some experience using Arduino UNO and it's my first time using an ESP-01 so i don't know if the code compilation and upload was successful. There was no LED blinking on the ESP-01 module. I'm not even sure if there is a built-in LED on this ESP-01? So, i uploaded the blink sketch from the Arduino examples and connected an LED between GPIO_2 pin of ESP-01 and ground, but the LED stays on and does not blink.

Edit: I found my mistake. GPIO_0 was initially grounded to enable the programming mode of ESP8266. So, i disconnected the GPIO_0 pin and unplugged the Arduino UNO from its USB port and reconnected. The external LED now blinks. But still, no blinking built-in LED on the ESP-01 module.

Edit: I did a search and found this useful thread: New ESP-01 modules use different pin for LED_BUILTIN · Issue #3165 · esp8266/Arduino · GitHub
I changed the code to make it compile. I uploaded the sketch, disconnected pin GPIO_0 from ground and disconnected the power and reconnected. The built-in (blue) LED on the ESP-01 now blinks!

// Blink the built-in LED for ESP-01 black model

#define ESP_LED 1 // GPIO_1

void setup()
digitalWrite(ESP_LED, HIGH); // Off - confirmed for built-in LED
//digitalWrite(ESP_LED, LOW); // On - confirmed!

void loop()
digitalWrite(ESP_LED, LOW); // On
digitalWrite(ESP_LED, HIGH); // Off

I hope this helps others! :slight_smile:

ESP-01 black.jpg