Espressif ESP32

ESP8266, ESP32 and ESP32-S2 comparison

Currently, there are 2 types of MCU from Espressif on the market: ESP8266 from 2014, ESP32 from 2016 and ESP32-S2 that debuted in the second half of 2019. Although ESP32-S2 is not yet very popular, it is expected it will replace ESP8266 as a cheaper, more powerful and more secure alternative in the upcoming years.

The table below compares the main features of ESP8266, ESP32 and ESP32-S2

ESP8266 ESP32 ESP32-S2
MCU Xtensa L106 Xtensa LX6 Xtensa LX7
Number of cores 1 2 1
Number of bits 32 32 32
Clock frequency 80MHz 160MHz 240MHz
Coprocessor No Yes Yes (RISC-V)
WiFi 802.11 b/g/n 802.11 b/g/n 802.11 b/g/n
Bluetooth No BT 4.2 BR/EDR & BLE No
RAM 160kB 520kB 320KB
Internal flash No ESP32‑D2WD Only – 2MB No
External SPIFlash Up to 16MB Up to 16MB Up to 1GB
GPIO 17 36 43
SPI 2 4 4
I2C 1 (software) 2 2
I2S 2 2 1
UART 2 3 2
ADC 1 18 20
ADC resolution 10-bit 12-bit 12-bit
DAC No 2 2
DAC resolution 8-bit 8-bit
Software PWM 8 16 8
SDMMC interface No Yes No
Temperature sensor No Yes Yes
Touch sensors No Yes Yes
CAN No 1 No
Ethernet MAC No 1 No
Espressif ESP32

Espressif ESP32-S2

When Espressif release ESP32 WiFi & Bluetooth capable MCUs back in 2016, many things changed in the DIY and tinkerers community. We finally had a cheap MCU that could do real IoT stuff and was easy to use. However, the cheap ESP32 is not really cheap in relative terms. Sure, it is cheap, but there are cheaper solutions. ESP8266 for example.

Yes, the old ESP8266 that lacks any built-in security and which power consumption is not that low even in a deep sleep mode. It was expected that Espressif would, sooner or later, offer an improved replacement for ESP8266. Cheaper than ESP32, but with features that ESP8266 lacked. Continue reading “Espressif ESP32-S2” »

ESP32 vs ESP8266

ESP8266 and ESP32 – the main differences

ESP8266 and ESP32 are the next best thing that happened to DIY world since Arduino itself. Thanks to development boards based on those MCUs brand new possibilities opened in front of all DIY and tinkering enthusiasts. With those two, not only we have cheap and powerful microcontrollers, but we can also make them talk to other devices via WiFi and Bluetooth.

ESP32 development board

Continue reading “ESP8266 and ESP32 – the main differences” »

ESP8266 and DS18B20 – wireless ThingSpeak sensor

Here is another small project of mine: battery operated ESP8266 ESP-01 WiFi thermometer using DS18B20 and ThingSpeak API to collect data.

Before we proceed, you should:

esp8266 ds18b20 thingspeak sensor

Continue reading “ESP8266 and DS18B20 – wireless ThingSpeak sensor” »

esp8266 low power mode

ESP8266 ESP-01 Low Power Mode – run it for months

Amazing ESP8266 ESP-01 WiFi boards have pretty irritating problem: theirs power consumption is pretty high. Minimal power consumption of about 70mA when doing nothing and above 100mA when when transferring data makes it rather impossible to use it on battery power for a longer period of time. Set of 2 AA batteries would be drained in less than a day. Not good.

There is a way to make ESP-01 work for months using something called deep sleep mode. When in deep sleep, ESP8266 disables almost all of its functions and reboots after specified period of time. There is one catch: ESP-01 is capable to enter deep sleep, but unable to restart and resume operation. XPD_DCDC MCU pin in not connected to RESET pin. To fix it, you would have to solder thin wire between XPD_DCDC and RESET pin just like on a picture below:

ESP8266 ESP-01 Deep Sleep hack

Continue reading “ESP8266 ESP-01 Low Power Mode – run it for months” »

Programming ESP8266 with Arduino IDE

One of the best things about ESP8266 ESP-01 WiFi modules is that they can be programmed
using popular and well known Arduino IDE and act as stand alone board with WiFi
capabilities. Thanks to ESP8266 group process of integrating ESP8266 and Arduino IDE
is pretty simple.

First step is to add to Additional Boards Manager URLs in Configuration in Arduino IDE.

Continue reading “Programming ESP8266 with Arduino IDE” »

WiFi telemetry for Cleanflight with EZ-GUI and ESP8266

Some time ago I have written a tutorial how to setup Bluetooth based telemetry link between Cleanflight and PC or smartphone. It’s simple and it works. But it has some disadvantages. For example, connection is very very slow and has a limited range: up to 10 meters. While it is enough to change PIDs before flight or plan a mission with EZ-GUI, it is not enough to have a real, usable and reliable, telemetry link.

ESP8266 ESP-01 Version 2

Luckily, Bluetooth is not the only cheap radio protocol we can use for purposes like this. Why not to use WiFi? Since market saw ESP8266 some time ago, cheap programmable WiFi modules became a reality. There are cheap, they are simple to use and can be programmed to do much more than just act as Access Point or network client. There are many alternative firmwares. For example ones that provides transparent bridges via TCP to allow pass serial ports over WiFi. Almost like serial over Bluetooth, but using WiFi instead. In theory that gives more range, higher speed and lower delay. Why not to use it to connect Android smartphone to drone flight controller and have nice an cheap telemetry solution? Exactly, why not. In this example how to do it with Android EZ-GUI and Flip32 running Cleanflight 1.12, but exactly the same trick can be used for Betaflight, SPracingF3, iNav, Baseflight, Naze32, APM, Pixhawx, MultiWii. If anything is using UART, it can also use ESP8266 as serial bridge over WiFi. Continue reading “WiFi telemetry for Cleanflight with EZ-GUI and ESP8266” »

how to flash esp8266

How to flash firmware to ESP-01 ESP8266 WiFi module

One can think that internet know everything about everything. Yesterday I’ve learned the hard way that is does not. It took me better part of evening to find a working way to flash firmware, any firmware, to cheap ESP-01 ESP8266 WiFi modules. There are many tutorials, most of them were just wrong in my case. If I had Windows PC, that might have been simpler. But I don’t.

ESP8266 ESP-01 Version 2

So, if you want to flash ESP8266 on any PC (Windows, Mac, Linux) here is what you should do: Continue reading “How to flash firmware to ESP-01 ESP8266 WiFi module” »