Getting Started with the ESP32 Development Board

DEVKIT DOIT Where to Buy Specifications Programming Environments
Pinout 30 Pinout 36 Upload Code Wrapping Up

This article is a getting started guide for the ESP32 development board. If you’re familiar with the ESP8266 , the ESP32 is its sucessor. The ESP32 is loaded with lots of new features. The most relevant: it combines WiFi and Bluetooth wireless capabilities and it’s dual core.

Find the differences between the ESP32 and the ESP8266:  ESP32 vs ESP8266 – Pros and Cons




ESP32 DEVKIT DOIT

In this post, we’ll be using the ESP32 DEVKIT DOIT board as a reference. But the information on this page is also compatible with other ESP32 development boards with the ESP-WROOM-32 chip.

Here’s some examples of ESP32 boards:




Where to Buy?

Our ESP32 projects are build using mainly the ESP32 DEVKIT DOIT board and that’s the one we recommend getting.

You can also read the following article that compares several ESP32 development boards:  ESP32 Development Boards .

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!




Specifications

When it comes to the ESP32 chip specifications, you’ll find that:

Specifications – ESP32 DEVKIT V1 DOIT

Number of cores 2 (dual core)
Wi-Fi 2.4 GHz up to 150 Mbits/s
Bluetooth BLE (Bluetooth Low Energy) and legacy Bluetooth
Architecture 32 bits
Clock frequency Up to 240 MHz
RAM 512 KB
Pins 30 or 36 (depends on the model)
Peripherals Capacitive touch, ADC (analog to digital converter), DAC (digital to analog converter), I2C (Inter-Integrated Circuit), UART (universal asynchronous receiver/transmitter), CAN 2.0 (Controller Area Netwokr), SPI (Serial Peripheral Interface), I2S (Integrated Inter-IC Sound), RMII (Reduced Media-Independent Interface), PWM (pulse width modulation), and more.

To learn more about the ESP32 GPIOs, read our GPIO reference guide:  ESP32 Pinout Reference: Which GPIO pins should you use?




Programming Environments

The ESP32 can be programmed in different programming environments. You can use:

In our projects, we program the ESP32 mainly with Arduino IDE or MicroPython .

Preparing the ESP32 Board in Arduino IDE

There’s an add-on for the Arduino IDE allows you to program the ESP32 using the Arduino IDE and its programming language. Follow one of the next tutorials to prepare your Arduino IDE:




ESP32 Pinout Guide

The ESP32 has more GPIOs with more functionalities compared to the ESP826.

With the ESP32 you can decide which pins are UART, I2C, or SPI – you just need to set that on the code. This is possible due to the ESP32 chip’s multiplexing feature that allows to assign multiple functions to the same pin. If you don’t set them on the code, the pins will be used as default – as shown in the figure below (the pin location can change depending on the manufacturer).




Version with 30 GPIOs

Version with 36 GPIOs

You can read our detailed ESP32 Pinout Reference Guide .




Upload Code to the ESP32 using Arduino IDE

To show you how to upload code to your ESP32 board, we’ll build a simple example to blink an LED.

Copy the following code to your Arduino IDE:

/*F********************************************************************
*
**********************************************************************/
/* Blink */
// ledPin refers to ESP32 GPIO 23const 
int ledPin = 23;// setup function runs once when you press reset or power board

/*F********************************************************************
*
**********************************************************************/
void 
setup() 
{  // initialize digital pin ledPin as an output.
	pinMode( ledPin, OUTPUT);
}  // loop function runs over and over again forever
/*F********************************************************************
*
**********************************************************************/
void 
loop() 
{
	digitalWrite( ledPin, HIGH);      // TURN LED ON (HIGH IS VOLTAGE LEVEL)
	delay( 1000 );                                      // WAIT FOR A SECOND
	digitalWrite( ledPin, LOW);        // TURN LED OFF BY MAKING VOLTAGE LOW
	delay( 1000 );                                      // WAIT FOR A SECOND
}

In this code, we’re controlling an LED connected to GPIO 23.

const int ledPin = 23;

So, connect an LED to your ESP32 by following the next schematic diagram.

Important:  always check the pinout for your specific board before building any circuit.

Here’s a list of the parts you need to build this previous circuit:

Plug your ESP32 development board to your computer and follow these next instructions:

1) Go to Tools > Board , scroll down to the ESP32 section and select the name of your ESP32 board. In my case, it’s the DOIT ESP32 DEVKIT V1 board.

2) Go to  Tools  >  Port  and select a COM port available.

3) Press the upload button.

That’s it!

Note: If you get the following error when trying to upload code, it means that your ESP32 is not in flashing/uploading mode.

Failed to connect to ESP32: Timed out... Connecting...

To upload code, you need to follow the next steps (make sure you have the right board selected:

That’s it. After uploading the new sketch, you can press the “ ENABLE ” button to restart the ESP32 and run the new uploaded sketch.

Note: Learn how to fix the “Failed to connect to ESP32: Timed out waiting for packet header” error permanently when trying to upload new code to your ESP32 board once for all.

Demonstration

After uploading the code, the LED connected to GPIO 23 should be blinking every other second.




Wrapping up

We hope you’ve found this getting started guide useful. The blinking LED is just a simple project to get you started with the ESP32. This is also a great way to learn the procedure you need to do to upload code to your board.

If you like ESP32, we have more than 20 projects with the ESP32 you can find in our repository of ESP32 projects:

You may also like:

If you like ESP32 make sure you subscribe to our blog , so you don’t miss upcoming projects.