SoftwareSerial prints garbage: baud rate, pins and one port at a time

Garbage characters almost always mean the baud rates do not match. Start with 9600 on both sides.

What the message means

SoftwareSerial does the timing in code, so it is less reliable at high speed and while other code uses interrupts.

Fix it in this order

  1. Set the same baud rate on the module and in begin().
  2. Use 9600 first, then raise it step by step.
  3. Check which pins your board supports for receive in SoftwareSerial.
  4. Check the TX of one device goes to the RX of the other.
  5. Use only one SoftwareSerial port with listen() at a time.
  6. On boards with a spare hardware serial port, use that instead.

Why it happens

SoftwareSerial reads each bit by timing it in software, so it has to sample at the right instants. If the module’s baud rate differs from the one in begin(), the samples land in the wrong places and the bytes decode as random symbols.

Receiving uses interrupts and briefly disables other interrupts, so busy code can shift the timing and lose characters. Transmitting also stops it receiving. Third-party guides disagree on the highest safe speed on an Uno, and Arduino’s own page gives its 57600 bps limit for the Arduino 101, so start at 9600 and raise it only after it works. Only one SoftwareSerial object can receive at a time, chosen with listen(). A hardware serial port avoids all of this.

If you see this, do this

You seeDo this
Random symbolsBaud rate mismatch.
Works then loses charactersToo fast, or the CPU is busy.

serial monitor shows nothing, HC-05 no response.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

Why this happens

Every bit on a serial line lasts a fixed time: at 9600 baud, 1 / 9600 is about 104 microseconds. The receiver detects the start bit, then samples each following bit near its middle. If the two sides disagree on the speed, the sample points drift away from the middle of the bits and the byte arrives wrong, often as the same odd symbols repeating. A frame of 8N1 has ten bits, so one byte takes roughly 1.04 ms at 9600 baud.

SoftwareSerial does that timing in code, so anything that delays interrupts shifts the sample points. At higher baud rates the margin gets smaller. Another cause is the board clock. A 3.3 V, 8 MHz Pro Mini selected as a 16 MHz board in the IDE will run the code at the wrong speed, and every baud rate will be off by a factor of two.

How to confirm the cause

  • Test the module first with a known setting: start at 9600, then try 4800 or 38400 if the module’s speed is unknown. An HC-05 in command mode, for example, commonly uses 38400.
  • Connect the module TX to the SoftwareSerial RX pin and the module RX to the SoftwareSerial TX pin. Swapped wires give no data, not garbage, so garbage means the wires are probably right.
  • Check the Serial Monitor speed against the Serial.begin() value; both sides of the PC link must match as well.
  • Run a loopback: join the SoftwareSerial TX pin to its RX pin and send a character. If it comes back correctly, the code and board work.
  • Check the voltage. A 5 V board driving a 3.3 V module needs a divider on its TX line.

Worked example

A pass-through sketch that shows what the module sends. The pins are an example for an Uno: pin 10 receives, pin 11 transmits.

#include <SoftwareSerial.h>
SoftwareSerial mod(10, 11);   // RX, TX
void setup() {
  Serial.begin(115200);
  mod.begin(9600);
}
void loop() {
  if (mod.available()) Serial.write(mod.read());
  if (Serial.available()) mod.write(Serial.read());
}

Common mistakes

  • Choosing a receive pin that the board does not support for SoftwareSerial. The Mega allows only certain pins.
  • Using pins 0 and 1 for SoftwareSerial while the USB serial is also in use.
  • Setting the board to the wrong clock speed in the board menu.
  • Sending data while expecting to receive at the same moment, since SoftwareSerial cannot do both.
  • Forgetting the line ending setting in the Serial Monitor when sending commands to a module.

If this did not fix it

  • Check the grounds of the two devices. A missing ground makes random data.
  • Check the supply. A module that browns out when it transmits sends damaged bytes.
  • Use a hardware serial port if the board has a spare one. It removes the timing problem.