Serial Monitor

Anand Ramaswami

Welcome back, Maker!

In this blog, we will learn about the Serial Monitor in Arduino.

The Serial Monitor is a window in the Arduino IDE that shows messages sent by the Arduino board. It lets you see things like numbers, sensor values, or text printed from your program. It is mainly used to check what your Arduino is doing and help debug your code.

It is very useful for:

  • Printing text or numbers
  • Checking sensor values
  • Debugging programs
  • Controlling devices from the keyboard

Think of the Serial Monitor like a chat window between your Arduino and your computer.

Now that we know what the Serial Monitor does, the next question is: where can we find it in the Arduino IDE?

Where is Serial Monitor?

You can open the Serial Monitor in the Arduino IDE by:

  • Clicking the magnifying glass icon in the top right corner, or
  • Going to Tools → Serial Monitor in the menu.

Once it opens, it will display any data sent using commands like Serial.println().

To understand how this works, we first need to understand the idea of serial communication.

What is Serial Communication?

Serial communication means sending data one bit at a time between two devices.

In Arduino, this communication happens through the USB cable between:

  • Arduino board
  • Computer

Arduino can send information to the Serial Monitor, and we can type commands from the computer to control the Arduino.

So before Arduino can send or receive this data, it must first start the communication. That is where Serial.begin() comes in.

The Command: Serial.begin()

Serial.begin() starts the communication between Arduino and the computer.

Syntax:

Serial.begin(speed);

Parameter:

speed → Communication speed in bits per second (baud rate)

Baud Rate is the speed at which data is sent between the Arduino and the computer.

It tells how fast information travels through the USB cable.

For example, 9600 baud means 9600 bits of data are sent every second.

Both the Arduino and the Serial Monitor must use the same baud rate to understand each other.

Example:

Serial.begin(9600);

This means Arduino and the computer communicate at 9600 bits per second.

Once communication has started, Arduino can begin sending messages. For that, we use Serial.print() and Serial.println().

The Command: Serial.print() and Serial.println()

These commands send messages to the Serial Monitor.

Syntax:

Serial.print(data);

Serial.println(data);

Parameters

data → text, number, or variable to display

Difference

  • Serial.print() → prints text on the same line
  • Serial.println() → prints text and moves to the next line

Example:

Serial.println("Hello Maker!");

The Serial Monitor will show:

Hello Maker!

Now that we know the main commands, let’s see how they are used in real code.


Project 1: Print Text and Numbers on Serial Monitor

This project shows how Arduino can send messages to the Serial Monitor.

Code

void setup() {

 Serial.begin(9600); // Start serial communication

}


void loop() {

 Serial.println("Hello Makers!"); // Print text

 Serial.println(123); // Print a number

 delay(1000); // Wait 1 second

}

Explanation

  • Serial.begin(9600); starts communication between Arduino and the computer.
  • Serial.println("Hello Makers!"); prints a message.
  • Serial.println(123); prints a number.
  • delay(1000); waits 1 second before printing again.

The Serial Monitor will display the message every second.

This project helps us understand the most basic use of the Serial Monitor: sending information from Arduino to the computer.

Once you understand that, you can use the Serial Monitor for something even more helpful — checking what is happening inside a project while it runs.

 

Project 2: Show LED Status While It’s Blinking

In this project, the LED blinks, and the Serial Monitor shows whether the LED is ON or OFF.

Code

void setup() {

 pinMode(9, OUTPUT); // LED output

 Serial.begin(9600); // Start serial communication

}


void loop() {

 digitalWrite(9, HIGH); // LED ON

 Serial.println("LED is ON"); // Show message

 delay(1000);


 digitalWrite(9, LOW); // LED OFF

 Serial.println("LED is OFF"); // Show message

 delay(1000);

}

Explanation

  • The LED turns ON and the Serial Monitor prints LED is ON.
  • Then the LED turns OFF and the Serial Monitor prints LED is OFF.
  • This helps us see what the Arduino is doing internally.

This technique is commonly used for debugging programs.

So here, the Serial Monitor is not just showing random text. It is helping us understand the program step by step.

After learning how Arduino can send information to us, the next step is even more interesting: what if we send information back to Arduino?

Project 3: Control LED from Serial Monitor

In this project, we will control the LED using the Serial Monitor.

We will type:

  • 1 → LED ON
  • 0 → LED OFF

Code

void setup() {

  pinMode(9, OUTPUT);      // LED connected to pin 9

  Serial.begin(9600);      // Start serial communication

}


void loop() {

  char data = Serial.read();   // Read the character sent from Serial Monitor

//char is a data type used to store a single character, like a letter, number, or symbol.


  if (data == '1') {

    digitalWrite(9, HIGH);     // Turn LED ON

    Serial.println("LED ON");  // Print message on Serial Monitor

  }


  if (data == '0') {

    digitalWrite(9, LOW);      // Turn LED OFF

    Serial.println("LED OFF"); // Print message on Serial Monitor

  }

}

How This Works

  • Serial.begin(9600); starts communication between the Arduino and the computer.
  • Serial.read(); reads the character typed in the Serial Monitor.
  • If the user types 1, the LED turns ON.
  • If the user types 0, the LED turns OFF.
  • Serial.println() prints a message so we can see what happened

This project shows that the Serial Monitor is not only for viewing data. It can also be used to control the Arduino from the computer.

That is what makes it such a powerful tool while learning Arduino.

Why the Serial Monitor is Important:

The Serial Monitor is one of the most powerful tools for Arduino developers.

It helps you:

  • Check sensor readings
  • Understand program behavior
  • Find bugs in your code
  • Control devices from the keyboard

Almost every Arduino project uses the Serial Monitor for testing and debugging.

So, by learning the Serial Monitor, you are also learning one of the most important habits in Arduino programming: checking what your program is doing while it runs.

Now you know how to use the Serial Monitor to communicate with your Arduino.

In the next projects, you can use it to read sensors, control motors, and build smarter robotics systems.

Keep experimenting, keep building, and keep making.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.