In this post we’re going to do a comparison: ESP32 vs ESP8266.
The ESP32 and ESP8266 are cheap Wi-Fi modules perfectly suited for DIY projects in the Internet of Things (IoT) field. These modules come with GPIOs, support for a variety of protocols like SPI, I2C, UART, and more. The best part is that they come with wireless networking included, which makes them apart from other microcontrollers like the Arduino. This means that you can easily control and monitor devices remotely via Wi-Fi for a very low price.
The ESP32 is the ESP8266 successor. It adds a CPU core, faster Wi-Fi, more GPIOs, and supports Bluetooth 4.2 and Bluetooth low energy. Additionally, the ESP32 comes with touch sensitive pins, and built-in hall effect sensor and temperature sensor. Both boards are very cheap, but the ESP32 costs slightly more. While the ESP32 can cost around $6 to $12, the ESP8266 can cost just $4 to $6 (but it really depends on where you get them).
The following table shows the main differences between the ESP8266 and the ESP32 processors (table adapted from: AMICA_IO).
ESP8266
|
ESP32
|
|
---|---|---|
|
|
|
MCU
|
Xtensa Single-core 32-bit L106
|
Xtensa Dual-Core 32-bit LX6 with 600 DMIPS
|
802.11 b/g/n Wi-Fi
|
HT20
|
HT40
|
Bluetooth
|
X
|
Bluetooth 4.2 and BLE
|
Typical Frequency
|
80 MHz
|
160 MHz
|
SRAM
|
X
|
✓
|
Flash
|
X
|
✓
|
GPIO
|
17
|
36
|
Hardware /Software PWM
|
None / 8 channels
|
None / 16 channels
|
SPI/I2C/I2S/UART
|
2/1/2/2
|
4/2/2/2
|
ADC
|
10-bit
|
12-bit
|
CAN
|
X
|
✓
|
Ethernet MAC Interface
|
X
|
✓
|
Touch Sensor
|
X
|
✓
|
Temperature Sensor
|
X
|
✓
|
Hall effect sensor
|
X
|
✓
|
Working Temperature
|
-40ºC to 125ºC
|
-40ºC to 125ºC
|
Price
|
$ (3$ - $6)
|
$$ ($6 - $12)
|
Where to buy
|
The ESP32 has more pins than the ESP8266, and you can decide which pins are UART, I2C, or SPI – you just need to set that on the code. This is possible due to the ESP32 chip’s multiplexing feature that allows to assign multiple functions to the same pin. If you don’t set them on the code, they will be on the pins defined by default as shown in the following figure (this is an example for the ESP32 DEVKIT V1 DOIT board – the pin location can change depending on the manufacturer).
You can set PWM signals in any GPIO with configurable frequencies and duty cycles set on the code. When it comes to the analog pins, these are static, but the ESP32 supports measurements on 18 channels (analog-enabled pins) versus one 10-bit ADC pin on the ESP8266. The ESP32 also supports two 8-bit DAC channels.
Additionally, the ESP32 contains 10 capacitive sensing GPIOs, that detect touch and can be used to trigger events, or wake-up the ESP32 from deep sleep, for example.
There are many ways to program the ESP boards. Currently, both boards can be programmed using the Arduino IDE programming environment.
This is is a good thing, specially for those who are used to program with the Arduino and are familiar with the Arduino programming language. Learn how to install the ESP32 or ESP8266 in your Arduino IDE:
Although you can program both boards using Arduino IDE, they might not be compatible with the same libraries. Some libraries are just compatible with one of the boards.
If you want to get started with the ESP32 or ESP8266, you can take a look at our courses and projects:
So, at this point you should be asking: Should I get an ESP8266 or an ESP32?
It really depends on what you want to do. There is space for both boards, and both have pros and cons.
The ESP8266 is cheaper than the ESP32. Although it doesn’t have as much functionalities, it works just fine for the majority of simple DIY IoT projects. Additionally, because it is “older” it is much more supported in terms of software, and you might find help easier. However, it has some limitations when it comes to the GPIO mapping, and it might not have enough pins for what you intend to do. If that’s the case, you should get an ESP32.
The ESP32 is much more powerful than the ESP8266, contains more GPIOs with multiple functions, faster Wi-Fi, and also supports Bluetooth. Many people think that the ESP32 is more complicated to deal with than the ESP8266 because it is more complex. In our opinion, it is as easy to program the ESP32 as the ESP8266, specially if you intend to program it using the Arduino language.
However, the ESP32 has some cons too. First, it is more expensive than the ESP8266. So, if you’re making a simple IoT project, the ESP8266 might do the trick for a lower price. Additionally, because it is more recent than the ESP8266, not all software has been developed to take the most out of the ESP32 functionalities, there is less support, and more bugs. But on the long run these issues will be fixed, and there will be space for both boards.
نظرات (0)
نظرات خود را ارسال نمایید