ESP32 vs ESP8266: What's the difference and which one should you use?



ESP32 vs ESP8266: These are two microcontrollers created by Espressif systems and they are extremely popular in Arduino projects as they provide built-in WiFi connectivity so you can roll your own IOT systems. Another reason, for their popularity is that you can program them using the familiar Arduino IDE.

Both are 32bit processors, and both support WiFi connection and include all the standard Arduino interfaces such as ADC, I2C, SPI UART, PWM, but there are some important differences that wet will cover in this aricle.

ESP32 vs ESP8266: Core Differences

The ESP32 is the newest of the two chips and as you would expect it is the more powerful of the two. There are a few areas that provide the most obvious differences:

Parameter
ESP32
ESP8266
Max Clock Speed (MHz)
240[1]
160[1]
Number of cores
2
1
SRAM size (kByte) 320 80
Flash Size (MBytes) 4
4

[1] The default speed of the ESP32 is 160MHz unless you decide to program it to 240MHz.
[2] The default speed of the ESP8622 is 80MHz un

less you decide to program it to 160MHz.

Interestingly the 4MByte Flash size is the same size in both chips. The is because it is quite hard to fill up that memory with a program - most of your programs will use only a tiny fraction of that to implement your ideas.

This is also why you can dedicate some of the Flash memory to a file system called SPIFFS or FATFS. That allows you to do some fancy stuff emulating an SD card within the flash memory itself.

So the main difference comes down to speed, and for the ESP32 that is twice the speed of the ESP8266. Additionally the ESP32 has a dual core architecture further enhancing performance. The ESP32 also has far more SRAM than the ESP8266; actually four times the ESP8266 SRAM.


Note: The ESP32 is twice the speed of the ESP8266 and is dual core.

Additional features of the ESP32


The ESP32 also has the following extra hardware modules:

(Note this ESP32 is not the ESP32-2S - which does not have bluetooth).

Feature
ESP32
ESP8266
Bluetooth Classic
Yes
No
Bluetooth Low Energy
Yes No
Magnetic Hall Sensor
Yes No
Temperature Sensor
Yes No
GPIO
34
16
DAC (8 bit)
2 modules
No
ADC
12 bit
10 bit
SPI
4 modules
1 module
I2C
2 modules
0 [*]
I2S [1]
1 module 1 module
UART
3 modules
2 modules
Ethernet MAC
built in
No
Ultra Low Power Processor (ULP) Yes No

[*] - Implemented in software.
[1] - I2S for high quality stereo audio (can adapt for other serial data uses).

Low power operation

When you create a useful IOT device such as an ESP8266 it will inevitably be used for stand alone battery powered operation. There's a big problem in that when a 32bit processor is operating at 160/80MHz  (240/160MHz for the ESP32) then power consumption will be through the roof.

You need that computational power to create the 802.11b/g/n WiFi operation but it is also true that while you need that to communicate to a web page you can design a system that only periodically updates an output. For instance you may want to get a temperature reading only once an hour.

In this instance, you don't need the device powered up and continuously doing WiFi operations.

For both the ESP32 and the ESP8266 you can choose a low power operating mode - you can periodically wake the processor to transmit data over WiFi as needed, and this will save a lot of power. However, In the low power sleep modes you can't do a lot - only react to interrupts etc.

The ESP32 does have a ULP (Ultra Low Power) processor that is an entirely separate processor which can do simple tasks, even while the main system is asleep. The big problem with this processor is that it has a subset language and is very difficult to use. That said, if you really need ulra low power battery operation then this is the way to do it.

Conclusions

The ESP32 and ESP8266 processors are powerful options for Arduino projects, offering built-in WiFi connectivity and compatibility with the Arduino IDE. They both use 32-bit core technology with WiFi support but the ESP32 is the newer and more powerful chip, having a higher clock speed of  larger SRAM size of 320kBytes, enabling more complex programs and data storage.

Additionally, the ESP32 offers several additional hardware features absent in the ESP8266. These include:

  • Bluetooth Classic and Bluetooth Low Energy support,
  • a magnetic Hall sensor,
  • a temperature sensor,
  • more GPIO pins,
  • DAC modules,
  • a higher-resolution ADC,
  • multiple SPI and I2C modules,
  • an I2S module for high-quality audio, additional UART modules,
  • an Ethernet MAC,
  • Ultra Low Power (ULP) processor for battery-powered applications.

Both microcontrollers provide low power operation options by periodically waking the processor to transmit data over WiFi. However, the ESP32's ULP processor allows the main system to remain asleep while handling simple tasks, providing even greater power efficiency. Note though, that it is extremely hard to use.

When choosing between the ESP32 and ESP8266, consider factors such as additional hardware modules, SRAM size, and budget. The ESP32 offers more capabilities but has a steeper learning curve (although core WiFi operation is the same), while the ESP8266 remains a cost-effective solution with significant functionality. Regardless of the choice, both microcontrollers excel in building IoT systems with WiFi connectivity and the flexibility of the Arduino IDE.



Note: Parts of this page were written using chatgpt as a research assistant.



Comments

Have your say about what you just read! Leave me a comment in the box below.

Don’t see the comments box? Log in to your Facebook account, give Facebook consent, then return to this page and refresh it.



Privacy Policy | Contact | About Me

Site Map | Terms of Use