Arduino Serial Output Garbled — Strange characters on the monitor usually mean the two ends of the link disagree about speed or about how a line ends.

Troubleshooting

Arduino Serial Output Garbled

Arduino Serial Output Garbled — Strange characters on the monitor usually mean the two ends of the link disagree about speed or about how a line ends.

Strange characters on the monitor usually mean the two ends of the link disagree about speed or about how a line ends.

22 November 20267 min read
A computer screen showing a serial monitor window beside a USB-connected Arduino board
Garbled text is a communication setting problem, not a damaged board.

Bu projeyi gerçekten kurmak istersen parçaları hobidevre.com'dan temin edebilirsin →

Build it for real

To build this project for real, get the parts from hobidevre.com → hobidevre.com →

More build guides: hobidevre.com/blog

What garbled text looks like

A mismatch produces random symbols, boxes, or letters that resemble the message but are not quite right. The pattern is regular rather than random: the same input tends to produce the same wrong output. That regularity is the clue that the receiver is sampling at the wrong moment, which is what a baud mismatch means.

Do not replace the board when you see this. The hardware is transmitting something meaningful; the receiver is simply reading it with the wrong timing. Changing one number in the monitor or in the sketch is usually enough to make the text readable again.

Match the baud rate on both sides

The number in Serial.begin tells the board how fast to send bits. The number in the monitor dropdown tells the computer how fast to read them. If they differ, each character is sampled at the wrong instants and comes out as a different symbol. Set both to the same value and reopen the monitor.

Common values include 9600 and 115200. Neither is more correct than the other; what matters is agreement. If you inherited a sketch from someone else, read the Serial.begin line instead of assuming the default rate, and write the chosen value in a comment so the next reader does not have to guess.

Confirm the port and cable

A wrong port usually gives no text at all rather than garbled text, but it is worth confirming while you are checking settings. Select the port that appears when the board is plugged in and disappears when it is unplugged. Close other applications that may own the same port.

A poor USB cable can produce intermittent corruption rather than consistent garbling. If the text is sometimes correct and sometimes broken with the same settings, try a different data cable before changing the code. Charge-only cables will not carry the serial data at all.

Line endings and encoding

If the characters are correct but each message runs into the next, the problem is not speed. Your sketch may use print instead of println, so no newline is sent. Add println or include a newline character in the string, and the monitor will start a fresh line for each message.

Some monitors offer a line-ending selector that adds carriage return, newline, or both. Choose the option that matches what your sketch sends. Changing this setting does not fix wrong characters, so only adjust it once the text itself is readable.

Avoid flooding the monitor

Printing thousands of lines per second can overwhelm the receiving program. The result is skipped lines, partial characters and a monitor that appears to freeze. Add a small delay between prints or print only when a value changes, so the output rate stays well below what the receiver can display.

Logging every loop iteration is rarely useful. A reading printed a few times per second is easy to follow and easy to compare. If you need high-rate data, store it on the board and send a summary instead of streaming every sample.

A clean test sketch

This sketch prints one short, fixed word and a counter at a modest rate. There are no sensors, no conditions and no libraries. If the words are readable, the communication path is correct and you can reintroduce your own code one block at a time until the garbling returns.

Keep the test baud rate explicit rather than relying on a default. If the words are wrong, change only the monitor dropdown and try again. If they are always wrong at every rate, suspect the cable or the port rather than the sketch.

Once the test is clean, copy the working baud rate into the real project and remove the test file. A known-good baseline makes every later fault easier to place.

void setup() {
  Serial.begin(9600);
  Serial.println("test basariyla basladi");
}

void loop() {
  Serial.print("deger: ");
  Serial.println(millis());
  delay(300);
}

A reliable workflow

Use the same order every time: confirm the port, match the baud rate, print a fixed marker, then add real output. Following a fixed sequence prevents the common mistake of changing several settings at once and never knowing which one helped.

Record the working settings in your project notes. A sketch revisited weeks later is much easier to trust when the chosen rate and port are written down beside the code.

  • Correct port selected
  • Serial.begin rate equals monitor rate
  • println used for separate lines
  • Output rate kept modest
  • A fixed marker printed first

Get the parts

USB data cables and boards for these tests are available from hobidevre.com if you need to replace a suspect cable.

Frequently asked questions

Why do I see random symbols instead of my text?

The baud rate in the sketch differs from the rate selected in the monitor. Match them and reopen the window.

Why does my text run together on one line?

You probably used print instead of println. Add a newline or switch to println.

Could a cable cause garbled text?

Yes, if the corruption is intermittent. Try a known data cable before changing code.

Related reading

Practise in the browser

Open the same layout in the simulator and follow the steps. Sign in to save your work.