With the rollout of the ESP32-S2, learn the differences between it and the ESP32 and compare them to the ESP8266.
In August 2014 Espressif (at that time an unknown Chinese company) released the ESP8266. It was meant to be used as a Wi-Fi bridge for other microcontrollers until someone noticed it had way more processing power and memory than those other microcontrollers.
Later that year in November, the SDK went public and a hacker (Ivan Grokhotkov, now working for Espressif) released a project to support the ESP8266 from within the Arduino IDE. And as they say in the books the rest is history.
ESP32: A Solution to ESP8266’s Security Risk
Even though the ESP8266 has some limitations that could be overlooked, its huge success led to a bigger problem: security. There are literally hundreds of home appliances running on an ESP8266, from smart switches to smart light bulbs to LED drivers or even mosquito killers. And the ESP8266 does not provide any means to secure the code or the data it stores. Anyone with physical access to the device can read your more sensitive information, such as Wi-Fi credentials.
Espressif released the ESP32 in September 2016. The ESP32 tries to address all the issues of it’s bigger brother: it has lots of GPIOs, ADCs, and a DAC. It has a faster dual-core, Bluetooth, touch sensors and, most important, hardware encryption and code signature.
Still, there are few consumer products with an ESP32 inside, most still use the “old” ESP8266. Why? Some say it’s the price (Digikey sells ESP32 modules for about $3.8 and ESP8266 for $2.7). Others say it’s market inertia. Whatever the reason, it looks like Espressif realized they needed to offer a different answer to the market.
Introducing the ESP32-S2
In March 2019, some pictures of a new chip labeled “Chip7 2-2-A” were leaked. Since that time, there have been some speculations around it: that it’s BLE5, USB, Wi-Fi 5GHz, or something else. Speculations were put to rest last month when Espressif announced the ESP32-S2. Even though there is still some confusion about what the ESP32-S2 is, specs are more clear now.
Chip7 2-2-A was the first hint that the ESP32-S2 was in the works. Image by John Lee
According to Espressif “[w]ith state-of-the-art power management and RF performance, IO capabilities and security features, ESP32-S2 is an ideal choice for a wide variety of IoT or connectivity-based applications, including smart home and wearables.”
So, the Chinese company specifically aims at the IoT market with the ESP32-S2 in their press note. There is more about it, including some deceiving points. Let’s compare the three boards to see where each one falls.
ESP8266 Vs. ESP32 Vs. ESP32-S2
There are quite a few differences between the three boards, so let’s start with a comparison table.
| | | |
release Year
| 2014 | 2016 | 2019 |
Microcontroller | Xtensa single-core 32-bit L106 | Xtensa single/dual-core 32-bit LX6 | Xtensa single-core 32-bit LX7 |
Clock Frequency
| 80 MHz
| 160/240 MHz
| 240 MHz
|
Co-processor | No | ULP | ULP (RISC-V)
|
SRAM | 160 KB
| 520 KB
| 320 KB
|
ROM | No | 448 KB
| 128 KB
|
RTC Memory
| No | 16 KB
| 16 KB
|
External SPIRAM
| Up to 16MB
| Up to 16MB | Up to 128MB
|
External Flash
| No | No | Up to 1G
|
Wi-Fi (802.11 b/g/n)
| HT20 | HT20 | HT20 |
ESP-MESH | Yes | Yes | Yes |
Bluetooth | No | BT 4.2 BR/EDR & BLE
| No |
Ethernet | No | 10/100 Mbps
| No |
CAN | No | 2.0 | No |
Time of Flight
| No | No | Yes |
GPIO (total)
| 16 | 34 | 43 |
Touch Sensors
| No | 10 | 14 |
SPI | 2 | 4 | 4 (OSPI)
|
I2C | 1 (soft)
| 2 | 2 |
I2S | 2 | 2 | 1 |
UART | 2 (1 ½ actually) | 3 | 2 |
ADC | 1 (10-bit) | 18 (12-bit) | 20 (12-bit) |
DAC | No | 2 (8-bit) | 2 (8-bit) |
PWM (soft)
| 8 | 16 | 8 |
SDMMC | No | Yes | No |
RMT (remote control)
| No | Yes | Yes |
USB OTG
| No | No | Yes |
LCD Interface
| No | No | Yes |
Camera Interface
| No | No | Yes |
Temperature sensor
| No | Yes | Yes |
Hall sensor
| No | Yes | No |
Security | No | Secure boot Flash encryption 1024-bit OTP
| Secure boot Flash encryption 4096-bit OTP |
Crypto | No | AES, SHA-2, RSA, ECC, RNG
| AES-128/192/256, SHA-2, RSA, RNG, HMAC, Digital Signature
|
Low Power Consumption
| | | Automatic RF power management 5uA in idle mode 24uA at 1% duty cycle
|
ESP32-S2 Drawbacks and Benefits
As we can see, there are some improvements but also some steps back. The main complaints center around the missing Bluetooth or the Ethernet MAC. What I personally miss most is CAN support and I’m unsure about Time of Flight (TOF) support that would (theoretically) allow indoor positioning. On the other side, this is the first product by Espressif with built-in USB support.
When the Chip7 images first showed up in the media, some talked about the possibility of a 5 GHz Wi-Fi. I don’t see the reason for that on an IoT device as modern routers still support 802.11b specification which is 20 years old already. Why upgrade to a faster but more power-hungry and range limited protocol to transmit telemetry data or commands (a few kilobytes a day maybe)?
The lack of a dual-core processor is somehow balanced by the faster single-core LX7 and a much more powerful co-processor. It also has less SRAM and ROM but again it supports bigger external memories.
But the best feature about this new microcontroller is the ULP co-processor based on the RISC-V architecture. That should mean very low power consumption and more processing power compared to the one in the ESP32. The ESP32-S2 is also capable of dynamically turning off the Wi-Fi transceiver when not in use to save power. This allows for low power even with the Wi-Fi “on” pinging the router.
The datasheet talks about a low power mode of just 5uA (!!) and 24uA at 1% duty cycle. That means you can finally have a battery-operated Wi-Fi-enabled device — something not really feasible with previous versions (you don’t want to change batteries every week, do you?).
Is the ESP32-S2 Worth it?
I’ve been using (and I still do) ESP8266 prototyping boards and devices for some years now. But security is becoming a major concern (finally!!) and the ESP8266 is not a secure microcontroller. Over the last 2 years, I’ve watched the ESP32 gain momentum for IoT projects and find its way among other low-power, edge-computing devices (gateways, bridges...). Still, the ESP8266 refuses to give up its share in the smart devices market.
The new ESP32-S2 has dropped ballast while including new interesting features to look more appealing to the IoT devices market. It’s a lower cost than the ESP32 and USB-OTG, LCD, and camera support are great features for certain use cases.
With the new ESP32-S2, Espressif is trying to fill a gap between the ESP8266 and the ESP32, both in features and price. The ESP32-S2 is not an ESP32 killer. Instead, it’s more an ESP8266 killer — I hope it succeeds.
Cover image courtesy of Germán Martín.