How to use the Serial Monitor with the Arduino IDE 2.0 (2024)

Table of Contents
  • Requirements
  • Notable changes
    • Advantages with new integration
  • Using the Serial Monitor tool
  • Using multiple Serial Monitors simultaneously
  • More tutorials

The Serial Monitor is an essential tool when creating projects with Arduino. It can be used as a debugging tool, testing out concepts or to communicate directly with the Arduino board.

The Arduino IDE 2.0 has the Serial Monitor tool integrated with the editor, which means that no external window is opened when using the Serial Monitor. This means that you can have multiple tabs open, each with its own Serial Monitor.

You can download the editor from the Arduino Software page.

You can also follow the downloading and installing the Arduino IDE 2.0 tutorial for more detailed guide on how to install the editor.

Requirements

  • Arduino IDE 2.0 installed.
  • Arduino board.
  • Core installed for the board used.

Notable changes

One major change that was introduced with the Arduino IDE 2.0 is the integrated Serial Monitor. The older versions of the editor features an external window that matches the port/board that we select.

The Arduino IDE 2.0 works a bit differently. Instead of opening an external window for the Serial Monitor, it shows up where the console log is located, as an additional tab. To understand how this works, let's take a look at how the old editor works:

How to use the Serial Monitor with the Arduino IDE 2.0 (1)

Now, let's take a look at the IDE 2.0. Notice how the Serial Monitor is located at the bottom of the editor:

How to use the Serial Monitor with the Arduino IDE 2.0 (2)

The Serial Monitor settings are also located here, such as adjusting the baud rate and sending messages.

Advantages with new integration

A major advantage with having the Serial Monitor integrated with the editor is the possibility to have multiple monitors open simultaneously. In the old editor, when changing the port/board, it changed across all windows. In addition, we were limited to one Serial Monitor window, an obstacle that the IDE 2.0 removes.

You will find an example with more information on how to use this feature, further down this tutorial under the Using multiple Serial Monitors simultaneously section.

Using the Serial Monitor tool

The Serial Monitor tool is a really great tool for debugging and establishing communication between a computer and an Arduino. To use it is really easy, but there are some things that we need to do first.

  1. First we need to open the Arduino IDE 2.0.

How to use the Serial Monitor with the Arduino IDE 2.0 (3)

  1. Now, we need to create a sketch that includes some configurations needed, so that our board can communicate with our computer. Mainly, we need to set a baud rate, which is done by writing Serial.begin(9600);. Here, the 9600 represents the baud rate, which is the maximum bits per seconds that can be transferred. The sketch that we need to use can be found in the snippet below:
void setup() {Serial.begin(9600);}void loop() {Serial.println("Hello world!");delay(1000); }
  1. This will print "Hello world!", every one second to the Serial Monitor. Let's select the board we want to use, and upload the sketch to the board.

How to use the Serial Monitor with the Arduino IDE 2.0 (4)

  1. When it has finished uploading, click on the Serial Monitor button, located at the top right corner of the IDE. This will launch the Serial Monitor in the bottom of the IDE, replacing the console section.

How to use the Serial Monitor with the Arduino IDE 2.0 (5)

The text "Hello world!" is now printed every one second. Congratulations, you have now successfully sent a message from your Arduino, to your computer.

Using multiple Serial Monitors simultaneously

A really cool feature with the Arduino IDE 2.0 is that the Serial Monitor is linked to the sketch windows you have open. For example, if we have two sketch windows, named sketch_1 and sketch_2, we can select the port and board for each window, and have two Serial Monitors running at the same time.

This is really useful when working with various communication / connectivity projects, where we want to know what's going on both boards at the same time. If you have two Arduino boards, you can try out this feature using the instructions below.

  1. First, we need to open a new file, through File > New.

How to use the Serial Monitor with the Arduino IDE 2.0 (6)

  1. Now, we need to choose another board. In this example, we are using an Arduino Nano 33 IoT. If you have connected it to your computer and installed the necessary core for it, it will show up in the board list.

How to use the Serial Monitor with the Arduino IDE 2.0 (7)

  1. For the new sketch, let's use the same sketch we uploaded to the other board, but replace the "Hello world!", with something else. In this example, we used "Hello Mars!", as you can see in the code snippet below:
void setup() {Serial.begin(9600);}void loop() {Serial.println("Hello Mars!");delay(1000); }
  1. Upload the code to the board, and open the Serial Monitor. We should now see "Hello Mars!" being printed every one second. If we put the two sketch windows side by side, we can see how they are printing at the same time.

How to use the Serial Monitor with the Arduino IDE 2.0 (8)

Congratulations, you can now check what is going on with two boards simultaneously!

Note: Using several sketch windows and Serial Monitor at the same time can be quite heavy on your machine.

More tutorials

  • Getting started with the Arduino IDE 2.0 (beta)
  • Downloading and installing the Arduino IDE 2.0
  • How to use the board manager with the Arduino IDE 2.0
  • How to upload a sketch with the Arduino IDE 2.0
  • How to install and use a library with the Arduino IDE 2.0
  • How to use the autocomplete feature with the Arduino IDE 2.0

Last revision

March 01, 2021, at 12:00 PM

How to use the Serial Monitor with the Arduino IDE 2.0 (2024)

References

Top Articles
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 5753

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.