Arduino Serial Communication Basics : Learn Arduino

arduino serial communication diagram

Arduino serial communication is one of the many ways Arduino talks to other devices. Arduino uses asynchronous serial communication to send-receive data to and from other devices. Arduino Uno supports serial communication via on-board UART port and Tx/Rx pins. Generally this transmission happens at 9600 bits per second which is termed as baud rate.

Arduino Uno Shown with UART port and Tx,Rx Pins

Arduino may communicate with many devices including:

  • Another Arduino
  • A computer
  • LCD display
  • Modem
  • Or any device that supports serial communication

How to do it?
In this example we’ll connect Arduino and a computer using UART port. For this we are going to use Arduino IDE’s Serial Monitor. Serial Monitor will display data we sent from Arduino Uno.

Code:

void setup() {
    Serial.begin(9600);
}
 
void loop() {
    Serial.println("Hello World...");
    delay(1000);
}

Upload this code and select Tools > Serial Monitor (Shift+Ctrl+M). You should see this output.

Serial Monitor output on the computer


Further Reading:

  1. Wikipedia: Serial communication
  2. Arduino Reference: Serial

Comments

avatar
  Subscribe  
Notify of