- ESP32 for IoT Tutorial
- Brief Overview of IoT
- Introduction to ESP32
- Installing the ESP32 Board in Arduino IDE
- Setting up RTOS for dual-core and multi-threaded operation
- Interfacing ESP32 with MPU6050
- Interfacing ESP32 with Analog sensors
- ESP32 Preferences
- ESP32 SPIFFS storage (A mini-SD Card in the chip itself)
- Interfacing OLED Display with ESP32
- WiFi on ESP32
- Transmitting data over WiFi using HTTP
- Transmitting data over WiFi using HTTPS
- Transmitting data over WiFi using MQTT
- Transmitting data over Bluetooth
- Getting current time using NTP Client
- Performing the (OTA) update of ESP32 firmware
- Applications of ESP32
- Next steps for you as a developer
- ESP32 for IoT Useful Resources
- Quick Guide
- Useful Resources
Applications of ESP32
Now that you are fairly familiar with ESP32, let's look at its application. This is a chapter where I feel I need not tell you much. After going through the various chapters in this tutorial, you would have started forming ideas in your head. You would have already created a rough list of applications where you could use ESP32. And the good news is that most of the applications you've listed are feasible.
However, ESP32 is more feasible for some applications than others. In this chapter, my focus will be on making you understand the factors you should consider when deciding whether to use ESP32 for an application or not. Please note that this chapter is production focused, i.e., when we are talking of a scale of thousands or lakhs of devices. If you have a requirement of a handful of devices and ESP32 can serve them, just simply go ahead and use ESP32 without a second thought. Also, for prototyping/ establishing Proof of Concept (PoC), you can use ESP32 without any hesitation.
One of the major advantages of ESP32 is the presence of inbuilt WiFi and Bluetooth stacks and hardware. Therefore, ESP32 will be your choice of microcontroller in a static application where good WiFi connectivity is guaranteed, say an environment monitoring application in, say, a laboratory. The presence of WiFi stack on the module itself means you will have saved money on an additional networking module. However, if you use ESP32 in an asset tracking application, where it keeps moving around, you will have to rely on a GSM or LTE module for connectivity to the server (because you will not be guaranteed WiFi availability). In such a scenario, ESP32 loses the competitive advantage, and you may be better off using a cheaper microcontroller that can serve your purpose.
On similar lines, having a hardware accelerator for encrypting messages makes ESP32 ideal for applications requiring secure communication (HTTPS). So if you are dealing with sensitive information that you don't want to fall in the wrong hands, using ESP32 is advantageous over other microcontrollers that don't support encryption. An example application can be Industrial IoT in the defense sector.
The presence of two cores again makes ESP32 your choice of microcontroller for processing-heavy applications like those receiving data at a very high baud rate and requiring the data processing and transmission to run on separate cores. Several such applications can be found in Industrial IoT. But for a very light application, where you don't even require secure communication, a microcontroller having modest specs may prove to be more useful. After all, what is the use of having (and effectively paying for) two cores, when you can make do with one?
Another factor to consider is the number of GPIOs and peripherals. ESP32 has 3 UART channels. If you have an application where you need more than 3 UART channels, you may have to look for another microcontroller. Similarly, ESP32 has 34 programmable GPIOs which are more than sufficient for most applications. However, if your application does require more GPIOs, you may have to switch to another microcontroller
ESP32's 1.5 MB of default SPIFFS provides you with more storage onboard the microcontroller than most other microcontrollers. If your storage requirements are within 1.5 MB, ESP32 saves you the cost of an external SD Card or Flash Chip. ESP32 does wear-leveling within SPIFFS by itself, saving you a lot of development efforts as well. However, if your storage requirements are not met by ESP32, again, the competitive advantage disappears.
ESP32's 520 KB of RAM is also more than sufficient for most applications. It is only for very heavy applications like image/video processing where this proves to be a bottleneck.
To summarize, ESP32 has specs that are good enough to accommodate most of your applications. When scaling up production, you need to just make sure that the specs are not an overkill for you. In other words, if you can get the desired output with modest specs, you may be better off using a cheaper microcontroller and save money. These savings become significant when your production numbers increase by orders of magnitude. However, production aside, ESP32 is definitely the ideal microcontroller for prototyping and establishing the PoC.
Kickstart Your Career
Get certified by completing the courseGet Started