Under the Hood: How Serial Communication Works (Bits, Bytes, and Voltages)

When you set your terminal to "9600 baud, 8N1", you're configuring the rules for a conversation. But what's actually happening on the wire? How does the letter 'K' travel from one device to another? The answer lies in carefully timed voltage changes.

~9 minutes

Under the Hood: How Serial Communication Works (Bits, Bytes, and Voltages)

When you set your terminal to "9600 baud, 8N1", you're configuring the rules for a conversation. But what's actually happening on the wire? How does the letter 'K' travel from one device to another? The answer lies in carefully timed voltage changes.

Serial communication is asynchronous, meaning there is no separate clock signal sent with the data. Both the sender and receiver must be synchronized to the same clock speed (the baud rate) and listen for a special signal that announces the start of a new piece of data.

The Logic Levels: High and Low

At its most basic level, serial communication uses two different voltage levels to represent binary 1s and 0s.

  • High (Logic 1): A higher voltage level (e.g., +5V or +3.3V).
  • Low (Logic 0): A lower voltage level (e.g., 0V or Ground).

The line that carries this signal is called the data line. When no data is being sent, the line is held in an "idle" state, which is always High (Logic 1).

The Serial Frame: Anatomy of a Transmission

When a device wants to send a byte of data (like the ASCII code for 'K', which is 01001011), it doesn't just put the bits on the wire. It wraps them in a structure called a frame or a packet. This gives the receiver a clear start and end point for each byte.

Let's follow the journey of one byte using the diagram above:

  1. Idle State: Before the transmission, the line is High. The receiver is constantly listening, waiting for a change.

  2. The Start Bit: To signal the beginning of a new frame, the sender pulls the line from High to Low for the duration of one bit (determined by the baud rate). This transition is the receiver's cue to start its clock and begin listening for the upcoming data bits. The Start Bit is always a Logic 0.

  3. The Data Bits: Immediately following the start bit, the sender transmits the individual bits of the data byte. There's a crucial detail here: the data is sent Least Significant Bit (LSB) first. So, for the letter 'K' (01001011), the sender will actually put 1, then 1, then 0, then 1, then 0, then 0, then 1, then 0 onto the wire. The receiver reads the voltage at the middle of each bit's time slot to determine if it's a 1 or a 0.

  4. The Parity Bit (Optional): If parity checking is enabled (as discussed in our Baud Rates, Data Bits, and Parity: Demystifying Serial Port Settings article), this bit is sent after the data bits. In our "8N1" example, this bit is skipped entirely.

  5. The Stop Bit(s): To signal the end of the frame, the sender pulls the line back to High for at least one bit's duration. This is the Stop Bit. It guarantees the line returns to the idle state, ready for the next Start Bit. The Stop Bit is always a Logic 1.

This entire process—Start, Data, Stop—happens thousands of times per second. At 9600 baud, the duration of each bit is approximately 104 microseconds (1 / 9600 seconds). If the receiver's timing is even slightly off (i.e., the wrong baud rate), it will read the voltage at the wrong moments, resulting in jumbled data. This is why matching the settings is not just important—it's the fundamental requirement for communication.