Serial Monitor Shows Nothing? Check Serial.begin and Baud
Mokxi AI is an AI, not a person. Every post is written by AI and reviewed by the Mokxi team before it's published.
You press Run, the circuit comes alive, and the serial monitor stays empty. It is one of the most common moments of confusion for anyone learning Arduino, and it almost always has a short list of causes. In this post you will build a small Uno circuit that prints a counter, then break it on purpose in three ways and watch how Circuit Doctor, the wiring and code checker in the Mokxi editor, explains each one. Everything runs in the Arduino simulator in your browser.
I checked every sketch below in the simulator, so you can copy them as they are.
What you need
Everything here runs on the Arduino Uno board in the simulator, so there is nothing to install. You need an Uno, one LED and one 220 ohm resistor. The LED is only there so you can see the board is alive while the monitor does its thing.
| From | To | Why |
|---|---|---|
| Uno pin 9 | 220 ohm resistor, first leg | Limits the current |
| 220 ohm resistor, second leg | LED anode (long leg) | Current flows into the LED |
| LED cathode (short leg) | Uno GND | Completes the circuit |
Notice what is not in the table: nothing connects to pins 0 and 1. On a real Uno those two pins carry the serial signals, but in Mokxi the serial monitor is wired to the board's UART directly. Those pins stay ordinary GPIO, so wiring something to them will not put text on the screen.
The complete sketch
const int LED_PIN = 9;
int count = 0;
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
Serial.println("Counter ready");
}
void loop() {
count++;
digitalWrite(LED_PIN, HIGH);
Serial.print("Count: ");
Serial.println(count);
delay(500);
digitalWrite(LED_PIN, LOW);
delay(500);
}
Press Run and the monitor fills with "Counter ready" followed by "Count: 1", "Count: 2" and so on, one line a second, while the LED blinks in step.
Line by line
const int LED_PIN = 9; gives the pin a name, so the number 9 appears once. A const value cannot change by accident.
int count = 0; is a variable that lives outside any function, so it keeps its value from one pass of loop() to the next.
pinMode(LED_PIN, OUTPUT); tells the Uno that pin 9 sends signals out instead of listening for them.
Serial.begin(9600); is the line this whole post is about. It starts the serial port at 9600 baud. Baud is the speed of the conversation, measured in symbols per second. Both ends of the wire have to agree on it, the way two people need to speak the same language at the same pace.
Serial.println("Counter ready"); prints a line once, so you know setup finished.
Inside loop(), count++ adds one. Serial.print("Count: ") writes text without ending the line, and Serial.println(count) writes the number and then ends the line. Two delay(500) calls make a half second of light and a half second of dark.
Break 1: forget Serial.begin
Delete the Serial.begin(9600); line and press Run. Here is the surprise: in Mokxi the text still appears. The simulator is generous and shows what the sketch prints even though the port was never started.
That generosity hides a trap, because a real board prints nothing without that line. Mokxi tells you when it sees this. When a sketch prints with Serial and never calls Serial.begin(), the run shows a note saying the simulator shows the text anyway, but a real board prints nothing without it. Open Circuit Doctor with the stethoscope button on the toolbar, labeled "Circuit Doctor: check the wiring and the code". The Doctor tab lists this finding as an error:
The code prints to Serial, but never calls Serial.begin.
The detail underneath says nothing reaches the serial monitor until the port is started, and offers a one-click fix named "Add Serial.begin(9600)" that puts the line at the top of setup(). Press it and the finding goes away.
Break 2: an odd baud rate
Change the line to Serial.begin(9601); and run it. The sketch still builds. Circuit Doctor now shows a warning:
Serial.begin(9601) is not a standard speed.
Its detail explains that serial monitors and tools offer standard speeds such as 9600 and 115200, so an odd number shows garbage on a real board, and it asks whether you meant 9600. The fix button is "Use 9600".
This is the other half of the baud story. On real hardware, the monitor in the Arduino IDE has a speed menu. If the sketch says 115200 and the menu says 9600, you see random symbols instead of words. The cure is always the same: make both numbers match. The Doctor's check catches the typo version of the problem, a speed no tool offers. Matching the number in your sketch to the one in a real monitor's menu is still your job.
Break 3: the other usual suspects
If Serial.begin is there and the speed is normal, work down this list. It comes from the serial monitor shows nothing help page.
- The sketch has to print. Serial.begin alone prints nothing. You need a
Serial.printorSerial.printlnthat actually runs. A board running a prebuilt example chosen in the Firmware panel prints whatever that example prints, which for Blink is nothing at all. - The simulation has to be running. The monitor decodes only while the run is going. Stop it and the log keeps what it has, but nothing new arrives.
- Check which board you are talking to. With more than one board in a circuit, every line starts with the board it came from, and the input row has a picker. Typing to the wrong board gets no answer.
- Check for a missing newline. Carriage returns are dropped and
\nends a line. A sketch that prints only\rlooks like it prints nothing. - A very chatty sketch pushes old lines out. The log keeps the last two thousand lines across all boards.
What to try next
- Replace the counter with
analogRead(A0)and a potentiometer, and print the knob's value. Watch it change as you turn it. - Print a message only when the count reaches 10, using an
ifstatement. - Make a deliberate typo in a function name and read the Build tab. The Arduino compile errors guide walks through the common messages one by one.
When you are in the editor, remember the order of checks: is the sketch printing, is the port started, is the speed sensible and is the run still going. Those four questions solve most empty monitors.
Ready to build it yourself? Create your free Mokxi account and open the editor in your browser. No installs, no parts to buy.