Product

Step-by-Step Guide: How to Program ESP32 with Arduino IDE?

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.

M5Stack Basic

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.

 Download Arduino IDE

2. Preparing Arduino IDE

① Open the Arduino IDE and go to File -> Preferences -> Settings.

 Arduino IDE Perference

② Copy the following board manager URL and paste it into the Additional Board Manager URLs:

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

 Arduino URL-esp32

In this turial, we use M5Stack’s development boards,so in this step, just copy the following M5Stack board manager URL and paste it into the Additional Board Manager URLs:https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/arduino/package_m5stack_index.json 

Arduino Url-M5Stack

3.Select Tools -> Board -> Board Manager

ESP32 board in Arduino IDE

4. Installing ESP32 Board in Arduino IDE

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.

Installing M5Stack in Arduino IDE

And if you use other ESP32 controllers, please enter "ESP32" in the search field and click Install.

Installing esp32 in Arduino IDE

5. Selecting the Board

In this step, please select Tools -> Board -> M5Stack Arduino -> M5Stack-Core-ESP32. And currently, various M5Stack controller options are available for selection.

Selecting board in Arduino IDE

6. Programming ESP32 with Arduino IDE

Programming ESP32 with Arduino

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.

M5Stack Basic Core

 

 

0 comments

  • There are no comments yet. Be the first one to post a comment on this article!

Leave a comment

Please note, comments must be approved before they are published

Liquid error (layout/theme line 211): Could not find asset snippets/pe-disco-countdown-timer.liquid