7. Introduction to the ESP32
Setup the ESP32 on the Arduino IDE (Mac OS)
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 IDE Boards Manager utility works across platforms. You can use this method on Mac, Windows, or Linux.
Copy this URL:
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:
Click Ok to dismiss the Preferences window.
Next, open the Board Manager utility by clicking Tools, Board, Boards Manager in the IDE menu.
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.
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.
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.
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.
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.
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.
"Introduction to the ESP32" series
Ready for some serious learning?
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.
Jump to another article in this series.