Program ESP8266 ESP-01 With Arduino

esp-01 with arduino

This article discusses how we can program ESP8266 ESP-01 module using the Arduino IDE.

The ESP8266 ESP-01 microcontroller module is a low cost WIFI Enabled module developed by the Espressif System that has the capability to execute TCP IP Connections. This MCU contains a lot of “punch” for its size and has gpio ports in itself that you can use to control simple projects and is ideal for Internet of Things (IOT) Applications.

When you buy this module it comes pre-installed with its own firmware and is able to execute TCP/IP commands thru what we call as AT Commands. However I find these AT commands a little bit “cumbersome” to execute in the code so we will be using an alternative “firmware”.

You will often see the following commands in different tutorials


Luckily the ESP8266 community released a companion project for the Arduino as an Add-On and can be found here We will be using this library in this article.

We will follow the instructions for this library by following this link.

  1. In your Arduino, click File then Preferences
  2. Add the following to your Additional Board Manager URL’s. Use comma if there is other url there already.

3. Open Boards Manager from Tools > Board menu and find esp8266 platform

4. Click Install

5. After which Select your board as “Generic ESP8266 Module

Wiring Diagram

One quick solution to load programs in the ESP-01 is to use the ESP-01 programmer which you can source online. We will discuss this in a separate article.

But in this article we will be using the Arduino to program our ESP8266 ESP-01 module in this article if you don’t have the programmer above.

Understanding Boot Mode

ESP-01 has two two modes

  1. Normal Mode
  2. Bootloader Mode

In order to load new firmware then we have to set it in Bootloader Mode. To set it to bootloader CH_PD should be set to HIGH and the GPIO0 connected to GND. That is the reason we have SPST switch between GPIO0 and the GND.

The same applies also when we want to create our program and load it into the ESP-01 flash memory.

Installing the Arduino ESP8266 Firmware

Once you are done with the wiring, we will just need to replace the firmware with the Arduino ESP8266. Note that once we have change the firmware then we cannot execute AT commands anymore into the ESP-01.

To load the firmware we just need to upload the Blink Sketch. To do this just click File -> Examples -> Basics -> Blink

Make sure that your Board is set to “Generic ESP8266 Module” and the Toggle Switch connected in GPIO0 is connected to GND.

Click upload and when you see the following message click the momentary switch connected to the RST for about 1 second so that we could reset the ESP-01

Afterward we would see that the following success message.

To see the ESP-01 built in LED blink then make sure that the toggle button connected to GPI0 is not connected to GND. Click the momentary switch in RST and then check if the LED is blinking.


You sometime will encounter the following problem so it could be that you might not have press the reset button enough. When the “connecting” message starts showing then click the momentary switch connected to RST for about a second.

Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
  File "C:\Users\DONSKY\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/", line 65, in <module>
  File "C:/Users/DONSKY/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\", line 2890, in main
  File "C:/Users/DONSKY/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\", line 483, in connect
    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
the selected serial port _
 does not exist or your board is not connected


Watch the following demo on how I did it.

Thats it!

Happy Exploring!

If you like my post then please consider sharing this. Thanks!


  1. NodeMCU ESP8266 Web Server Tutorial Series -

    […] The NodeMCU ESP8266 module contains its own usb port that we can use to load our sketch. This will simplify our programming process so that we don’t need to use additional circuitry to load our program. The small but versatile ESP8266 ESP-01 is often used if “space” or “dimension” is your concern. However programming the ESP-01 requires additional circuitry if you have not bought the Programmer for it. I have written a post on how to program your ESP-01 using the Arduino IDE. […]

Leave a Reply

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