Skip to content

Serial for Humans

Serial communication sounds scary, but it’s just devices having a conversation — one letter at a time. This page explains the core ideas using everyday analogies, then points you to the deep dives when you’re ready.


Imagine two people talking through a very narrow pipe. They can only pass one letter at a time, so to say “HELLO” they pass:

H → E → L → L → O

That’s serial communication. One bit after another, in a line (serial = “in a series”).

Your computer and a device agree on how fast to pass letters, how to know when a word starts and ends, and what to do if a letter gets mangled in the pipe.


🏎️ Baud Rate: How Fast Are We Talking?

Section titled “🏎️ Baud Rate: How Fast Are We Talking?”

Baud rate is how many signal changes per second. Think of it as the speed limit for the pipe.

Baud RateLetters per SecondReal-World Analogy
9600~960Casual conversation
115200~11,520Speed-talking auctioneer
1000000~100,000Two computers screaming at each other

If one side talks at 115200 and the other listens at 9600, it’s like someone speed-reading to a toddler. Gibberish ensues.


✋ Flow Control: “Wait, I’m Not Ready!”

Section titled “✋ Flow Control: “Wait, I’m Not Ready!””

What happens when one side talks faster than the other can listen? The listener’s “ears” fill up and they start missing words.

Flow control is the listener saying “hold on!” (and later “okay, continue”).

Two ways to do this:

MethodHow It WorksAnalogy
XON/XOFFSend special “pause” and “resume” letters in the conversationSaying “wait!” and “go!” out loud
RTS/CTSFlip a physical switch to pause/resumeHolding up your hand to stop someone

RS-232 is like a phone call — two parties, direct connection, multiple wires for different purposes:

WireWhat It DoesAnalogy
TXTransmit (you talk)Your mouth
RXReceive (you listen)Your ear
GNDGround (reference point)Shared understanding of “zero”
RTS/CTSFlow control”Can I talk?” / “Yes, go ahead”
DTR/DSRPresence detection”Are you there?” / “Yes, I’m here”

At minimum, you need TX, RX, and GND. The rest are optional helpers.

RS-485 is like a walkie-talkie channel — many devices, but only one can talk at a time:

  • Two wires (A and B) carry the signal
  • Everyone listens; one device talks
  • You need an address so devices know who’s being asked
  • Termination resistors at each end prevent signal echoes

📝 Text vs Binary: What Language Are We Speaking?

Section titled “📝 Text vs Binary: What Language Are We Speaking?”

Serial ports don’t know if you’re sending English text, emoji, or raw machine code. They just pass bytes.

Text mode (like AT commands):

AT+GMR\r\n

Human-readable, uses characters like letters and newlines.

Binary mode (like Modbus RTU):

01 03 00 00 00 01 84 0A

Machine-readable, exact byte values matter, no “text” interpretation.

The encoding setting tells mcserial how to convert between strings and bytes:

EncodingUse WhenExample
UTF-8Text protocols, console output"Hello"48 65 6C 6C 6F
Latin-1Binary protocols, raw bytes"\x01\x03"01 03 (exact bytes)

When you ask a device a question, how long do you wait for an answer before assuming it’s not coming?

  • Too short: You give up before the device finishes thinking
  • Too long: You stare at a dead device forever

Rule of thumb: 2× the expected response time is a safe starting point.

Some devices are slow thinkers:

  • GPS during cold start: 30-60 seconds to find satellites
  • Flash memory writes: several seconds to complete
  • Sleepy microcontrollers: may need a wake-up poke first

Serial communication fails in predictable ways. Here’s the cheat sheet:

SymptomLikely CauseQuick Fix
Garbage charactersWrong baud rateMatch baud rates on both ends
No response at allDevice off, wrong port, or TX/RX swappedCheck connections, try other ports
Partial data, missing bytesBuffer overflow (no flow control)Enable RTS/CTS or XON/XOFF
”Permission denied”Your user can’t access the portAdd yourself to the dialout group
Works once, then stopsPort left open from last timeClose and reopen the port

Before networks, people sent files over serial using protocols like XMODEM, YMODEM, and ZMODEM. These protocols:

  1. Break the file into chunks
  2. Add error-checking to each chunk
  3. Resend chunks that got corrupted
  4. Reassemble at the other end

ZMODEM is the best — it’s fast, can resume interrupted transfers, and handles errors gracefully.


Now that you know the basics, try talking to a real device:


Here’s everything in the docs, organized by how deep you want to go: