Utility Bar

Installing Libraries and Using the Serial Monitor on ESP32

ESP32 Installing Libraries & Serial Monitor

Ethan Zaitchik |

Table of Contents

    In this lesson you will learn how to install Arduino libraries and use the Serial Monitor to view messages from your ESP32. These skills are essential for debugging and understanding how your code is running. You'll need the Arduino IDE installed to follow these steps. If you haven't done so yet, follow our Installing Libraries and Using the Serial Monitor on ESP32 guide, where we go through the process of getting you and your board ready for your future projects!

    This lesson is part of our ESP32 tutorials series, where we walk through ESP32 projects step by step for beginners.

    What you will learn

    • How Arduino libraries work
    • How to install libraries using the Library Manager
    • How to open and use the Serial Monitor
    • How to verify communication with your ESP32

    Step 1 - What is an Arduino library

    A library is a collection of pre written code that makes it easier to work with hardware such as sensors displays and communication modules.

    Instead of writing everything from scratch you install a library and use its functions in your sketch.

    Most ESP32 projects rely on one or more libraries.

    Step 2 - Open the Library Manager

    1. Within the Arduino IDE, click Sketch
    2. Click Include Library
    3. Click Manage Libraries
    Arduino IDE Manage Libraries tab

    The Library Manager window will open.

    Step 3 - Install a library

    As a demonstration you will install a commonly used library.

    1. In the Library Manager search box type Adafruit Unified Sensor
    2. Select Adafruit Unified Sensor

    Click Install

    Arduino IDE install test library

    If prompted to install dependencies allow the IDE to proceed.

    Step 4 - Confirm the library is installed

    Once installed the library will show as installed in the Library Manager.

    You can also confirm by checking the Examples menu.

    1. Click File
    2. Click Examples
    3. Scroll down to find the newly installed library
    Arduino IDE confirm library install


    If examples appear the library is ready to use.

    Step 5 - Open the Serial Monitor

    The Serial Monitor allows your ESP32 to send text messages back to your computer. This is one of the most important tools for troubleshooting. Keep your ESP32 board connected for this.

    To open it

    1. Click Tools
    2. Click Serial Monitor
    Arduino IDE open Serial Monitor

    A new window will open at the bottom of the screen.

    Arduino IDE Serial Monitor open

    Step 6 - Set the correct baud rate

    The baud rate controls the speed of communication between your ESP32 and the computer.

    1. In the Serial Monitor window find the baud rate menu
    2. Set it to 115200

    This baud rate is commonly used with ESP32 boards.

    If the baud rate does not match the code, you will see unreadable text.

    Arduino IDE set baud rate 115200

    Step 7 - Upload a Serial test sketch

    Copy and upload the following test sketch.

    void setup() {
    
      Serial.begin(115200);
    
      delay(1000);
    
      Serial.println("ESP32 Serial Monitor Test");
    
    }
    
     
    
    void loop() {
    
      Serial.println("ESP32 is running");
    
      delay(1000);
    
    }

    Step 8 - View Serial output

    Once the upload is complete open the Serial Monitor if it is not already open.

    You should see messages appearing once per second.

    If no text appears

    • Check the selected port
    • Confirm the baud rate is set to 115200
    • Press the reset button on the ESP32 if present
    Arduino IDE Serial Monitor ESP32 is running test code output

    ESP32 Lessons

    Lesson complete

    You have successfully installed a library and used the Serial Monitor to communicate with your ESP32.

    Next lesson: ESP32 LED Blink Tutorial, the classic first hardware project using an external LED.

    Leave a comment

    Please note: comments must be approved before they are published.

    // Table of contents