Communication

Communication

Communication is the process of transmitting information from one location to another.

Serial Communication in Arduino

Serial communication is a way for an Arduino to send and receive data from other devices like a computer, sensors, or another Arduino. It transfers data one bit at a time using a method called UART (Universal Asynchronous Receiver/Transmitter).

How It Works

  • Baud Rate: The speed of communication, measured in bits per second (bps) (Common values: 9600, 115200).
  • TX (Transmit Pin – Pin 1): Sends data.
  • RX (Receive Pin – Pin 0): Receives data.
  • Full Duplex Communication: Arduino can send and receive data at the same time.

1. Sending Messages to Serial Monitor

Arduino can send text or numbers to the Serial Monitor in the Arduino IDE.

Example: Print “Hello, Arduino!” every second

➡ Open Serial Monitor in Arduino IDE (Ctrl + Shift + M) to see the message.

2. Receiving Input from Serial Monitor

Arduino can also receive input from the Serial Monitor and take action.

Example: Turn LED ON or OFF using Serial Input

➡ Open Serial Monitor, type 1, and press Enter → LED turns ON.
➡ Type 0 and press Enter → LED turns OFF.

Where Serial Communication is Used

Debugging Arduino programs with Serial Monitor.
Reading sensor data and sending it to a computer.
Controlling LEDs, motors, and devices using commands.
Making Arduinos talk to each other for robotics projects.

Serial communication makes Arduino projects smarter by allowing them to exchange information easily! 🚀