It was about time that we talked about the ESP8266 and the ESP32 in the blog, two machines that are causing a stir at the moment and carving out a prominent place in this fashionable world of IoT.
When the first modules with the ESP866 appeared, many of us thought “well, finally an affordable Wifi module for Arduino” because, at that time, the shields and Wifi alternatives for Arduino were prohibitively expensive.
However, many members of the community quickly saw the potential of this small processor, whose characteristics and low price have made it very successful in a short time.
Right now, both the ESP8266 and the ESP32 are setting trends and demonstrating day by day why they are, today, some of the main representatives of IoT.
In fact, many commercial products are based on these chips. A clear example is the Sonoff products from Itead, which allow you to automate your home for very little money. According to Espressif, its manufacturer, they have sold more than 100 million units.
In fact, it is such an interesting product and so relevant within the #maker sector that we are going to create its own section in the blog, so that it coexists within the Arduino tutorials.
But first, let’s start from the beginning by looking at what the ESP8266 is. In the next entry we will see its “big brother” the ESP32.
What is the ESP8266?
The ESP8266 is a SoC (system on chip) manufactured by the Chinese company Espressif. This SoC groups different components into the same integrated circuit, the main ones being a 32-bit processor and a WiFi chip with TCP/IP stack management.
In summary, the ESP8266 is a chip that integrates a general-purpose processor with complete WiFI connectivity in a single package.
The processor integrated in the ESP8266 is a 32-bit Tensilica L106 with RISC architecture that operates at a speed of 80Mhz, with a maximum speed of 160Mhz.
The ESP8266 does not incorporate Flash memory inside the SoC, so it has to be provided by the module on which it is mounted. The connection between the memory is done by QSPI but, normally, its use is transparent to us.
What is important to note is that the available memory varies between modules, it is not determined by the ESP8266. It is common to find models that mount from 1MiB to 8MiB, with a maximum of 16MiB.
These are some of the most relevant features:
- 32-bit low power processor
- Speed of 80MHz (maximum of 160MHz)
- 32 KiB RAM instructions, 32 KiB RAM cache
- 80 KiB RAM for user data
- External flash memory up to 16MiB
- Integrated TCP/IP stack
- Wifi 802.11 b/g/n 2.4GHz (supports WPA/WPA2)
- Certified by FCC, CE, TELEC, WiFi Alliance and SRRC
- 16 GPIO pins
- PWM on all pins (10 bits)
- 10-bit analog to digital converter
- UART (2x TX and 1x RX)
- SPI, I2C, I2S
- Operating voltage 3.0 to 3.6V
- Average consumption 80mA
- Standby mode (1mW) and deep sleep mode (1uA).
History of the ESP8266
Without going into much depth, the history of the ESP8266 and its superior brother ESP32 begins in August 2014 with the appearance of the ESP01 modules from the manufacturer AI-Thinker.
At that time, the way to communicate with the ESP8266 was through AT modules, the documentation was scarce and in Chinese, and the SDK was complex and not very accessible, so its usefulness was still limited. But that did not prevent its potential from being seen and the community and different manufacturers began to work actively on it.
Another important milestone was the appearance of the NodeMCU firmware, which also gives its name to a development board. This firmware allowed programming the ESP8266 with LUA, a semi-compiled language based on C and Perl.
The community’s work continued generating documentation, tutorials, and tools. This led to the next big milestone, the release by the community of alternative Open Source SDKs for the ESP8266 based on the GCC toolchain.
This allowed programming with the Arduino environment using the ESP8266 Arduino Core. This was the definitive catapult for the ESP8266 in the maker sector, and it allowed it to benefit from the support of the huge community of Arduino enthusiasts.
Espressif reacted (or saw the potential, or decided to support the community) and generated new SDKs with a license similar to MIT, which in a way provided support to the user community.
Since then, a large number of manufacturers have generated development boards that integrate the ESP8266. Some of the most famous, among others, are the NodeMCU and the WeMos, both with different variants. We will be seeing these boards soon.
In September 2016, the ESP32 was released, a much superior model that solved some shortcomings of the ESP8266. It has a slightly higher price but, if the ESP8266 is powerful and interesting, the ESP32 is directly a powerhouse. Support and documentation for the ESP32 are still inferior, but growing rapidly. We will see the ESP32 and its features in future entries.
Types of modules with ESP8266
There are different modules that integrate the ESP8266 SoC. The main characteristics of these modules are similar and, basically, they differ in the available Flash memory and their physical form, which in turn conditions the number of GPIO pins they have accessible.
In some boards (the fewest) the GPIOs are pin-shaped, so it is possible to solder a cable, or connect a terminal. But in most cases, the modules are “half-pin” shaped, as they are intended to be integrated (soldered) on PCBs or development boards.
To put it simply, by a large margin the most common modules are the ESP01 and the ESP12/ESP12E. The rest are quite rare.
The ESP01 is very popular for being the first to appear, for its small size and reduced price. It is often used to provide connectivity to an Arduino-based solution (act as a “Wifi shield”) as we saw in this post. Although it can also be used for developments that require few GPIOs (it only has 2 available).
On the other hand, the ESP12 and its variant ESP12E are becoming the preferred model of the ESP8266, and are mounted on a large number of development boards and commercial products.
In future entries, we will delve into the very interesting world of the ESP8266 and the ESP32, different available development boards, how to program them, and tutorials to illustrate some of the possible uses of these two SoCs that are driving IoT development.