Arduino MKR WiFi 1010 - Serial Monitor

Arduino MKR WiFi 1010 - Serial Monitor

Need to debug your Arduino MKR WiFi 1010 projects? The Serial Monitor is essential for viewing data and controlling your Arduino MKR WiFi 1010 from your PC.

What you'll learn (Arduino MKR WiFi 1010 + Serial Monitor):

  • Opening Serial Monitor for Arduino MKR WiFi 1010 projects
  • Sending data from Arduino MKR WiFi 1010 to PC
  • Controlling Arduino MKR WiFi 1010 from PC via commands
  • Debugging Arduino MKR WiFi 1010 programs in real-time

Real-world uses for Arduino MKR WiFi 1010 and Serial Monitor:

  • Sensor monitoring (Arduino MKR WiFi 1010 data viewing)
  • Remote control (Arduino MKR WiFi 1010 command interface)
  • System debugging (Arduino MKR WiFi 1010 troubleshooting)
  • Data logging from Arduino MKR WiFi 1010 experiments

You'll master bidirectional communication between your Arduino MKR WiFi 1010 and computer.

Hardware Preparation

1×Arduino MKR WiFi 1010
1×Micro USB Cable
1×Optionally, DC Power Jack
1×Breadboard
1×Jumper Wires

Or you can buy the following kits:

1×DIYables Sensor Kit (30 sensors/displays)
1×DIYables Sensor Kit (18 sensors/displays)
Disclosure: Some of the links provided in this section are Amazon affiliate links. We may receive a commission for any purchases made through these links at no additional cost to you.
Additionally, some of these links are for products from our own brand, DIYables .

Overview of Serial Monitor

The Serial Monitor in Arduino IDE is your debugging window for Arduino MKR WiFi 1010 projects. It handles bidirectional communication:

  • Arduino MKR WiFi 1010 to PC: Your Arduino sends data through the USB cable to the Serial Monitor on your computer screen. Perfect for debugging and monitoring.
  • PC to Arduino MKR WiFi 1010: Type commands on your PC and send them to control your Arduino remotely.

You'll use the same USB cable that uploads code to your Arduino MKR WiFi 1010.

How To Use Serial Monitor

Open Serial Monitor

Simply click on the icon in the Arduino IDE shown in the image below:

How to open serial monitor on Arduino IDE

Components on Serial Monitor

The Serial Monitor has 8 functional parts:

① Output console: Displays data received from Arduino MKR WiFi 1010.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

② Autoscroll checkbox: Enable/disable automatic scrolling as new data arrives.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

③ Timestamp checkbox: Add timestamps before each line of data.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

④ Clear output button: Remove all text from the output console.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

⑤ Baud rate selection: Set communication speed between PC and Arduino MKR WiFi 1010. Must match the value in Serial.begin() in your code.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

⑥ Textbox: Enter characters to send to Arduino MKR WiFi 1010.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

⑦ Ending Selection: Choose ending characters appended to sent data:

  • No ending: No added characters
  • Newline: Adds LF ('\n')
  • Carriage Return: Adds CR ('\r')
  • Both NL and CR: Adds both CR and LF
COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

⑧ Send button: Transmits textbox content with selected ending characters to Arduino MKR WiFi 1010.

COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

Arduino MKR WiFi 1010 To PC

To send data from Arduino MKR WiFi 1010 to your computer:

1. Initialize Serial communication with desired baud rate:

Serial.begin(baudrate);

2. Send data using these functions:

  • Serial.print() – https://arduinogetstarted.com/reference/serial-print
  • Serial.println() – https://arduinogetstarted.com/reference/serial-println
  • Serial.write() – https://arduinogetstarted.com/reference/serial-write

For example, to display "Hello World!" on the Serial Monitor:

Serial.println("Hello World!");

Example Use

This code sends "newbiely.com" from Arduino MKR WiFi 1010 to Serial Monitor every second:

/* * This Arduino MKR WiFi 1010 code was developed by newbiely.com * * This Arduino MKR WiFi 1010 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-mkr/arduino-mkr-wifi-1010-serial-monitor */ void setup() { Serial.begin(9600); } void loop() { Serial.println("newbiely.com"); delay(1000); }

Detailed Instructions

New to Arduino MKR WiFi 1010? Complete our Getting Started with Arduino MKR WiFi 1010 tutorial first to set up your development environment.

  1. Plug your Arduino MKR WiFi 1010 into your computer's USB port.
  2. Open the Arduino IDE.
  3. Select the Arduino MKR WiFi 1010 board and correct COM port.
  4. Copy the code above and paste it into a new sketch.
  5. Click Upload to compile and upload to the Arduino MKR WiFi 1010.
  6. Open the Serial Monitor in Arduino IDE.
  7. Select 9600 baud rate.
  8. Observe the output on Serial Monitor:
COM6
Send
newbiely.com newbiely.com newbiely.com newbiely.com
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  

Try it: Replace Serial.println() with Serial.print() and see the difference.

PC To Arduino MKR WiFi 1010

How to send data from PC to Arduino MKR WiFi 1010

On your computer:

  1. Type your message in the Serial Monitor textbox.
  2. Click the "Send" button.

On Arduino MKR WiFi 1010:

1. Initialize Serial communication:

Serial.begin(baudrate);

2. Check for incoming data:

if(Serial.available()) { // Code to process received data }

3. Read data using these functions:

  • Serial.read()
  • Serial.readBytes()
  • Serial.readBytesUntil()
  • Serial.readString()
  • Serial.readStringUntil()

For example:

String data = Serial.readStringUntil("\r\n");

Example Use

This Arduino MKR WiFi 1010 code controls the built-in LED via Serial Monitor commands:

  • Command "ON" → LED turns on
  • Command "OFF" → LED turns off

Understanding Command Detection:

How does Arduino MKR WiFi 1010 differentiate between "O", "OF", and "OFF"?

We use an ending character (newline '\n') to mark command completion. Select "Newline" in the Serial Monitor's ending dropdown before sending. The Arduino reads until it finds the newline, which acts as the command separator.

/* * This Arduino MKR WiFi 1010 code was developed by newbiely.com * * This Arduino MKR WiFi 1010 code is made available for public use without any restriction * * For comprehensive instructions and wiring diagrams, please visit: * https://newbiely.com/tutorials/arduino-mkr/arduino-mkr-wifi-1010-serial-monitor */ void setup() { Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT); // configure the built-in LED pin as an output } void loop() { if (Serial.available()) { // check if serial data is available String command = Serial.readStringUntil('\n'); // capture incoming string until newline if (command == "ON") { digitalWrite(LED_BUILTIN, HIGH); // activate the LED Serial.println("Turn LED ON"); } else if (command == "OFF") { digitalWrite(LED_BUILTIN, LOW); // deactivate the LED Serial.println("Turn LED OFF"); } } }

Detailed Instructions

  1. Copy the code above and paste it into Arduino IDE.
  2. Click Upload to send code to Arduino MKR WiFi 1010.
  3. Open Serial Monitor in Arduino IDE.
  4. Select 9600 baud rate and "Newline" ending option.
  5. Type "ON" and click Send button:
COM6
Send
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  
  1. Check the built-in LED on your Arduino MKR WiFi 1010 – it should light up.
  2. View confirmation on Serial Monitor:
COM6
Send
Turn LED ON
Autoscroll Show timestamp
Clear output
9600 baud  
Newline  
  1. Type "OFF" and click Send to turn LED off.
  2. Try multiple ON/OFF commands.

Troubleshooting

  • No data displayed: Verify correct COM port and matching baud rates in code and Serial Monitor.
  • Garbage characters: Baud rate mismatch – ensure Serial.begin() matches Serial Monitor setting.
  • Commands not working: Check "Newline" ending option is selected for command-based communication.
  • Serial Monitor not opening: Close and reopen Arduino IDE, or try different USB cable.

Challenge Yourself - Creative Customizations

Once Serial Monitor works with your Arduino MKR WiFi 1010, try these extensions:

Quick Variations

  • Create a menu system with multiple commands on Arduino MKR WiFi 1010.
  • Add sensor readings display in real-time on Arduino MKR WiFi 1010.

Advanced Features to Try

  1. Build a command parser for complex inputs on Arduino MKR WiFi 1010.
  2. Create data logging to timestamp sensor values on Arduino MKR WiFi 1010.
  3. Implement password-protected commands on Arduino MKR WiFi 1010.
  4. Build a two-way chat system between multiple Arduino MKR WiFi 1010 boards.

Video Tutorial

※ OUR MESSAGES

  • As freelancers, We are AVAILABLE for HIRE. See how to outsource your project to us
  • Please feel free to share the link of this tutorial. However, Please do not use our content on any other websites. We invested a lot of effort and time to create the content, please respect our work!