Nothing appears on serial monitor

  • Liste ögesi

I'm using the Arduino IDE and successfully uploading my code to an Arduino Uno. However, nothing shows up on the Serial Monitor after uploading. I've double-checked that the baud rate in the Serial Monitor matches the one in my code (Serial.begin(...)), and I'm sure the correct COM port and board are selected.

Does anyone have an idea why nothing is showing up? Any suggestions would be appreciated.

Thanks in advance!

First try a sketch isolating the issue. Just a simple sketch with only the serial things. Does it print anything then?

Yes, I’ve tried a simple Serial.println("Hello"), and I can see output on the Serial Monitor now. However, the problem is that sometimes it works and sometimes it doesn't — even without changing anything in the code or setup.

Has anyone experienced this kind of inconsistent behavior? Could it be a timing issue, hardware problem, or something else?

Thanks for your help!

Welcome to the forum

Which Arduino board are you using ?

What happens if you reset the board whilst the Serial monitor is open ?

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Please post your full sketch, using code tags when you do

Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination

In such case I would first check my wires. A faulty jumper or iffy breadboard connections can really send you on a ghost hunt. One check is to lower the serial speed to see if it then works more reliable. At higher speeds the connections are more sensitive.
Second thing to check is the voltage. When power is too low things become instable too...

But as asked by Bob: what kind of board are you using?

In the IDE, use you mouse pointer to "grab" the top line of the Serial Monitor window and "drag up."

I’ve tried the suggestion to "grab" the top line of the Serial Monitor window and "drag up," but unfortunately, it didn’t resolve the issue. However, I’ve noticed that when I close and reopen the Arduino IDE, or when I upload a different sketch before uploading my actual code, the Serial Monitor starts working as expected.

I experienced something like that before. Pressing the reset button on the board solved it — everything worked fine afterward.

Here are my [edited] "before the drag" and "after the drag"... what do yours look like?

Before - no space for serial monitor output:

After - space below the command line:

(the codes) - edited
void setup() {
  Serial.begin(2400);
  char m[] = { "+mr+rlv+bsfd+^kkld+obsbK" };
  for (int i = 0; i < strlen(m) + 1; i++)
    Serial.write(m[strlen(m) - i] + 3);
  Serial.println();
}
void loop() {}

I can say with some confidence that your code will never produce any output on the Serial monitor and that you will kick yourself when you realise the problem :grinning:

1 Like

I would be interested in answers to these questions

Kicking myself as we speak.... long live Serial.begin(2400);

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.