The ESP32 from Espressif has been around for quite a few years now. For many of those years the ESP32 seemed to have the reputation that it was a low-cost maker module for hobbyist and developers interested in one-off projects. Over the past year I’ve seen the ESP32 not only designed into several production systems but have also seen its capabilities and ecosystem grow in ways that make it extremely interesting to many IoT developers. In today’s post, we’ll explore five reasons that I find the ESP32 to be an intriguing solution for the IoT.
Reason #1 – It is inexpensive
For many of the IoT systems that I’ve designed software for, I often found that good percentage of the bill of material (BOM) costs go towards connectivity and the microcontroller. It’s extremely interesting that the ESP32 modules are so inexpensive compared to many other connectivity solutions that are available on the market today. For example, if you take a look at the ESP32 modules that available on Digikeys website, you’ll find that these modules range from $3.80 to about $4.80 on average! These aren’t volume prices, but simply the cost to purchase modules one at a time.
Reason #2 – It’s a Bluetooth / Wi-Fi combo module
When it comes to the IoT, there is a definite need to be able to support multiple connectivity solutions. In some instances, Bluetooth may be preferred for local connectivity needs while a Wi-Fi connection is necessary for cloud and remote interactions with devices. When a single module can provide both solutions it’s definitely a win-win not just for the developer but also for the end user. If a product only requires a Wi-Fi connection, the Bluetooth stack can be disabled, or the Bluetooth can be left included as a feature to be added later. I’ve seen several clients who selected the ESP32 for its Wi-Fi features and then later enabled the Bluetooth in order to expand the feature set for their products.
Reason #3 – Extensive ecosystem support
The ESP32 has a surprisingly extensive ecosystem. While one might initially find a lot of the open source / hobbyist toolchains and libraries like the ones provided through the Arduino IDE, more professional environments are available as well. For example, Espressif offers development tools and software frameworks that appear robust enough to satisfy most embedded developers. There is even support for the ESP32 within the Amazon FreeRTOS ecosystem. Developers can download Amazon FreeRTOS and with cmake get an ESP32 running FreeRTOS connected to Amazon Web Services (AWS) within just a few hours.
Reason #4 – Options available with additional Flash and pSRAM
When I first started to work with the ESP32 modules, I lacked appreciation for the diverse number of modules that were available and their capabilities. In particular, I’ve found that the ability to scale a solution based on the amount of external flash that is included in the ESP32 module can be helpful in sizing data storage for an application. There are even some modules like the ESP32-WROVER that can extend RAM through the us of pSRAM which connects to the internal microcontrollers SPI bus. The pSRAM can extend the RAM by as much as 4MB, giving the module enough memory for nearly any application!
Reason #5 – Can install and run MicroPython
On top of all the other reasons that we’ve discussed so far in this post, the ESP32 is also an interesting solution because it’s possible to install MicroPython on the module and develop an application in Python. While I know that this is not necessarily a preferred solution for a production system, it does open the ability to rapidly prototype a system and prove whether it is feasible or not extremely quickly.
Installing MicroPython on an ESP32 is also simple. All a developer needs to do is:
- Install esptool in their Python tool by typing
pip install esptool
- Download the latest ESP32 MicroPython binary from https://micropython.org/download#esp32
- Erase their ESP32 development firmware using the command:
esptool.py --port /dev/ttyUSB0 erase_flash
- Flash the MicroPython firmware onto the ESP32 using:
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 esp32-20180511-v1.9.4.bin
Then a developer is up and running with MicroPython!
Now, I’m not trying to be an advocate or biased towards the ESP32 in any way. What I am trying to do is share how intriguing these modules have become for professional developers who are developing low-cost IoT products. The potential to use these modules to decrease costs through integrating multiple connectivity solutions all within a single module is high. The ability to extend the on-module memory even provides the potential that all a products smarts could also be included within the ESP32 module itself. Careful software partitioning could allow connectivity and real-time software constraints to both be handled on a single, low-cost module.
What do think? Have you used the ESP32 in your products or considered it? How did it go?
I use the ESP32 in station mode + AP. This allows me to store html JS CSS in flash. My phone, PC (browser) now becomes an extension to the ESP32 and operates in standalone mode without an internet connection. Complete with graphics display keyboard audio you name it. The ESP32 is a very powerful WIFI/BT platform to create a myriad, plethora, cornucopia, plenitude , a whole bunch of different kinds of products. Pretty cool module. The micropython port from loboris is very nice as well.
I work on a project that utilizes the ESP32 in the manner you mention. We use BLE to communicate with our mobile apps, FreeRTOS for tasks, and Wi-Fi for cloud communication. We are running the application on 4MB of flash. However, we are in the processing of increasing our flash (8MB) to accommodate additional functionality, sensors, etc.
I know about several instances of people having great difficulties to obtain a stable and reliable operation of the ESP32, that provided examples that come with the ESP-IDF are far from being production ready and for this matters the ESP32 is gaining the fame of being a “hobbist” device.
Do you think that provided examples are unreliable code to be used for a production device?
It depends on the direction that the developer takes. There are a lot of hobby examples because the module is priced perfectly for hobbyists and the hardware provides a ton of capabilities. I see a lot of developers take a hobbyist approach which is to use the Arduino IDE for their code development.
I’ve worked on several products that us these devices and we completely bypass the hobbyist approach and use the Espressif frameworks and development tools. The code they provide in their frameworks is on par with what you can expect a silicon vendor to provide. It gets you going. It’s certainly not bullet proof, but silicon code rarely is.
There are still significant bugs in the classic BT stack.
I have discovered a good source of power is the key. There are times that during WIFI transmission current reaches 500ma from 3.3V. So a supply with good transient response and adequate load current capability is needed.
Hi, The ESP Series has fascinated me for a number of years. As you mention they are very competitively priced – compare them to similar WiFi / BT offerings from major silicon providers. My personal opinion is that they come into their own when the power budget is not “too” constrained. Another appealing feature is that the device can be used as a standalone MQTT client which can reduce system complexity. There are other devices with similar functionality – the Realtek 8720, which supports both 2.4 & 5 GHz WiFi and BT. The question which I keep asking myself is “Why can Espressif and Realtek supply devices at this price, and why is there such a huge price difference from other vendors?”
Thanks for the comment. I’m thinking that they can supply at these prices for several reasons:
1) Economies of scale to decrease manufacturing costs
2) Foreign based companies with different standards of living selling into markets with a good “cash conversion rate”
3) Attempting to undercut the competitors to drive them out of the market
At least that is what comes to mind. It is interesting though.