Step-by-Step Guide: How to Program ESP32 with Arduino IDE?
0 comments
We often come across many excellent IoT projects that utilize ESP32 and Arduino. These two platforms clearly hold significant importance. So, what are they, and how can we utilize them together?
Introducing ESP32
ESP32 is a powerful microcontroller module developed by Espressif Systems, which comes with integrated Wi-Fi and Bluetooth connectivity for a wide range of applications, and highly integrating with in-built antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules. It can interface with other systems to provide Wi-Fi and Bluetooth functionality through its SPI / SDIO or I2C / UART interfaces. ESP32 is widely used in mobile devices, wearable electronics and IoT applications.
M5Stack is a renowned company that specializes in providing hardware and software for rapid prototyping and IoT applications. M5Stack products are widely recognized for their integration, simplicity, and versatility, allowing users to stack or connect different modules/units together to build customized and scalable solutions. These modules cover a wide range of functionalities, including displays, sensors, communication interfaces, input devices, and more. By combining these modules, users can quickly create prototypes or even deploy complete IoT systems with minimal effort.
One of the standout features is many M5Stack controllers built around the ESP32, leveraging its powerful processing capabilities, wireless connectivity, and extensive ecosystem. This compatibility grants users access to a vast library of code, examples, and community support, making development with M5Stack devices efficient and user-friendly.
Introducing Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware and software. In the past years, countless of projects, ranging from simple household items to intricate scientific instruments, have used Arduino as their brain. Over time, Arduino has accumulated a vast user base worldwide including students, hobbyists, artists, programmers, and professionals, who have gathered around this open-source platform to contribute an incredible amount of accessible knowledge that can be of great help to novices and experts alike.
How to start
By leveraging the capabilities of both platforms, developers can create innovative IoT projects that benefit from the wireless connectivity of the ESP32 and the ease of development offered by Arduino. This combination opens up possibilities for remote monitoring, home automation systems, sensor networks, and much more.
In this tutorial, we will provide detailed steps and practical tips to help you correctly program ESP32 (take M5Stack Basic for example) with Arduino IDE. Let's start!
1. Download the Arduino IDE
First, go to the Arduino website (https://www.arduino.cc/en/Main/Software) to download Arduino IDE that corresponds to your operating system.
2. Preparing Arduino IDE
① Open the Arduino IDE and go to File -> Preferences -> Settings.
② Copy the following board manager URL and paste it into the Additional Board Manager URLs:
In this tutorial, M5Stack's Basic Core is an example for leading. Thus, in this step, please enter "M5Stack" in the search field and click Install.
And if you use other ESP32 controllers, please enter "ESP32" in the search field and click Install.
5. Selecting theBoard
In this step, please select Tools -> Board -> M5Stack Arduino -> M5Stack-Core-ESP32. And currently, various M5Stack controller options are available for selection.
6. Programming ESP32 with Arduino IDE
Now, you can program the device using Arduino IDE and conveniently use it alongside hardware like Arduino Uno to unlock additional functionalities. In this step, an example demo of Basic Core is uploaded, and you can see, the code is synchronized with the device. Now, you can start your own programming projects.