ESP32: Hello World

The objective of this post is to explain how to do a simple “Hello World” program with the ESP32, using the Arduino IDE as development environment.


The objective of this post is to explain how to do a simple “Hello World” program with the ESP32. This will be a very simple introduction, so this tutorial will just consist on printing the message to the serial console and read it with the Arduino IDE.

If you prefer, you can check the video version of this tutorial in my Youtube channel:

At the time of writing, I didn’t find a way to install the libraries for the Arduino IDE using the Boards manager, as we previously did for the ESP8266 (see the post here). Nevertheless, it’s probably a matter of time until it is supported.

For now, there is a very well explained tutorial on how to install the ESP32 Arduino support on Windows, on Espressif’s github page. Please check here for the mentioned tutorial. Also, note that there are other operating systems supported, as can be seen here.

Please note that in the previously mentioned tutorial, the directory where to clone the git repository may be different from yours. In my case, for example, the Arduino installation was in C/Programs(x86)/Arduino. Also, the hardware directory already existed, so only the /espressif/esp32 folders were automatically created by Git.

Other important thing is that you may need to run both Git GUI and the get.exe file as administrator, in order for the correct folders to be created. In both cases, you just need to right click the executable file and select “Execute as administrator“. It should work fine.

The code

The code for this tutorial is really simple, specially if you have previous experience with Arduino or the ESP8266.

So, in the Setup function, we start by opening a serial connection, with a baud rate of 115200. To do so, we just call the begin method of the Serial object and pass as input the mentioned baud rate.

Next, on the loop function, we just call the println method, to print the “Hello World” message with a new line at the end. After that, we do a short delay of 2 seconds (2000 milliseconds), using the delay function.

void setup() {

void loop() {
 Serial.println("Hello World");

Running the code

Since we are still in the early stages of the ESP32 product life, most of the vendors still call the boards as “ESP32 development board” or something similar. In my case, I’m using one of those generic boards sold at eBay. So, I’ve selected the “ESP32 Dev Module” in the Arduino IDE, as can be seen in figure 1.

ESP32 Selecting board on Arduino IDE.png

Figure 1 – ESP32 currently available boards for the Arduino IDE.

Nevertheless, the code compiles and uploads just fine. As can be seen in figure 2, we get the correct “Hello World” output at the serial console. Don’t forget to use the correct baud rate defined in the code, as highlighted in the figure.

ESP32 Hello World

Figure 2 – Output of the “Hello World” program.


Related content

Related posts

This entry was posted in ESP32 and tagged , , , , , . Bookmark the permalink.

12 Responses to ESP32: Hello World

  1. Pingback: ESP32: Connecting to a WiFi network | techtutorialsx

  2. GC says:

    Hi, may I know if you are using MacOS? I’m not able to connect to my ESP32 development board using MacOS, but is able to do it using Windows. Do you have any suggestion? Thanks.

    Liked by 1 person

  3. Pingback: ESP32: FreeRTOS counting semaphores | techtutorialsx

  4. Pingback: ESP32: Dual core execution speedup | techtutorialsx

  5. Pingback: ESP32: DFRobot ESP-WROOM-32 Module | techtutorialsx

  6. Pingback: ESP-WROOM-32: Uploading a program with Arduino IDE | techtutorialsx

  7. Pingback: FireBeetle | techtutorialsx

  8. Pingback: FireBeetle ESP32: Blinking the on board LED | techtutorialsx

  9. Pingback: ESP32 Arduino: Getting started with WiFi | techtutorialsx

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s