In this post, we will learn how to serial communicate other device or arduino suing serial communication.
Introduction:
Serial communication (RS-232) is widely used communication for data transfer. It just uses three wires: Rx, Tx and GND
In serial communication, 8/9 -bit is transferred through a single wire. The data frame is like this:
Start bit > Data fields (8 or 9 bit data) > Stop bit
Speed of data transfer is measured in terms of baud rate or bps:
Standard is: 9600 baud rate, none parity bit and one stop bit.
The baud rate should be same for both the devices. Any mismatch in the baud rate and the data will not be transmitted properly.
Bluetooth module (HC-05), Zigbee, GMS module, GPS module all these module uses serial communication. In fact, for communication between two microcontroller, we can use serial communication.
Connections:
Arduino Device
Tx ===============> Rx
Rx ===============> Tx
Just plug in the arduino in your pc/ laptop upload the program below and open terminal software.
Open comport in terminal sofware. The comport should be of arduino.
/* Program starts here */
void setup() {
Serial.begin(9600); // starts serial communication @9600 bps
}
void loop() {
Serial.print("ARDUINO"); // serially print arduino
//Serial.println("ARDUINO"); // serially print arduino in new line
delay(1000); // dealy of 1000ms
}
/* Program ends here */
Check this video:
Introduction:
Serial communication (RS-232) is widely used communication for data transfer. It just uses three wires: Rx, Tx and GND
In serial communication, 8/9 -bit is transferred through a single wire. The data frame is like this:
Start bit > Data fields (8 or 9 bit data) > Stop bit
Speed of data transfer is measured in terms of baud rate or bps:
Standard is: 9600 baud rate, none parity bit and one stop bit.
The baud rate should be same for both the devices. Any mismatch in the baud rate and the data will not be transmitted properly.
Bluetooth module (HC-05), Zigbee, GMS module, GPS module all these module uses serial communication. In fact, for communication between two microcontroller, we can use serial communication.
Connections:
Arduino Device
Tx ===============> Rx
Rx ===============> Tx
GND ===============> GND
For interfacing arduino with pc/ laptop, we need terminal software like bray's terminal.
Just plug in the arduino in your pc/ laptop upload the program below and open terminal software.
Open comport in terminal sofware. The comport should be of arduino.
/* Program starts here */
void setup() {
Serial.begin(9600); // starts serial communication @9600 bps
}
void loop() {
Serial.print("ARDUINO"); // serially print arduino
//Serial.println("ARDUINO"); // serially print arduino in new line
delay(1000); // dealy of 1000ms
}
/* Program ends here */
Check this video:
No comments:
Post a Comment