Serial.print makes the robot slow or jerky

Printing many characters each loop can take longer than the control code itself. At 9600 baud one character takes about one millisecond.

What the message means

Serial output is slow compared with the processor. When the transmit buffer fills, Serial.print waits until space is free, and the loop slows down.

Fix it in this order

  1. Raise the baud rate to 115200 in both the sketch and the Serial Monitor.
  2. Print less often, for example once every 100 ms using millis().
  3. Print short values, not long text.
  4. Remove debug prints from the fast control loop in the final version.
  5. Do not print inside interrupt routines.
  6. Check the loop time with micros() before and after your change.

Why it happens

Serial.print waits when the transmit buffer is full. At 9600 baud about 960 characters per second can be sent, so printing long lines on every loop slows the robot and can delay sensor reads and motor updates.

Raise the baud rate, print less often using millis() timing, or print only when a value changes. Remove debugging output you no longer need.

If you see this, do this

You seeDo this
Motor control lags with prints onReduce printing.
Garbage on monitorBaud mismatch.

delay() and millis(), serial garbage.

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

Serial transmission is slow. At 9600 baud with 8 data bits, no parity and one stop bit, each character takes 10 bit times, so 960 characters per second, or about 1.04 ms per character. A line like ‘Value: 512’ plus a line ending is 12 characters and takes about 12.5 ms. The AVR serial library copies characters into a 64-byte buffer and sends them in the background. Once the buffer is full, Serial.print waits for space.

At 115200 baud the time per character drops to about 87 microseconds. Higher speed and less text both help, but the cleanest fix is to print less often than the loop runs.

How to confirm the cause

  • Measure the call: take micros() before and after a long Serial.println. A short time with a short line and a long time with a long line shows blocking.
  • Remove the printing for a test. If the robot runs smoothly, serial output is the cause.
  • Compute the load: characters per line multiplied by lines per second must be well below baud divided by 10.
  • Count how many characters your loop prints in one pass.

Worked example

Arithmetic: 100 characters at 9600 baud is about 104 ms in total. The buffer holds 64, so roughly 36 characters, about 37 ms, must wait.

char line[100];

void setup() {
  Serial.begin(9600);
  memset(line, 'x', 99);
  line[99] = 0;
  unsigned long t0 = micros();
  Serial.println(line);
  Serial.println(micros() - t0);   // roughly 35-40 ms at 9600
}
void loop() {}

Common mistakes

  • Raising the baud rate in the sketch but not in the Serial Monitor.
  • Using Serial.flush() in the loop, which waits for all data to be sent.
  • Printing from an interrupt routine.
  • Keeping debug prints in the final robot code.

If this did not fix it

  • Check delay() calls in the loop.
  • Check slow sensor reads, such as pulseIn without a timeout.
  • Check I2C display updates, which take a long time per refresh.
  • Check analogRead frequency; each read takes about 100 microseconds on an Uno.