Why Do I Get Garbage Characters in Serial Monitor?
Almost always the baud rate in Serial Monitor does not match the baud rate in your code.
Fix it fast
- Check your code for
Serial.begin(9600);. - Set Serial Monitor to the same number.
- Close and reopen Serial Monitor.
Other causes
- Wrong board selected in the IDE.
- Noise on long wires.
- Using SoftwareSerial with the wrong pins.
Bottom line
Match the baud rate and most garbage output disappears.
Related: How do I use Serial Monitor correctly? · Why does my code compile but not work? · What does this error message mean?