Arduino programming guide series

02

What is the "baud" rate?

The "baud" rate is a unit used to describe the speed of serial communications between two electronic devices. The exact meaning of this unit is often clout in confusion. What exactly is "baud"?

The baud rate (the symbol is "Bd") is unit we use to describe the "speed" of communication between the two electronic devices. Your computer and the Arduino talk via the USB/RS-232 or similar (serial) interface. There are a few parameters that control this communication, but all of them are standardized (so you don't have to worry about them) except for the speed.

If you don't set the two devices to the same speed, then one device will be sending data to the other faster or slower than expected. When two serial devices are not set on the same communications speed, data interchange will not be reliable.

What is a "baud"?

A speed of 9600 bauds means that data will flow between the devices at a rate of 9600 signal changes per second.

A signal change is an event such as a change in one of the signal's electrical characteristics, such as the voltage, phase, or frequency.

A common cause of confusion here is that often people incorrectly perceive that 1 signal change is the same as 1 bit. Therefore, people expect that 9600 bauds are the same as 9600 bits per second, which it isn't.

At the electrical level, a computer uses voltages to transmit data (a computer can also use multiple voltage levels plus the signal phase to encode multiple bits in a single signal change, but let's keep things simple here). 

By El pak at English Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=20667098

Data is transmitted by changing the signal parameters rapidly. For example, you can create a protocol where binary "1" is transmitted by changing the voltage from HIGH to LOW, and a "0" by changing the voltage from a LOW to HIGH.

When you have a protocol where 1 signal change encodes 1 bit, then 1 baud = 1 bit per second.

It is possible to have multiple bits encoded in a single signal change, as in Phase-shift keying (PSK). In PSK, each signal change encodes 2 bits. So, 1 baud = 2 bit per second.

In quadrature amplitude modulation (QAM), we have 4 bits for every signal change, so 1 baud = 4 bit per second.

And the list goes on.

COM speed in the Arduino

In practical terms, you must ensure that your devices are communicating at the same baud rate. 

For the Arduino, do this:

  1. Look in your Arduino sketch for a line that looks like this (in the setup function): Serial.begin(9600) -- The number may vary.
    2. Set the speed of your serial terminal on the computer to the same number.

This should do it!

"Arduino programming" series

New to the Arduino?

Arduino Step by Step Getting Started is our most popular course for beginners.

This course is packed with high-quality video, mini-projects, and everything you need to learn Arduino from the ground up. We'll help you get started and at every step with top-notch instruction and our super-helpful course discussion space.

Tech Explorations Arduino intermediate level

Done with the basics? Looking for more advanced topics?

Arduino Step by Step Getting Serious is our comprehensive Arduino course for people ready to go to the next level.

Learn about Wifi, BLE and radio, motors (servo, DC and stepper motors with various controllers), LCD, OLED and TFT screens with buttons and touch interfaces, control large loads like relays and lights, and much much MUCH more.


>