Arduino Serial Communication
Arduino Serial Communication
SERIAL COMMUNICATION
WHAT IS SERIAL COMMUNICATION?
Serial communication is a method of
transmitting data between electronic
devices on bit a time over a
communication channel or wire.
WHAT IS SERIAL
COMMUNICATION?
WHAT IS SERIAL COMMUNICATION?
Serial communication sends data sequentially,
using only one channel. This method is
commonly used in various application,ranging
from simple communication between two
microcontrollers to complex data between
computer peripherals
WHAT IS SERIAL COMMUNICATION?
Serial communication sends data sequentially,
using only one channel. This method is
commonly used in various application,
ranging from simple communication between
two microcontrollers to complex data between
computer peripherals
SIGNIFICANCE OF SERIAL
COMMUNICATION
SIGNIFICANCE OF SERIAL
COMMUNICATION
• Communication with peripherals
• Programming and debugging
• PC connectivity
• Expansion and networking
• Wireless communication
• Data Transfer and Integration
ARDUINO SERIAL
COMMUNICATION BASICS
Serial.begin() function and its parameters
• Serial.begin() is a function used to initialize serial
communication on Arduino. It configures the baud
rate(data transfer speed ) for communication.
Syntax
Serial.print(data);
Serial.println(data);
If ‘b’
turn on blue led
turn off green and red led
If ‘s’
turn off all leds
Control LED using Serial Communication(CMD)
powershell
[System.IO.Ports.SerialPort]::getportnames()
$port= new-Object System.IO.Ports.SerialPort COM#,9600,None,8,one
$port.open()
$port.WriteLine()
$port.ReadLine()
$port.close()
Control LED using Serial Communication(CMD)
ARDUINO BLUETOOTH MODULE
1. Key/EN: It is used to bring Bluetooth module in AT commands mode. If Key/EN pin is
set to high, then this module will work in command mode. Otherwise by default it is in
data mode. The default baud rate of HC-05 in command mode is 38400bps and 9600 in
data mode.
HC-05 module has two modes,
1. Data mode: Exchange of data between devices.
2. Command mode: It uses AT commands which are used to change setting of HC-
05. To send these commands to module serial (USART) port is used.
2. VCC: Connect 5 V or 3.3 V to this Pin.
3. GND: Ground Pin of module.
4. TXD: Transmit Serial data (wirelessly received data by Bluetooth module transmitted
out serially on TXD pin)
5. RXD: Receive data serially (received data will be transmitted wirelessly by Bluetooth
module).
6. State: It tells whether module is connected or not.
ARDUINO BLUETOOTH MODULE