Introduction to the ESP32 guide series

Setup the ESP32 on the Arduino IDE (Mac OS)

In this lesson, you will learn how to set up your Arduino IDE on Mac OS, so that you can use it to program your ESP32.

In this lesson, you will learn how to set up your Arduino IDE so that you can use it to program your ESP32. This lesson contains instructions for Mac users. If you use Windows, please look at the Windows version of this lesson, also part of this series.

You can watch the video, or if you are the “reading” type, you can read the text below.

One of the really nice things about the “ESP32” is that it works with the Arduino IDE.

Not only that, but because of the support that the manufacturer has implemented for the Arduino platform, we can use a lot of the existing Arduino libraries, infrastructure, and hardware.

That means that we can reuse what we already know from our work with the Arduino. We can build on that and make use of all of the additional hardware capabilities that the ESP32 brings along.

To be able to use the Arduino IDE to program the ESP32, you will need to install the ESP32-Arduino Core software. I will show you how to do this now. 

I assume that the Arduino IDE is already installed on your Mac. If it isn’t, please install it now, and then continue (I’ll wait here, it’s ok 🙂 ).

Download ESP32-Arduino Core

With the Arduino IDE installed and operating on your computer, use your browser to download the ESP32 support software from Github.

You can download these files an manually copy them into the hardware folder of your Arduino IDE installation, but there is an easier and safer way. You should use the Arduino IDE Boards Manager. You can find instructions in Github (or just continue reading). 

The Boards Manager utility in the Arduino IDE makes installation easy and safe.

The IDE Boards Manager utility works across platforms. You can use this method on Mac, Windows, or Linux.

Copy this URL:

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

Open the Preferences window of the Arduino IDE, and paste the URL you just copied in the “Additional Board Manager URLs” field, as you can see in the figure below:

Copy the hardware definitions URL to the URLs field in the Preferences window.

Click OK to dismiss the Preferences window.

Next, open the Board Manager utility by clicking Tools, Board, Boards Manager in the IDE menu.

Bring up the Boards Manager utility.

Search for “ESP32” in the text box. A single result should appear.

Click on “Install” to do just that. In the Figure below, the ESP32 support is already installed in my Arduino IDE, so the “Install” button is inactive.

Search for the ESP32 module in the Boards Manager.

There are a few megabytes of file data to download and install, so be patient.

Test the ESP32 support

A while later, when the utility completes the download and installation of the software, confirm that the ESP32 support is there.

In the Arduino IDE menu, click on Tools, Board, and scroll down to see the new ESP32 section. There should be numerous boards there. The one we are interested mostly about, is the generic ESP32 Dev Module, like in the figure below. Click on “ESP32 Dev Module” to select it, and make it the active target in the IDE.

The ESP32 support software provides support for numerous ESP32 boards.

Now that you have selected the ESP32 Dev Module confirm the selection in the IDE window. The status line should contain the text “EXP32 Dev Module,” as well as its various parameters, like its frequency and flash memory size.

Yes, the ESP32 is the Arduino IDE programming target.

Let’s do one last test: load one of the example ESP32 sketches. In the IDE menu, select File, Examples, ESP32, AnalogOut, ledcWrite_RGB. This is actually one of the sketches we discuss in the video lecture.

Load the ledcWrite_RGB example sketch.

This sketch demonstrates how to create PWM output, and uses functions that come with the ESP32-Arduino Core, and are not available to the Arduino Uno. You can learn more about these and other hardware-specific functions in the video course.

An ESP32 example sketch

This concludes the installation and verification of the Arduino IDE support for the ESP32 board. If you want to learn how to install the ESP32 support for Windows, check out the next lesson.

If your ESP32 Dev Kit contains the CP21012 USB driver chip (most lower-cost dev kits do), you will need to install the USB driver on your computer before you can upload your first sketch. You can learn how to do this in Lesson 9.

Ready for some serious learning?

Enrol to 

ESP32 for Busy People

This is our comprehensive ESP32 course for Arduino Makers.


It's packed with high-quality video, mini-projects, and everything you need to learn Arduino from the ground up.


Just click on the big red button to learn more.

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community. One email per week, no spam; unsubscribe at any time

Image
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}