Getting Started
This tutorial covers how to get started developing for the ESP-32 using the Arduino IDE. These instructions will cover installing Arduino IDE on Windows, Mac, or Linux, installing any needed drivers, as well the add-on for Arduino to use our ESP-32 microcontrollers.
Installing Arduino IDE
We'll start by installing the Arduino IDE 2.0.
You can download the IDE from the Arduino website for your operating system.
- Windows: Download the version for Win 10 and newer, and run the executable.
- Linux: Download the AppImage, and run the executable.
On Fedora Linux 39, Zack had issues with the AppImage. The IDEv2 flatpak package worked first try.
On Ubuntu 22.04 LTS, Cassian had no issues with the AppImage.
- macOS: Download the Apple Silicon version for newer Macs, and the Intel version for older Macs. Open the downloaded disk image, and copy the Arduino IDE to your application folder.
- For Ashok, the normal download had some issues with esp32's
default.csv
, and we used the Homebrew Cask with no issues.
If you run into issues, you can find more information in the Arduino Docs.
Adding ESP-32 Devices into the Board Manager
The next step is adding ESP-32s to the list of devices Arduino IDE can install to.
-
In your Arduino IDE, choose File > Preferences.
-
Copy and paste the following URL into the Additional Board manager URLs textbox.
- Open the Boards Manager by clicking the Boards Manager icon on the sidebar - the icon below the folder icon.
- Search for ESP32, and press the install button for the esp32 by ExpressIf Systems.
Installing the Drivers (Windows)
This section is only needed when installing Arduino on Windows 10 and Windows 11.
On Windows, Arduino needs an additional driver to write to ESP-32 devices. You can download the driver from Silicon Labs' website.
- Open the ZIP file, and from there choose to extract the file.
- Launch CP210xVCPInstaller_x64.exe and follow the installation wizard.
Installing pyserial and Updating Permissions (Linux)
This section is only needed when installing Arduino on Linux desktops like Ubuntu.
- Install pyserial using pip. If you don't have pip installed, you can install Python from your package manager.
- By default, Arduino is not allowed to write to the serial port. You can change that with the following command.
Testing the Installation
Plug the ESP-32 board into your computer, and follow these steps in the Arduino IDE.
- Click the Select Board dropdown. If you see a board show up, you're on the right track! Click the Unknown board.
Mac users may see "Bluetooth-Incoming-Port Serial Port" by default. This does not mean their ESP-32 is connected. Mac users will want something like /dev/cu.usbserial-#### Serial Port (USB)
.
- You'll then be brought to the Other Boards menu. Search for devkit and click on the DOIT ESP32 DEVKIT V1.
- Copy and paste the following code into the IDE to test the Internal Blink demo.
int pin = LED_BUILTIN;
void setup() {
pinMode(pin, OUTPUT);
}
bool state = HIGH;
void loop() {
digitalWrite(pin, state);
state = !state;
delay(1000);
}
- Press the Upload button in the top left corner. Your code will begin to compile.
-
When you see dots begin to move across the screen in the bottom terminal, press and hold the button to the right of the Micro-USB power connector to accept the new code.
-
Once you see the text "Hard resetting..." in the bottom of the terminal, you should be done uploading and can release the button.
-
Press the button to the left of the Micro-USB power connector to reset the ESP-32 and run your new code.
If all went according to plan, your ESP-32 is now flashing its blue LED.
More Info
If all went well, you're ready to go developing ESP-32 projects with the Norse IoT club! We have various projects in our Wiki, and you can look around on the internet to find additional project ideas.