New to the ESP8266? Start here! The ESP8266 is a Wi-Fi System on a Chip (SoC) produced by Espressif Systems. It’s great for IoT and Home Automation projects. This article is a getting started guide for the ESP8266 development board.
New to the ESP8266? You’re in the right place. This guide contains all the information you need to get started with this amazing board. Learn what is an ESP8266, what is it used for, how to choose an ESP8266 development board, how to upload your first program, and much more.
Table of Contents
- Introducing the ESP8266 NodeMCU
- ESP8266 Versions
- ESP8266 Development Boards
- ESP8266 GPIOs Pinout Guide
- How to program the ESP8266?
- ESP8266 with Arduino IDE
- Upload code to the ESP8266 using Arduino IDE
- Best resources to get started with the ESP8266
Introducing the ESP8266 NodeMCU
What is an ESP8266 NodeMCU? The ESP8266 is a low-cost Wi-Fi chip developed by Espressif Systems.
It can be used as a standalone device, or as a UART to Wi-Fi adaptor to allow other microcontrollers to connect to a Wi-Fi network. For example, you can connect an ESP8266 to an Arduino to add Wi-Fi capabilities to your Arduino board. The most practical application is using it as a standalone device.
With the ESP8266, you can control inputs and outputs as you would do with an Arduino, but with Wi-Fi capabilities. This means you can bring your projects online, which is great for home automation and internet of things applications. Why is the ESP8266 so popular? Mainly for the following reasons:
- Low-cost: you can get ESP8266 boards starting at $3 (or less) depending on the model.
- Low-power: the ESP8266 consumes very little power when compared with other microcontrollers and can even go into deep sleep mode to consume less power;
- Wi-Fi: the ESP8266 can generate its own Wi-Fi network (access point) or connect to other Wi-Fi networks (station) to get access to the internet. This means the ESP8266 can access online services to make HTTP requests or save data to the cloud, for example. It can also act as a web server so that you can access it using a web browser and be able to control and monitor your boards remotely.
- Compatible with the Arduino “programming language”: those that are already familiar with programming the Arduino board, were happy to know that they can program the ESP8266 in the Arduino style.
- Compatible with MicroPython: you can program the ESP8266 with MicroPython firmware, which is a re-implementation of Python 3 targeted for microcontrollers and embedded systems.
What can you do with an ESP8266?
Here’s a short list of what you can do with an ESP8266:
- Create a web server to control outputs;
- Create a web server to display sensor readings;
- Send HTTP requests;
- Control outputs, read inputs, and set interrupts;
- Datalogging projects;
- Communicate with third-party services;
- Create web applications;
- Send emails, notifications, post tweets, etc.
- And much more.
ESP8266 Technical Data
For more details about the specs of the ESP8266, check the following list:
- Processor: L106 32-bit RISC microprocessor core based on the Tensilica Diamond Standard 106Micro running at 80 or 160 MHz
- 32 KiB instruction RAM
- 32 KiB instruction cache RAM
- 80 KiB user-data RAM
- 16 KiB ETS system-data RAM
- External QSPI flash: up to 16 MiB is supported (512 KiB to 4 MiB typically included)
- IEEE 802.11 b/g/n Wi-Fi
- Integrated TR switch, balun, LNA, power amplifier, and matching network
- WEP or WPA/WPA2 authentication, or open networks
- 17 GPIO pins
- Serial Peripheral Interface Bus (SPI)
- I²C (software implementation)
- I²S interfaces with DMA (sharing pins with GPIO)
- UART on dedicated pins, plus a transmit-only UART can be enabled on GPIO2
- 10-bit ADC (successive approximation ADC)
Main Differences Between ESP8266 and ESP32
There is a successor of the ESP8266—the ESP32. The ESP32 combines Wi-Fi and Bluetooth and is dual-core. If you want to start with any of these boards, we recommend getting an ESP32. If you already have an ESP8266, don’t worry. It works great, it has a huge community and it does the job for most DIY IoT projects.
The following table shows the main differences between the ESP8266 and the ESP32 chips:
|MCU||Xtensa Single-core 32-bit L106||Xtensa Dual-Core 32-bit LX6 with 600 DMIPS|
|802.11 b/g/n Wi-Fi||HT20||HT40|
|Bluetooth||X||Bluetooth 4.2 and BLE|
|Typical Frequency||80 MHz||160 MHz|
|Hardware /Software PWM||None / 8 channels||None / 16 channels|
|Ethernet MAC Interface||X||✓|
|Temperature Sensor||X||✓(old versions)|
|Hall effect sensor||X||✓|
|Price||$ (3$ – $6)||$$ ($6 – $12)|
|Where to buy||Best ESP8266 Wi-Fi Development Boards||ESP32 Development Boards Review and Comparison|
For a more detailed analysis of the differences between those boards, we recommend reading the following article: ESP32 vs ESP8266 – Pros and Cons.
There are several versions of the ESP8266 modules as shown in the picture below. The ESP-01 and ESP-12E are the most popular versions. You’ll find a wide variety of development boards with ESP-12E or ESP-12F chips.
ESP8266 NodeMCU Development Boards
Using bare chips or modules is not easy or practical. For learning, testing, and prototyping, you’ll want to use ESP8266 NodeMCU development boards.
These come with all the needed circuitry to apply power, upload code, easy access to the GPIOs to connect sensors and actuators, an antenna for the Wi-Fi signal, and other useful features.
How to Choose an ESP8266 Development Board?
There is a wide variety of ESP8266 boards from different vendors. While they all work in a similar way, some boards may be more suitable for some projects than others. When looking for an ESP8266 development board there are several aspects you need to take into account:
- USB-to-UART interface and voltage regulator circuit. Most full-featured development boards have these two features. This is important to easily connect the ESP8266 to your computer to upload code and apply power.
- BOOT and RESET/EN buttons to put the board in flashing mode or reset (restart) the board.
- Pin configuration and the number of pins. To properly use the ESP8266 in your projects, you need to have access to the board pinout (like a map that shows which pin corresponds to which GPIO and its features). So make sure you have access to the pinout of the board you’re getting. Additionally, some boards have more accessible GPIOs than others. That’s a factor you should take into account depending on your project features.
- Size. There is a wide variety of ESP8266 development boards with different sizes. Some boards benefit from a small form factor, which might be very practical depending on your project features. Usually, smaller boards have a small number of available GPIOs like the ESP-01.
- Antenna connector. Most boards come with an onboard antenna for the Wi-Fi signal. Some boards come with an antenna connector to optionally connect an external antenna. Adding an external antenna increases your Wi-Fi range.
What is the best ESP8266 development board for beginners?
The best ESP8266 development board for your project will depend on what you intend to do. If you’re just getting started with the ESP8266 board, we recommend using the ESP8266-12E NodeMCU Kit.
ESP8266-12E NodeMCU Kit
The ESP12-E NodeMCU Kit is one of the most used ESP8266 development boards. It features 4MB of flash memory, access to 11 GPIO pins, and one analog-to-digital converter (ADC) pin with 10-bit resolution. In addition, the board has a built-in voltage regulator, and you can power up the module using the mini USB socket or the Vin pin.
Uploading code to the board is as easy as uploading code to the Arduino. There’s no need for an FTDI programmer or extra circuitry, as it has a built-in USB-to-serial converter. Most boards come with the CP2101 or CH340 chips.
It comes with an onboard antenna for Wi-Fi signal, and comes with RST and FLASH buttons to reset the board and put it into flashing mode. There is a blue LED internally connected to GPIO 2, which is very practical for debugging.
This is the ESP8266 board model we use more often in our Wi-Fi and IoT projects. It is very versatile, and it’s great for beginners. So, if this is your first time with the ESP8266, this is the module we recommend: ESP8266 12-E NodeMCU Kit.
Where to Buy?
You can check the following link to find the ESP8266-12E NodeMCU Kit in different stores:
Other Popular ESP8266 Development Boards
While I don’t recommend the ESP-01 for beginners, the ESP8266 Wemos D1 mini can be a good choice.
The ESP-01 is super small and fits in any enclosure, so it’s perfect for finished projects. However, it is very limited in the number of accessible GPIOs and doesn’t have a built-in voltage regulator, so you need to use a 3V3 power source or add a voltage regulator to drop the input voltage to 3V3. Additionally, it doesn’t come with a USB-to-serial converter, which means you need an FTDI programmer or a specific programmer board to upload code.
WeMos D1 Mini
The WeMos D1 Mini offers 4MB flash memory, 11GPIOs, and 1 ADC pin in a minimal and small setup. The community has developed a wide variety of shields for the D1 mini board, which allows you to build small and simple setups with almost no wiring required. You just need to stack the shields to connect multiple peripherals. It comes with a built-in voltage regulator and USB-to-UART converter, which makes it easy to upload code. For these reasons, this might also be a good choice for beginners.
For a comparison between the different ESP8266 boards, you can read the following article:
There are many other versions of different ESP8266 boards. Most boards work in a similar way. Just make sure they are suitable for your project requirements.
In the following table, you can see the main differences between the ESP-01, ESP8266-12E NodeMCU Kit, and the WeMos D1 Mini.
|ESP-01||ESP-12E NodeMCU||WeMos D1 Mini|
(including TX and RX)
|Flash Memory||1MB (upgraded|
|USB to Serial|
|Size||24.75mm x 14.5mm|
(0.97” x 0.57”)
|48.55mm x 25.6mm|
(1.91” x 1”)
|34.2mm x 25.6mm|
(1.35” x 1”)
|Where to Buy?||ESP-01||ESP-12E NodeMCU||WeMos D1 Mini|
ESP8266 NodeMCU Pinout
The most widely used ESP8266 NodeMCU development boards are the ESP8266-12E NodeMCU Kit, the Wemos D1 Mini, and the ESP-01. We’ll show you the pinout for those boards. A pinout is like a map that shows which pin corresponds to which GPIO and its features. This way, you should know which GPIOs to use if you need to use SPI, I2C, ADC, or others.
If you get a different board, you should be able to find its pinout with a quick google search. Here we’ll just take a quick look at the pinout. We recommend reading the following article that shows a detailed explanation of the ESP8266 pinout and how to use its GPIOs: ESP8266 Pinout Reference: Which GPIO pins should you use?
Usually, all boards come with power pins: 3V3, GND, and VIN. You can use these pins to power the board (if you’re not providing power through the USB port), or to get power for other peripherals (if you’re powering the board using the USB port).
General Purpose Input Output Pins (GPIOs)
One important thing to notice about the ESP8266 is that the GPIO number doesn’t match the label on the board silkscreen. For example, D0 corresponds to GPIO16 and D1 corresponds to GPIO5. When programming your boards using Arduino IDE, you must use the GPIO number and not the number on the silkscreen. This applies to most ESP8266 boards.
The ESP8266 peripherals include:
- 17 GPIOs (usually not all GPIOs are accessible on the ESP8266 development boards)
- I2C (implemented on software)
- I2S interfaces with DMA
- 10-bit ADC
Different ESP8266 GPIOs have specific features, so you must choose the pins for your projects wisely. Otherwise, you may end up getting unexpected results.
We recommend taking a look at our ESP8266 GPIO guide which shows in great detail the function of each GPIO and how to pick the best GPIOs for your project:
ESP-12E NodeMCU Kit Pinout
The following picture shows an overview of the ESP-12E NodeMCU Kit pinout:
WeMos D1 Mini Pinout
Here’s the Wemos D1 Mini pinout:
Here’s the ESP-01 pinout.
How to Program the ESP8266?
There are many different ways to program the ESP8266 using different programming languages: Arduino C/C++ using the Arduino core for the ESP32, Micropython, LUA, and others.
We also have several tutorials showing how to program the ESP866 using MicroPython. However, throughout this article, we’ll be focusing on Arduino IDE.
Programming ESP8266 with Arduino IDE
To program your boards, you need an IDE to write your code. For beginners, we recommend using Arduino IDE. While it’s not the best IDE, it works well and is simple and intuitive to use for beginners. After getting familiar with Arduino IDE and you start creating more complex projects, you may find it useful to use VS Code with the PlatformIO extension instead.
If you’re just getting started with the ESP8266, start with Arduino IDE. At the time of writing this tutorial, we recommend using the legacy version (1.8.19) with the ESP8266. While version 2 works well with Arduino, there are still some bugs and some features that are not supported yet for the ESP8266.
Installing Arduino IDE
To run Arduino IDE, you need JAVA installed on your computer. If you don’t, go to the following website to download and install the latest version: http://java.com/download.
Downloading Arduino IDE
To download the Arduino IDE, visit the following URL:
Don’t install the 2.0 version. At the time of writing this tutorial, we recommend using the legacy version (1.8.19) with the ESP8266. While version 2 works well with Arduino, there are still some bugs and some features that are not supported yet for the ESP8266.
Scroll down until you find the legacy version section.
Select your operating system and download the software. For Windows, we recommend downloading the “Windows ZIP file“.
Running Arduino IDE
Grab the folder you’ve just downloaded and unzip it. Run the executable file called arduino.exe (highlighted below).
The Arduino IDE window should open.
Installing the ESP8266 NodeMCU in Arduino IDE
To be able to program the ESP8266 NodeMCU using Arduino IDE, you need to add support for the ESP8266 boards. Follow the next steps:
- Go to File > Preferences.
- Enter the following into the “Additional Board Manager URLs” field.
See the figure below. Then, click the “OK” button.
Note: if you already have the ESP32 boards URL, you can separate the URLs with a comma as follows:
- Open the Boards Manager. Go to Tools > Board >Boards Manager…
- Search for ESP8266 and install the “ESP8266 by ESP8266 Community“.
That’s it. It will be installed after a few seconds.
After this, restart your Arduino IDE.
Then, go to Tools > Board and check that you have ESP8266 boards available.
Now, you’re ready to start programming your ESP8266 using Arduino IDE.
In the Arduino IDE, you can find multiple examples for the ESP8266 board. First, make sure you have an ESP8266 board selected in Tools > Board. Then, simply go to File > Examples and check out the examples under the ESP8266 section.
Update the ESP8266 Core in Arduino IDE
Once in a while, it’s a good idea to check if you have the latest version of the ESP8266 boards add-on installed.
You just need to go to Tools > Board > Boards Manager, search for ESP8266, and check the version that you have installed. If there is a more recent version available, select that version to install it.
Upload Code to the ESP8266 NodeMCU using Arduino IDE
To show you how to upload code to your ESP8266 board, we’ll try a simple example available in the Arduino IDE examples for the ESP8266.
First, make sure you have an ESP8266 selected in Tools > Board. If you’re using the ESP8266-12E NodeMCU Kit as shown in previous pictures, select the NodeMCU 1.0 (ESP-12E Module) option. If you don’t know what’s your board, you can always select the Generic ESP8266 Module.
Then, go to File > Examples > ESP8266WiFi > WiFiScan.
This will load a sketch that scans Wi-Fi networks within the range of your ESP8266 board.
Connect your ESP8266 development board to your computer using a USB cable.
Warning: you must use a USB cable with data wires. Some USB cables from chargers or power banks are power only and they don’t transfer data—these won’t work.
Now, follow the next steps to upload the code.
1) Go to Tools > Board, scroll down to the ESP8266 section and select your ESP8266 board. If you don’t know what’s your board, the Generic ESP8266 Module usually works fine for most boards.
2) Go to Tools > Port and select a COM port available. If the COM port is grayed out, this means you don’t have the required USB drivers. Check the section Installing USB Drivers before proceeding.
3) Press the upload button.
The code should be successfully uploaded to the board after a few seconds.
Uploading Code to ESP-01
If you’re using an ESP-01, read this section to learn how to upload code to the board.
The ESP-01 doesn’t have a built-in programmer, so uploading code is not as straightforward. The easiest way to upload code to the ESP-01 is to get an ESP-01 programmer. There are several available online, the picture below shows an example of an ESP-01 programmer.
This is very practical because you just need to connect the ESP-01 to the module and the module to your computer to program the ESP8266.
Another alternative is using an FTDI programmer. You’ll need to connect the ESP-01 to the FTDI programmer as shown below. Then, just connect the FTDI programmer to your computer.
The following table shows the connections you need to make between the ESP8266 and the FTDI programmer.
If you have a brand new FTDI Programmer, you’ll probably need to install the FTDI drivers on your Windows PC. Visit this website for the official drivers. (If the COM port is grayed out in your Arduino IDE, it is probably because you don’t have the drivers installed).
Then, you just need to connect the FTDI programmer to your computer, and upload the code to the ESP8266 by clicking on the upload button.
To see if the code is working as expected, open the Serial Monitor at a baud rate of 115200.
Press the ESP8266 RST or EN button to restart the board and start running the newly uploaded code.
You should get a list of nearby wi-fi networks.
If you’re using an ESP-01, after uploading the code, disconnect GPIO 0 from GND to disable the programming mode. Then, connect the RST pin to GND for approximately one second and then disconnect to reset the board.
Installing the ESP8266 NodeMCU USB Drivers
After connecting the ESP8266 board to your computer, if the COM port in Arduino IDE is grayed out, it means you don’t have the required USB drivers installed on your computer.
Most ESP8266 boards either use the CP2101 or CH340 drivers. Check the USB to UART converter on your board, and install the corresponding drivers.
You’ll easily find instructions with a quick google search. For example “install CP2101 drivers Windows”.
Best Resources to Get Started with the ESP8266
If you want to build your own IoT and Home Automation projects with the ESP8266 boards and need some help getting started, we have the best resources for you.
- Home Automation with the ESP8266: this is our premium ESP8266 eBook. Learn how to use the ESP8266 to automate your house. Even if you are an absolute beginner, you’ll be able to follow along and come up with your own IoT projects.
- Free ESP8266 Projects and Tutorials: we have multiple ESP8266 tutorials and guides covering many different subjects that you can check here.
- We have other eBooks about the ESP8266 that cover more specific subjects that you might be interested in:
We hope you’ve found this getting started guide useful. I think we’ve included all the required information for you to get started. You learned what is an ESP8266, how to choose an ESP8266 development board, and how to upload new code to the ESP8266 using Arduino IDE.
Want to learn more? We recommend the following tutorials to get started:
Also, don’t forget to take a look at the ESP8266 pinout to learn how to use its GPIOs:
If you’re serious about learning about the ESP8266 board, we recommend taking a look at our ESP8266-dedicated eBook:
You can also check all our free ESP8266 tutorials and guides on the following link:
If you like ESP8266 make sure you subscribe to our blog, so you don’t miss upcoming projects.
Do you have any questions? Leave a comment down below!
Thanks for reading.