Which ESP8266 module to choose. Power supply, how to program it in C++ with Arduino IDE, MicroPython, ESP Easy

Table of Contents

The ESP8266 was released in 2014. In just a few years it has gone from a simple WiFi module project for Arduino for a few euros to a full development board. The ESP8266 is a true Arduino Killer.


It has several inputs / outputs (GPIO), a WiFi connection, a power saving mode (Sleep esMode) and can be programmed either using the Arduino IDE or Lua (firmware NodeMCU), in MicroPython. Even better, with the ESP Easy firmware, you do not even need to know how to program to develop your connected objects and connect them to a DIY home automation server!

The models ESP8266EX 2018

The ESP8266 is developed by the Chinese company Espressif. Released in October 2014, the ESP8266 immediately aroused great interest from the community. The project is supported by a large community that you can follow here. This module does not content to offer a Wi-Fi connection to Arduino projects, it has its own inputs / outputs (GPIO) whose number depends on the model. Espressif first developed a very large family of circuits. In 2018, there are only three models of ESP8266 now called ESP8266EX. There are only four versions of the module. The difference between the modules is essentially at the antenna level.

Key features of the ESP8266EX

  • Single-core processor clocked at 160 MHz
  • +19.5 dBm output on the antenna ensures good physical reach
  • Standby current is less than 20 μA
  • WiFi 802.11 b / g / n at 2.4 GHz
  • The ESP8266EX supports UART, GPIO, I2C, I2S, SDIO, PWM, ADC and SPI inputs / outputs
  • CE and FCC certified
Module Description SoC Dimensions (mm) Pins Flash (MB)
The ESP-WROOM-02 is the basic module. The WiFi antenna is engraved on the PCB is based on ESP8266EX, measuring as small as 18x20x3 mm. 
Technical documentation
ESP8266EX 18x20x3 18 2
The ESP-WROOM-02D is built around the ESP8266EX. The antenna engraved on the PCB is more efficient
Technical documentation
ESP8266EX 18x20x3.2 18 2
The ESP-WROOM-02U is a more compact version (18 x 14.3 x 3.2 mm). It does not have an antenna. Instead, it has a connector U.FL (IPEX) on which we will connect an external antenna.
Technical documentation
ESP8266EX 18Xx14.3×3.2 18 2
esp wroom s2 esp8266ex 2018
The ESP-WROOM-S2 is a specific model that can work as an SDIO / SPI slave. The SPI bus has been optimized to reach a speed of 8 Mbps
Technical documentation
ESP8266EX 16x23x3 20 2

The old models of ESP8266

Before 2018, there were about 18 versions of the ESP8266, of which the following are the main features. I prefer to leave this part of the article for the record because we always find these modules for sale. Most often, the ESP-12E or ESP-12F modules are still marketed. The ESP-01 is always on sale, but it slowly begins to disappear from the shelves. There is only one page of results on AliExpress.

Warning. The ESP8266 modules operate with a voltage of 3.3 Volts that is dangerous to exceed. Some boards that ship a voltage regulator that protects the ESP8266 module and allows you to use a 5Volt power supply (usually between 3.3 and 6.2 Volts).

Model Photo Certifications Internal Antenna

External Antenna



Pins (GPIO) Datasheet
ESP-01 esp8266 esp-01  Not approved FCC and CE PCB engraved


14.3 x 24.8 8
ESP-02 esp8266 esp-02  ? No


14.2 x 14.2 8
ESP-03 esp8266 esp-03 ? Ceramic


17.3 x 12.1 14
ESP-04 esp8266 esp-04 ? ?


14.7 x 12.1 14
ESP-05 esp8266 esp-05  ? No


14.2 x 14.2 5
ESP-06 esp8266 esp-06 Not approved FCC and CE ?


? 12+GND
ESP-07 esp8266 esp-07 Not approved FCC and CE Ceramic


20.0 x 16.0 16
ESP-08 esp8266 esp-08 Not approved FCC and CE No


17.0 x 16.0 14
ESP-08 New  ? No


18.0 x 16.0 16
ESP-09 esp8266 esp-09 ? No


 10.0 x 10.0 12+GND
ESP-10 esp8266 esp-10 ? No


 14.2 x 10.0 5
ESP-11 esp8266 esp-11  ? Ceramic


 17.3 x 12.1 8
ESP-12 esp8266 esp-12 CE certificate n°BCTC-141212468

FCC certificate n°2ADUIESP-12



 24.0 x 16.0 16
ESP-12-E/Q esp8266 esp-12-eq Probably the same certifications as the ESP-12 PCB


 24.0 x 16.0 22
ESP-13 esp8266 esp-13 ? PCB


 ? 18
ESP-14 esp8266 esp-14 PCB


 24.3 x 16.2 22
ESP-WROOM-02 esp8266 WROOM-02 CE




 20 x 18 x 3 18 Read
WT8266-S1 esp8266 WT8266-S1 CE certificate n°BCTC-150809775

FCC certificate n°2AFOSWT8266



 15.0 x 18.6 18 Read

Find all the models available at this address. Image sources: esp8266.com.

Which model of ESP8266EX to choose for your DIY projects in 2018

Espressif has simplified its range and consequently the choice. All four versions ship the same ESP8266EX module. Completed the 4MB or 16MB versions that the Wemos d1 mini Pro has never been able to exploit elsewhere. Now we will have to settle for 2MB. Do not worry, it’s good enough for most applications. The memory of the ESP8266 is not intended to store data, we can always use an SD board reader for that.

At the moment, ESP8266EX-based development boards are still non-existent. There are some modules on AliExpress like this with the mention Special Client Only. It will therefore still wait a few months, the time that manufacturers use their inventory of old models.

esp8266ex esp wroom 02 special clien only szytf

If you have the necessary equipment and skills, you can buy the chip directly in a standard QFN32 package.

esp8266ex qnf32 chip esp wroom 02

adaptateur adaptor esp8266 esp-07 esp-12 esp-12e

Which older generation model to choose?

Although Espressif has simplified the entire ESP8266 familly in 2018, the old modules are still on sale. Before 2018, there were many versions of the ESP8266 (about 18). However, among all these models, there are very few that are suitable for use for DIY projects (without tinkering pinning), this is the case of ESP-01 and ESP-05.Which model to choose for your DIY projects

All other models are assembled in the form of a soldering PCB (SMD). You will most often find them already integrated in an Arduino board but there are also 2.54mm pitch adapters for breadboards on which you will be soldering an ESP8266 module (ESP-07, ESP-08 or ESP-12). The most popular model is the ESP-12E (or E/Q).

ESP-01 (obsolete)

esp8266 esp-01The ESP-01 is probably the best known module (and the most sold). This very compact module, no bigger than a 2€ coin (14.3 x 24.8mm), has 512kB of flash memory , an antenna printed on the PCB as well as 2 GPIO pins. This is the module is ideal to add a WiFi connection to an Arduino project for less than €3.

The ESP-01 is not directly usable on a breadboard. Second, it is not CE or FCC certified. I noticed some disturbance of the WiFi of neighboring devices when powering up. It may be due to my equipment.

ESP-05 (obsolete)

esp8266 esp-05Unlike the ESP-01, the ESP-05 does not have a GPIO pin. Very compact (14 x 14 mm). The ESP-05 has 4 pins in pitch of 2.54mm (so compatible with a breadboard) 3.3V, GND, RX and TX. You will also find some models with a 5th pin Reset. It will be perfect to add a WiFi connection to an Arduino project for around €3.25.

Pay attention to the time of purchase because all models sold do not seem to be delivered with the same firmware.

ESP-12E or ESP-12F (replaced by ESP8266EX)

wemos d1mini carte wifi dveloppeurs esp8266nodemcu luaThe ESP-12E is an improved version of the ESP-12. The ESP-12E has 11 GPIO pins as well as an analog / digital converter (ADC) with a resolution of 10 bits.

This is the module used by almost all NodeMCU boards. Compact and versatile, it is the ideal board for creating connected objects projects.

To begin, I recommend the WeMos d1 Mini development board. It is fully supported by the Arduino IDE. No need to put the board in Bootloader mode whenever you want to upload the program from the Arduino IDE

WEMOS D1 mini V3.0.0 - WIFI Internet of Things development board based...
CHF 3.65
Buy this item
aliexpress.com Aliexpress
WeMos® D1 mini V2.2.0 WIFI Internet Development Board Based ESP8266 4MB FLASH...
CHF 6.70

How to power an ESP8266 module

Some ESP8266 modules must be powered by 3.3 Volts and no protection exists. Here are several solutions to feed your modules.

Another important point to know. If you have to reinstall the firmware (NodeMCU or ESPEasy for example), the power supply must be able to deliver 300mA during the flashing of the firmware. Some FTDI cables can not deliver sufficient power. In this case, an external power supply will be required.

Solar Powerbank

powerbank solar 5v esp8266 esp32 arduino raspberrypiThe ESP8266 is ideal for making connected objects that run on battery power. In sleep mode, the power consumption does not exceed 20 μA (on the new models ESP-WROOM-02 / ESP8266EX at least). It is possible to manufacture its own solar power circuit but there is an even more practical solution, the solar Powerbank. Place the Powerbank in a brightly lit place, ideally in direct sunlight to ensure a full charge during the day.

Some tips to save battery and ensure a continuous operation of your objects:

  • Turn on Deep Sleep mode in your ESP8266 and ESP32 programs. The power consumption will be limited to 20 μA.
  • Limit the sending of data to a minimum. Use optimized technology for fast, lightweight data transfer. For example MQTT or the Websocket
  • Limit the frequency of sending data to a server (local or remote). The WiFi connection is very greedy in energy.
  • Optimize your code by limiting energy consuming calculations.
  • Use the interrupts to wake up the module when an actuator is pressed (bell button,
  • Use energy-saving sensors. Do not use a physico-chemical sensor of the MQx series (for example the MQ2 or MQ135). They must be hot (permanently) so that pollutant measurement is possible. Instead, use self-calibrating sensors such as the MH-Z19 to measure CO2 content.
  • If your project uses energy-consuming actuators (servomotor, Nema motor …), opt for a very big Powerbank (at least 20000mAh)
  • The performance of the batteries decreases when the temperature drops (even more below 0 ° C), isolate the Powerbank to protect the battery.
  • Below 0°C, electrolytes (contained in capacitors for example) can freeze. Your projects may not work properly. It is not necessarily the Powerbank that is unloaded.

Read this tutorial to learn how to measure battery voltage using an Arduino or ESP8266.

Bakeey 5x18650 Dual USB Solar Energy Camping Flashlight 20000mAh Battery Case Power...
CHF 14.36
SVPRO Rechargeable Outdoors Solar Panel Charger,Dual USB Battery Pack,Flashlight External Battery Charger...
Buy this item
diyprojects.io Amazon Marketplace
-50% F.Dorla® 30000mAh Solar Charger Waterproof Portable Solar Power Bank Dual USB Charger...
$19.99 $39.99
Buy this item
amazon.com Amazon.com
Waterproof 300000mAh Portable Solar Charger Dual USB Battery PowerBank

The complete selection of Solar Powerbank

2xAA batteries holder

ESP is ideal for developing connected object projects. The first solution to power your projects is to use a case for AA batteries. Depending on the number of 1.5V batteries, the voltage delivered by the power supply box will be higher or lower. For example with 4xAA 1.5V batteries, we can supply the module in 6V. Beyond, for example with a box of 6xAA batteries that can deliver 9V, it will be necessary to add a voltage regulator (for example a detailed LD1117V33 below).

6*AA Battery Holder Case with Lead Wires
6*AA Serial Battery Holder Case
6*AA Battery Case for Yaesu/Vertex Standard Two-Way Radio
5 Pcs ON/OFF Switch Cases Holders for 4x1.5V AA Battery in Series
Buy this item
amazon.com Amazon.com

The complete selection of 4xAA batteries holder

LiPo 3,7V battery

wemos d1 mini shield batterie lipoSome development boards come with a JST connector for LiPo battery. This is for example the case of Olimexino-85S. WeMos offers a LiPo battery shield equipped with a JSH XH2-2.54mm connector that allows to power and charge the battery simultaneously.

Features of the shield battery for Wemos d1 mini

  • Charging voltage: nominal 5V (max 10V)
  • Load current: 0.5A by default. Solder the jumper J1 to increase to 1A (be careful, check the compatibility with the battery before any modification)
  • Supported Lithium Battery: 3.3 to 4.2V
  • Voltage converter up to 5V (max. 1A)
  • Battery connector in JST XH2-2.54mm
  • Micro-USB connector (OTG) for recharging (5V, max 10V)
  • Green Led: On when charging is complete
  • Red Led: On during charging
  • Jumper J1: Increases the load current from 0.5A to 1A
Battery Shield For WeMos D1 mini single lithium battery Charging & Boost
WeMos® D1 Mini Single Lithium Battery Charging And Battery Boost Shield
CHF 4.13
5Pcs WeMos D1 Mini Single Lithium Battery Charging And Battery Boost Shield
CHF 14.36

Opt for a battery of at least 850mAh for a connected probe project that publishes on a WiFi server its measurements every hour.

3.7V 1100mAh Lipo Polymer Battery For mp3 PAD Cell phone Camera radio...
YDL 3.7V 2000mAh 654065 Lipo battery Rechargeable Lithium Polymer ion Battery Pack...
Buy this item
amazon.com Amazon.com
Eachine VR006 3.7V 500mAh LiPo Battery Molex Pico 1.25mm 2P Connector For...
CHF 12.62

Shield for 18650 battery

shield batterie 18650 esp32 esp8266 raspberry pi dessusSold less than $2 / $2.3 on AliExpress or eBay, this shield makes it very easy to power your projects of connected objects and even a Raspberry Pi using a LiFePO4 18650 battery. The board is equipped with a circuit allowing to charge the battery (pay attention to polarity) even when operating with a micro-USB connector. It is possible to feed multiple boards simultaneously with 3 output 5V and 3 output 3.3V (solder pins) and a conventional USB connector. Here are the characteristics of the board

  • Power supply: 5 to 8V via micro USB port up to 0.5A
  • Output power
    • 5V via USB Type A port
    • 3 connectors to deliver 3V up to 1A
    • 3 connectors to deliver 5V up to 2A
  • Misc: 1 USB output, LED for the state of charge (green = battery charged, red = charging)
  • Battery protection (overcharging or over-discharging). Attention, no protection in case of reverse polarity
  • Dimensions: 98 x 29 mm
3V/5V Wemos ESP32 18650 Battery Shield V3 ESP-32 for Arduino Raspberry Pi
Wemos® 18650 Battery Shield Expansion Board
CHF 5.16
18650 Battery Shield Expansion Board

Depending on your project and how often you send the data, choose a large capacity battery.

Samsung SDI INR18650-25R LiNiMnCoO2 Industriezelle Batterie (3,6 Volt, 2500mAh, 10C, 2er Pack)...
10.77 1 used from €7.99
Buy this item
amazon.de Amazon.de
2 Samsung INR18650-25R 18650 2500mAh 3.6v Rechargeable Flat Top Batteries (Green)
Buy this item
amazon.com Amazon.com
Soshine 2pcs 18650 3.7V 3400mAh Rechargeable Li-ion Lithium Battery with PCB Protected...
Buy this item
tomtop.com TOMTOP Technology Co., Ltd
2 x Fogstar 18650 3.7V 3000mAh 20/30A Premium Vaping Battery - Flat...
Buy this item
amazon.co.uk Amazon.co.uk

3.3V 5V arduino power supply breadboard alimentation électrique3.3V or 5V breadboard power supply

During the entire development and development phase of your project, it is very practical to use a breadboard with a 5V / 3.3V power supply. There are breadboard power boards for less than €2.

MB102 Breadboard Power Supply Module
2 Channel 5V/3.3V Breadboard Power Supply Module for Arduino
Buy this item
dx.com DealExtreme
Breadboard Power Supply Module 3.3V 5V Arduino Board + Breadboard 830 Point
Buy this item
newfrog.com Newfrog.com
JBtek Breadboard Power Supply Module 3.3V/5V For Arduino Board Solderless Breadboard
Buy this item
amazon.com Amazon.com

3.3V power supply using LD1117V33 voltage regulator

You can use an old power supply of a smartphone. For this you will need a jack adapter with a screw terminal and a voltage regulator (LD1117V33 for example) to deliver the 3.3 Volts needed for the ESP8266. Be careful not to exceed the recommended supply voltage (technical documentation). Finally, take into account in the design of your projects that the LD1117 heats (a lot). You can also add a 10μF capacitor for a more stable power supply.

alimentation 3.3V breadboard arduino LD1117 jack

Buy this item
amazon.com Amazon.com
(6-Pcs) STMicroelectronics 3.3V 950mA, LD1117V33 Voltage Regulator, LD33V
Buy this item
amazon.com Amazon.com
20 pcs LD1117 LD1117V33 3.3V 800mA Linear Voltage Regulator TO-220 NEW L8

How to program an ESP8266 module

USB cable or FTDI module?

module ftdiThe ESP-12 (or ESP-12E) modules are usually equipped with a USB port. A simple micro-usb cable will be enough. Some boards must be programmed using a Serial / USB adapter, called the FTDI module that can be purchased for around €2.50.

Be careful though. Some FTDI cables are not able to deliver the 300mA needed for the upload.

Funduino FTDI Basic Program Downloader USB to TTL ET232 Module
Buy this item
dx.com DealExtreme
-14% HiLetgo FT232RL FTDI Mini USB to TTL Serial Converter Adapter Module 3.3V...
$5.99 $6.99
Buy this item
amazon.com Amazon.com
6Pin FTDI FT232RL USB to Serial Adapter Module USB to TTL/RS232 Cable
Buy this item
dx.com DealExtreme
Adafruit FTDI Serial TTL-232 USB Cable [ADA70]
Buy this item
amazon.com Amazon.com

ESP Easy: no programming needed

ESP Easy is a firmware that allows you to program, or rather configure, the ESP module on which it is installed. To learn more, read this introductory article that explains how to install the firmware.

espeasy plugin playground develop

To go further, here are the latest tutorials published on the ESP Easy firmware

Develop in C++ with the Arduino IDE

If you are new to Arduino programming or are new to ESP8266, this is probably the easiest way to get started. The ESP8266Wifi library is now very advanced and greatly simplifies programming. This is an argument that also favors the Arduino IDE. Read this tutorial to get started with the ESP8266 modules and the Arduino IDE (installation of libraries, GPIO, Web Server, Web Client).

esp8266 web server spiffs bootstrap dht22 bmp180 google charts

Pin correspondence between Arduino and ESP8266 (NodeMCU)

The ESP8266 is programmed exactly like an Arduino, it will just need to look for the matching pins for your board. Here is for example the correspondence of the pins of a Wemos D1 Mini.

Correspondance Pins GPIO WeMos D1 mini

In Lua (NodeMCU)

NodeMCU is a firmware that allows you to program ESP8266 modules in a language called Lua. You can consult the open-source project NodeMCU here. There are two versions of NodeMCU:

  • NodeMCU v0.9 for ESP-12 modules
  • NodeMCU v1.0 for ESP-12E modules

To program in Lua, the simplest is to use ESPlorer presented (quickly) in this article.

In MicroPython

If you already have some Python knowledge, you can install the MicroPython firmware. It is a Python language port for ESP8266 modules. The syntax is exactly the same. We find all the basic functions of the language as well as functions specific to ESP8266 modules. Management of WiFi, GPIO …

Here is a series of tutorials to start in MicroPython

How to install a firmware ?

It is very simple to change the firmware of an ESP8266. Be aware that the firmware (NodeMCU, ESP Easy) is cleared as soon as you upload from the Arduino IDE. Here are several articles that deal with the subject.

NodeMcu Lua WIFI Internet Things Development Board Based ESP8266 CP2102 Arduino
Buy this item
newfrog.com Newfrog.com
Geekcreit® NodeMcu Lua WIFI Internet Things Development Board Based ESP8266 CP2102 Wireless...
CHF 4.78
-10% ESP8266 ESP-12 NodeMCU Lua WiFi Internet Things Development Board esp8266 nodemcu V3...
CHF 5.26 CHF 5.91
Buy this item
aliexpress.com Aliexpress
ESP8266 microcontroller NodeMCU Lua WIFI with CP2102 USB
Buy this item
amazon.com Amazon.com
NodeMCU LUA WIFI Internet Development Board Module Based on ESP8266 ESP-12E CH340G
Buy this item
amazon.co.uk Amazon.co.uk
NodeMcu Lua CH340G ESP8266 Wi-Fi Internet Development Board Module
Buy this item
dx.com DealExtreme
3Pcs Geekcreit® NodeMcu Lua WIFI Internet Things Development Board Based ESP8266 CP2102...
CHF 14.36
5Pcs NodeMcu Lua ESP8266 CH340 WIFI Internet Development Board Module
Buy this item
newfrog.com Newfrog.com


Click to rate this post!
[Total: 3 Average: 5]

Thanks for your reading

Did you like this project ? Don't miss any more projects by subscribing to our weekly newsletter!

Are you having a problem with this topic?

Maybe someone has already found the solution, visit the forum before asking your question
We will be happy to hear your thoughts

Leave a Reply

Read more
DIY Projects
DIY Projects