Only getting garbage on the serial monitor

I uploaded a sketch to my arduino and the serial monitor was only giving me garbage, so I checked baud rate and it was okay, so I tried different rates, didn't work, tried on a different arduino, same problem, tried updating drivers didn't work, tried disabling an re-enabling the arduino through the device manager didn't work, restarted my computer and it didn't work. I went through a whole list of things I should try to do that I found on quora and nothing worked, and I was using a Arduino Uno R3 and an atmega2560, both just kept writing garbage on the serial monitor. I don't even know which category to put this in, I don't know if it's a problem with both of my arduinos, or the IDE, or if it is my computer, and I wasn't doing anything complicated, I was just doing the simplest thing possible, setting the baud rate with Serial.begin() and trying to write something to the serial monitor with Serial.print().
The arduino Uno R3 is over 6 years old, so maybe it finally died, but the atmega2560 isn't even 1 year old, and It was working fine like a month ago.

Please share a simple example sketch that exhibits the problem. One problem I can think of is that you're writing binary data (that is, non-printable characters).

Which operating system are you using?
Which version of the IDE are you using?
Have you tried an external terminal program (e.g. putty)?

Have you got anything connected to the Arduino boards apart from the USB lead ?

You do not say what your sketch does, but I would start with a simple "Hello World" print in loop() with a 1 second delay() between printing

@GaiusCassiusLonginus

You may check the following Table (Fig-1) for the ASCII codes of the non-printable characters (textual names in the Table).


Figure-1:

I'm just printing a simple string "Hello, world!".
The operating system is windows 11, and I believe the IDE is the latest version, I can't check right now, when I can I will put it here. And no, I only used the Arduino IDE.

No, and it's what i'm doing.

Thank you, but i'm just trying to print a simple string: "Hello, world!".

The fact that the same problem is happening with 2 different Arduino boards sounds significant

Try different COM ports and USB cables for a start

I tried that too, I changed the COM ports on the device manager and it still didn't work.

Try reading the output using puTTY instead of the Serial monitor and post your test sketch as previously requested

Ok, when I can I will upload it.

Does the Serial Monitor baud rate (at the bottom of Serial Monitor) match what you have in Serial.begin()?

Screenshot_20240508_111854

This is an attempt to check if your Arduino UNO ok or not.

Please, carryout te following steps:
1. Lauch the Arduino IDE 1.8.19.
3. Can you see something like below (Fig-1)?


Figure-1:

3. Please connect your Arduino UNO with your PC.
4 Have you heard dong sound?
5. Browse as follows:
Start ---> Device Mananger ----> Ports ------> Arduino Uno (COM4)

Do you read something like: Arduino Uno (COM4) when you expand Ports?

6. Goto the IDE ----> Tools -----> Board ------> Arduino AVR Boards ------> Arduino Uno and make mouse click.

7. Goto the IDE ----> Tools ------> Port --------> COM4 (Arduino Uno) and click.

8. Goto IDE's at the right-bottom corner and read as: Arduino Uno on COM4.

9. Goto IDE -----> File -------> Examples -------> Basics -------> Blink and click to load a blinking sketch for the onboard LED (L) of the UNO Board.

10. Uplaod the sketch into UNO Board.
IDE ------> Sketch -----> Uplaod and click

11. Ceck that Uploading done message has appered on the left-bottom corner of the IDE.

12. Check that the onboard LED (L) of UNO board is blinking at 1-sec interval.

Note: Report at what Step-xx, you have failed.

Yes.

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