# [ESP8266: Programming with the Arduino IDE](https://blog.hirnschall.net/esp8266-arduino-ide/)

author: [Sebastian Hirnschall](https://blog.hirnschall.net/about/)

meta description: Program any ESP8266 module using a spare Arduino as a USB-to-serial adapter. Step-by-step wiring, Arduino IDE board setup, and GPIO0 boot mode procedure.

meta title: Flash ESP8266 Without USB Adapter — Use an Arduino

date published: 09.01.2023 (DD.MM.YYYY format)
date last modified: 03.04.2026 (DD.MM.YYYY format)

---

Introduction
------------

In recent years the ESP8266 has become one of my go-to choices for smart home/IoT devices or projects requiring WiFi. It is cheap [(around $1.5 on Amazon)1](https://amzn.to/3r9XX2D), has WiFi, and can be programmed using the Arduino IDE, making it an easy replacement for Arduinos if we need WiFi connectivity.

While the ESP8266 can be used with the original AT firmware as a WiFi module for other microcontrollers like an Arduino, we will concentrate on writing our own replacement firmware in this post. Our firmware lets us replace the Arduino with an ESP module, simplifying programming and assembly and reducing cost.

This post shows how to setup the Arduino IDE to work with the ESP8266 module and how we can use a spare Arduino as a USB to serial converter for programming the ESP module. It is part of [a complete ESP8266 reference you can find here.](https://blog.hirnschall.net/esp8266/)

Programming ESP8266 with Arduino IDE
------------------------------------

An esp8266 is a cheap and easy way to add WiFi connectivity to your Arduino projects. However, an esp8266 can replace the Arduino entirely for smaller projects, making the project way cheaper, much smaller, and easier to program. As the esp module lacks a serial to USB converter, we'll use an Arduino to program it.

### Arduino IDE setup

As mentioned above, we'll use the arduino IDE to program the esp8266. ([Download Arduino IDE here](https://www.arduino.cc/en/main/software)) We first have to add the esp board. To do so, navigate to File>Preferences and add:

```
http://arduino.esp8266.com/stable/package_esp8266com_index.json
```

![adding esp8266 board module source to arduino ide](https://blog.hirnschall.net/esp8266-arduino-ide/resources/img/arduino-ide-settings.png)


Figure 8.1: Adding an additional Boards Manager URL

Next, we need to install the esp board using the boards manager (Tools>Board:"">Boards Manager...). Search for esp8266 and press install.

![installing esp8266 board module to arduino ide](https://blog.hirnschall.net/esp8266-arduino-ide/resources/img/arduino-ide-install-board.png)


Figure 8.2: Installing the esp8266 board

Ok, after selecting "generic esp8266  module" as seen in the figure below we are all set and can continue with wiring everything up!

![selecting esp8266 board module in the arduino ide](https://blog.hirnschall.net/esp8266-arduino-ide/resources/img/arduino-ide-esp-board-1.png)


Figure 8.3: Selecting the esp8266 board

### Connect ESP8266 to Arduino

We can enter programming mode by pulling the esp's gpio 0 pin low on boot. That is, disconnect the esp from GND, connect the esp's gpio 0 to GND, and reconnect the esp module to GND. Suppose you have connected the Arduino and opened a serial monitor on the connected port beforehand. In that case, you should see a message from the esp indicating that it has entered programming mode. It is also crucial that we connect the Arduino's reset pin to ground.

Fig. 8.4 below shows a pushbutton labeled "FLASH" to connect gpio 0 to ground during the boot process. You do not have to use a button to do so. I usually use a spare jumper wire to make the connection and disconnect it from GND if I want to boot the esp normally.

![wiring diagram for programming an esp8266 esp-01, esp-07 and esp-12 module with Arduino ide](https://blog.hirnschall.net/esp8266-arduino-ide/resources/img/wiring.png)


Figure 8.4: Schematic for programming an esp8266 using an Arduino uno

This sketch uses an esp8266 esp12 board. If you want to program an esp module:

* Use the minimal circuit shown in [Fig. 2.3](https://blog.hirnschall.net/esp8266-reference/#minimal-circuit12) and add the Rx, Tx, and gpio0 connections as shown in Fig. 8.4 above.
* Connect the Arduino's reset pin to ground (GND).
* To program a different module, check the datasheet to determine which pin is gpio 0.

### Programming the ESP8266

We can now hit upload like we would programming an Arduino board. Once finished, disconnect the gpio 0 pin and restart the esp module.

More Info
---------

This post is part of a complete ESP8266 reference/guide. You can find more information on how to use your ESP8266 module effectively at [blog.hirnschall.net/esp8266/](https://blog.hirnschall.net/esp8266/).