Random Nerd Tutorials
Shares

How to Install the ESP8266 Board in Arduino IDE

Shares

There are a variety of development environments that can be used to program the ESP8266. The ESP8266 community created an add-on for the Arduino IDE that allows you to program the ESP8266 using the Arduino IDE and its programming language.

Before continue reading this tutorial, please read the following blog post to learn more about this WiFi module: How to get started with the ESP8266.

If you like the ESP and you want to do more projects you can read my eBook: Home Automation using ESP8266.

Let’s get started!

Downloading Arduino IDE

First download the Arduino IDE to ensure that you have the latest software version (some older versions won’t work), visit the following URL: https://www.arduino.cc/en/Main/Software.

Then select your operating system and download the latest software release of the Arduino IDE.

Installing Arduino IDE

Grab the file that you have just downloaded and open the Arduino IDE application file (see Figure below).

openning arduino ide

When the Arduino IDE first opens, this is what you should see:

Arduino IDE screenshot

Installing the ESP8266 Board

To install the ESP8266 board in your Arduino IDE, follow these next instructions:

1) Open the preferences window from the Arduino IDE. Go to File > Preferences

2) Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into the “Additional Board Manager URLs” field as shown in the figure below. Then, click the “OK” button.

cloud-download

3) Open boards manager. Go to Tools > Board > Boards Manager…

Arduino IDE boards manager

4) Scroll down, select the ESP8266 board menu and install “esp8266”

installing esp board

5) Choose your ESP8266 board from Tools > Board > Generic ESP8266 Module

Arduino IDE select esp8266

6) Finally, re-open your Arduino IDE

Testing the Installation

To test the ESP8266 add-on installation, let’s see if we can blink an LED with the ESP8266 using the Arduino programming language.

Parts List:

Here’s the hardware that you need to complete this project:

If you’re using an ESP8266-01, you need an FTDI programmer to upload code.

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Uploading the Sketch

Uploading the Sketch to the ESP-12E

If you’re using an ESP-12E NodeMCU Kit, uploading the sketch is very simple, since it has built-in programmer. Plug your board to your computer. Make sure you have the right board and COM port selected.

Then, copy the code provided, and click the “Upload” button in the Arduino IDE and wait a few seconds until you see the message “Done uploading.” in the bottom left corner.

Uploading the Sketch to the ESP-01

Uploading code to the ESP-01 requires establishing a serial communication between your ESP8266 and a FTDI Programmer as shown in the schematic diagram below.

ESP8266 Flasher

The following table shows the connections you need to make between the ESP8266 and the FTDI programmer.

ESP8266 FTDI programmer
RX TX
TX RX
CH_PD 3.3V
GPIO 0 GND
VCC 3.3V
GND GND

If you have a brand new FTDI Programmer and you need to install your FTDI drivers on Windows PC, visit this website for the official drivers: http://www.ftdichip.com/Drivers/VCP.htm. Alternatively, you can contact
the seller that sold you the FTDI Programmer.

Then, you just need to connect the FTDI programmer to your computer, and upload the sketch to your ESP. You should see “Done Uploading” after a few seconds.

Code

Here’s the code you should upload to your ESP8266.

Note: You have to select your FTDI’s port number under the Tools > Port menu of the Arduino IDE.

Schematic

If you’re using an ESP8266-12E

Connect an LED to your ESP8266, as shown in the following schematic diagram. The LED should be connected to GPIO 2 (D4 marked on the silkscreen).

If you’re using an ESP8266-01

If you’re using the ESP8266-01 assemble the following circuit.

ESP8266 Blinking an LED

If everything went well, your LED should be blinking every 1 second.

Wrapping Up

If you like the ESP8266 make sure you check our most popular projects:

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Learn ESP32 with Arduino IDE

This our complete guide to program the ESP32 with Arduino IDE, including projects, tips, and tricks! The registrations are open, so SIGN UP NOW »

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our course even with no prior experience!

Leave a Comment:

Add Your Reply

Grab our Electronics and Programming Courses