I tried so many boards over time, and let me say that I fell in love with the Raspberry Pi. However, this article is not about ARM boards. Today, I want to introduce to you my new purchase, the ESP32.
What the heck is an ESP32?
First of all, if you don’t have much experience with this kind of stuff, you may be asking yourself what’s so special about this board, and why is everyone talking about it. Well, my friend, the truth is that nowadays things like IoT are becoming a big thing, and everyone wants to experience the coolness of having things connected to the Internet.
But that’s not all. In addition to this, the ESP32 is one of the smallest, most versatile, complete and cheapest boards ever produced.
And that’s pretty much it! If you have ever tried Atmega328 powered boards such as Arduino you know what I’m talking about. And the ESP32 makes no difference, at least from an applicational viewpoint.
At the time of writing this article, I haven’t done anything special with my ESP32, but I have some idea and I want to start my journey fresh along with you and learn how to use it.
ESP32 vs Arduino Uno…
Let’s first start with the obvious stuff that nobody knows. Arduino is produced in Italy and the chip on it is manufactured by Atmel. On the other hand, the vast majority of ESP32 boards are made in China (the invention is Chinese). Nevertheless, the main chip on it is produced by Cadence, a Californian company based in Silicon Valley.
The difference is enormous, and aside from the discrepancies in the construction quality the two boards work using a completely different architecture.
ESP32, the impressive one
The ESP32 comes with a processor also known as data plane processing unit (DPU) called Cadence Xtensa LX6. This processor is very basic, though it’s much more powerful than the one available on the Arduino boards. It sports a variable clock speed of 160 or 240 Mhz, it’s dual-core and it’s extremely optimized to ensure the lowest power consumption possible.
Not to mention that the general features of the ESP32 are really remarkable! It’s a small and compact board which comes with:
- Cadence Xtensa LX6 processor (datasheet)
- WiFi 2.4 GHz
- Bluetooth 4.2 Low Energy
- 520 KiB of RAM
- 18 channels ADCs at 12 bits
- 2 x 8-bit DACs
- 10 GPIO pins able to detect touch sensing devices such as a screen
- 4 SPI ports
- 2 × I²C interfaces
- 2 × I²S interfaces
- 3 x UARTS
- SD/SDIO/CE-ATA/MMC/eMMC host controller
- SDIO/SPI slave controller
- Ethernet MAC interface with dedicated DMA and IEEE 1588 Precision Time Protocol support
- ROM: 448 KiB
- SRAM: 520 KiB
- Up to 4MB of internal flash memory, expandable
- CAN bus 2.0
- Infrared remote controller (TX/RX, up to 8 channels)
- Motor PWM
- LED PWM (up to 16 channels)
- Hall effect sensor
- Ultra low power analog pre-amplifier
Is that all? The answer is: Nah…
- IEEE 802.11 standard security features all supported, including WFA, WPA/WPA2, and WAPI
- Secure boot
- Flash encryption
- 1024-bit OTP, up to 768-bit for customers
- Cryptographic hardware acceleration: AES, SHA-2, RSA, elliptic curve cryptography (ECC), random number generator (RNG)
- Internal low-dropout regulator
- Individual power domain for RTC
- 5μA deep sleep current
- Wake up from GPIO interrupt, timer, ADC measurements, capacitive touch sensor interrupt
(The information provided above come from a dedicated page on Wikipedia, if you want to know more about specific releases and versions check out this link)
Arduino Uno, basic but not cheap at all
One of the reasons that brought me to buy Arduino (several Unos and Megas) is the support provided to develop the platform. Albeit being released years ago, these boards are still kicking. The Arduino compiler is a joy to use, especially for beginners.
This might not be enough, considering what the ESP32 is capable of doing alone. Oh and even the ESP32 is programmable with the same Arduino IDE.
ESP32 vs Arduino, a fair match?
Arduino is awesome. It’s produced in my home country so it’s the best ?
Haha, jokes apart… as I said previously, they are very different boards.
Consequently, I think that there isn’t a real winner here, it depends on the project you are trying to develop.
The main reasons I can find right now when suggesting you which board to buy are the following.
Reasons to choose the ESP32:
- You need something small yet powerful enough to run Micropython as a programming language, ExpressIF, and execute intensive tasks;
- You need something with more than one core. Its dual-core architecture supports parallel tasks natively. Parallel execution means that if you are trying to process long blocking tasks you can break them into pieces and run them in parallel and even with an asynchronous manner;
- Some expansion modules are really interesting. You could choose for example to build a security cam and use the camera module to read the sensor and stream the data in real time;
- You want the impressive IO showed above. It’s really complete. It’s easy to connect and use;
- Something super-small is needed for your project. To keep into consideration is also the fact that you’ll have integrated WiFi and Bluetooth 4.2 support (otherwise you’ll have to buy the right shield for Arduino);
- You are a geek, expert or someone that is looking for something fresh to try (like me);
- You need quite a lot of memory for your program, both RAM and ROM
- The price is extremely competitive for what the board has to offer
Reasons to choose the Arduino (One or Mega):
- You want unrivaled support. Arduino has so many libraries, it’s supported by everyone and everywhere;
- It’s the best board to begin programming with. And, if you are a beginner, just start with it. Buy an Arduino one and have fun;
- You enjoy the thousands of how-to guides available online, you want to reproduce an existing project based on Arduino;
- To tell the truth, the price is not really that high but compared to the ESP32 the IO is pretty similar. However, the Arduino board is really invincible if you consider how many expansion boards are available out there;
- The Arduino Mega has a LOT of useful IO ports too, although, you might find less interesting Arduino Uno;
- If you go for the original Arduino and not clones, you’ll come home with a board made with remarkable construction quality.
Price and availability
The board can be yours for about $4. This is what makes the ESP32 so successful. There is almost nothing similar to this board available at this price.
Unfortunately, costs are strictly dependant on where you buy it. Websites like AliExpress it can be yours for less than 5 bucks thus the shipping takes a lot of time. So, unless you choose Amazon, be ready to wait up to 50 days before putting your hands on it.
To know more about the board
Talking about the ESP32 covering all the details is almost impossible. Though you are lucky! There are a bunch of resources that you can check out if you are interested in this board.
My favorite one is http://esp32.net/, on this website, there is all you might want to know.