SlideShare a Scribd company logo
2
Most read
5
Most read
11
Most read
Arduino Based Applications
Part-2
By
Jawaher A.Fadhil
B.SC in Electronics Engineering
M.Tech in Computer Engineering
University of Duhok
College of Science
CS Department
Serial Communication
2
Introducing Serial Communication
The word serial comes from the way data is transmitted;
serial devices send bits one at a time on a single wire. This is
something that you have seen before; it is like a telephone
call. Both users pick up the telephone and a single wire
connects them together.
While serial devices send bits on a single wire, parallel
devices send multiple bits on multiple wires. Although
parallel communications can be faster than serial, they were
often more expensive, requiring more wires. There are also
speed limitations due to physical limitations of conductive
wiring. The next figure shows the difference between serial
and parallel communications.
3
Introducing Serial Communication
4
Serial versus parallel
Introducing Serial Communication
Serial ports are extremely simple. This simplicity is one reason
why they are used so often. Data is sent on one wire, the
transmit wire (TX), and received on another, the receive wire
(RX). On the other side of the cable, it is connected to another
computer with a TX pin and an RX pin. Inside the cable itself, the
TX and RX wires are inverted. The TX pin on one side is
connected to the RX pin on the other side. This is illustrated in
Figure.
5
Transmit and receive wires
Introducing Serial Communication
Arduinos use serial ports for communicating with computers
and other devices. The USB port of an Arduino is used for
serial communication with a computer, with the added
advantage that USB can also be used to power the device.
USB also has the advantage of auto-configuring most of the
parameters.
Some Arduinos have other hardware serial ports, enabling
communication with other devices. The USB communication
is sent to Arduino pins 0 and 1, meaning that those pins are
reserved if your device must communicate with a computer.
6
Starting a Serial Connection
To Start a Serial Connection you must first do some basic
configuration. To do this, you use the begin function of the
Serial object. Typically, 9,600 is an appropriate speed for
communicating. You are free to use any speed you want as long
as both devices are operating at the same speed.
void setup()
{
Serial.begin(9600); // Opens the serial port
}
Serial configuration is normally done in setup() because devices
tend to not change the speed at which they communicate over
time.
7
Sending Text
To send data to the serial device , use the function print(). The
data to be printed can be in any format.
Serial.print("Hello, world"); // Output an entire string
Serial.print('!'); // Output a single character
8
Serial Communication-writing
You need the following components:
• Arduino Uno
• USB cable
Serial Communication-writing
void setup( )
{
pinMode(13, OUTPUT);
Serial.begin(9600); // sets data rate to 9600 bps
}
void loop()
{
digitalWrite(13, HIGH);
Serial.println("LED is On");
delay(1000);
digitalWrite(13, LOW);
Serial.println("LED is Off");
delay(1000);
} 9
Serial Communication-Reading
Arduinos can also receive data. Receiving data can be used for
many projects; computers can send data, for example, to control
the brightness of an LED. To read data from the serial device , use
the function Serial.read( );
int ledPin=13;
int value;
void setup()
{
Serial.begin(9600);
pinMode(ledPin,OUTPUT);
}
10
Serial Communication-Reading
void loop ()
{value = Serial.read();
if (value == '1')
{
digitalWrite(ledPin,HIGH);
}
else if (value == '0')
{
digitalWrite(ledPin,LOW);
}
}
11
Reference
James A. Langbridge,” Arduino sketches tools and
techniques for programming wizardry”,2015.
12
13

More Related Content

PPTX
Nested loops
PPSX
Introduction to BBC Micro:Bit
PPTX
Integration
PDF
Understanding IoT
PPTX
Integration of Sensors & Actuators With Arduino.pptx
PDF
Duoc lieu chua saponin dai cuong gs ts nguyen minh duc
PPTX
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
PPTX
Generations of computers
Nested loops
Introduction to BBC Micro:Bit
Integration
Understanding IoT
Integration of Sensors & Actuators With Arduino.pptx
Duoc lieu chua saponin dai cuong gs ts nguyen minh duc
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Generations of computers

What's hot (20)

PDF
8051 Microcontroller I/O ports
PPTX
PPT ON Arduino
PDF
Serial Communication Interfaces
PPTX
Architecture of 8051
PPTX
MICROCONTROLLER 8051- Architecture & Pin Configuration
PPT
Arduino
PPTX
Humidity and Temperature Measurement Using Arduino
PPTX
Arduino course
PPTX
Different Arduino Boards
PDF
Introduction to Microcontroller
PPT
Intro to Arduino
PPTX
Basics of arduino uno
PPTX
8051 Microcontroller ppt
PPTX
Introduction to Arduino Hardware and Programming
PPTX
Introduction to Arduino
PPTX
Robotic Hand
PPT
Memory & I/O interfacing
PDF
Arduino Workshop Day 1 - Basic Arduino
PPTX
Introduction to Microcontroller
PPTX
Embedded system
8051 Microcontroller I/O ports
PPT ON Arduino
Serial Communication Interfaces
Architecture of 8051
MICROCONTROLLER 8051- Architecture & Pin Configuration
Arduino
Humidity and Temperature Measurement Using Arduino
Arduino course
Different Arduino Boards
Introduction to Microcontroller
Intro to Arduino
Basics of arduino uno
8051 Microcontroller ppt
Introduction to Arduino Hardware and Programming
Introduction to Arduino
Robotic Hand
Memory & I/O interfacing
Arduino Workshop Day 1 - Basic Arduino
Introduction to Microcontroller
Embedded system
Ad

Similar to Arduino- Serial communication (20)

DOCX
UART project report by Tarun Khaneja ( 09034406598 )
PDF
Device Operation using PC by Arduino (1).pdf
PPTX
Serial Communication in Internet of Things .pptx
PDF
Network system on Ahsanullah University of Science & Technology
PDF
M010617376
PDF
Serial Communication Interface with Error Detection
PPTX
Universal serial bus
DOCX
Network Devices
PPT
Ethernet and switches
PDF
Automation and Robotics 20ME51I_Week_3_Practicals.pdf
PDF
Industrial Automation notes_unit2_part3_.pdf
DOCX
Computer networks
PDF
Hands On Data Communications, Networking and TCP/IP Troubleshooting
DOCX
What is computer network? Give details.
DOCX
Project_intership
DOCX
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
PPTX
computer network basics
PDF
CSE491_Computer_Interfacing_and_Peripherals_Lec1.pdf
PPT
Networking
UART project report by Tarun Khaneja ( 09034406598 )
Device Operation using PC by Arduino (1).pdf
Serial Communication in Internet of Things .pptx
Network system on Ahsanullah University of Science & Technology
M010617376
Serial Communication Interface with Error Detection
Universal serial bus
Network Devices
Ethernet and switches
Automation and Robotics 20ME51I_Week_3_Practicals.pdf
Industrial Automation notes_unit2_part3_.pdf
Computer networks
Hands On Data Communications, Networking and TCP/IP Troubleshooting
What is computer network? Give details.
Project_intership
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
computer network basics
CSE491_Computer_Interfacing_and_Peripherals_Lec1.pdf
Networking
Ad

More from Jawaher Abdulwahab Fadhil (20)

PDF
PPT
PDF
Add instruction-part1
PPTX
Dealing with 8086 memory
PPTX
MOV instruction part1
PDF
Cisco webex installation guide
PPTX
A survey on the applications of smart home
PPT
Flag register and add instruction
PDF
Computer Organization -part 1
PPTX
iOS Operating System
PPTX
Android Operating system
PPTX
Types of Mobile Applications
PDF
Ultrasonic with buzzer
PDF
Lecture6 modulation
PDF
Lecture 5: The Convolution Sum
PDF
Lecture 4: Classification of system
PDF
Lecture3: Operations of Ct signals
PDF
Lecture2 : Common continuous time signals
PDF
Lecture1: Introduction to signals
PDF
Arduino based Applications-part 6
Add instruction-part1
Dealing with 8086 memory
MOV instruction part1
Cisco webex installation guide
A survey on the applications of smart home
Flag register and add instruction
Computer Organization -part 1
iOS Operating System
Android Operating system
Types of Mobile Applications
Ultrasonic with buzzer
Lecture6 modulation
Lecture 5: The Convolution Sum
Lecture 4: Classification of system
Lecture3: Operations of Ct signals
Lecture2 : Common continuous time signals
Lecture1: Introduction to signals
Arduino based Applications-part 6

Recently uploaded (20)

PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Business Ethics Teaching Materials for college
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Cell Structure & Organelles in detailed.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Pre independence Education in Inndia.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Business Ethics Teaching Materials for college
Supply Chain Operations Speaking Notes -ICLT Program
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
human mycosis Human fungal infections are called human mycosis..pptx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
O7-L3 Supply Chain Operations - ICLT Program
Final Presentation General Medicine 03-08-2024.pptx
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Anesthesia in Laparoscopic Surgery in India
Cell Structure & Organelles in detailed.

Arduino- Serial communication

  • 1. Arduino Based Applications Part-2 By Jawaher A.Fadhil B.SC in Electronics Engineering M.Tech in Computer Engineering University of Duhok College of Science CS Department
  • 3. Introducing Serial Communication The word serial comes from the way data is transmitted; serial devices send bits one at a time on a single wire. This is something that you have seen before; it is like a telephone call. Both users pick up the telephone and a single wire connects them together. While serial devices send bits on a single wire, parallel devices send multiple bits on multiple wires. Although parallel communications can be faster than serial, they were often more expensive, requiring more wires. There are also speed limitations due to physical limitations of conductive wiring. The next figure shows the difference between serial and parallel communications. 3
  • 5. Introducing Serial Communication Serial ports are extremely simple. This simplicity is one reason why they are used so often. Data is sent on one wire, the transmit wire (TX), and received on another, the receive wire (RX). On the other side of the cable, it is connected to another computer with a TX pin and an RX pin. Inside the cable itself, the TX and RX wires are inverted. The TX pin on one side is connected to the RX pin on the other side. This is illustrated in Figure. 5 Transmit and receive wires
  • 6. Introducing Serial Communication Arduinos use serial ports for communicating with computers and other devices. The USB port of an Arduino is used for serial communication with a computer, with the added advantage that USB can also be used to power the device. USB also has the advantage of auto-configuring most of the parameters. Some Arduinos have other hardware serial ports, enabling communication with other devices. The USB communication is sent to Arduino pins 0 and 1, meaning that those pins are reserved if your device must communicate with a computer. 6
  • 7. Starting a Serial Connection To Start a Serial Connection you must first do some basic configuration. To do this, you use the begin function of the Serial object. Typically, 9,600 is an appropriate speed for communicating. You are free to use any speed you want as long as both devices are operating at the same speed. void setup() { Serial.begin(9600); // Opens the serial port } Serial configuration is normally done in setup() because devices tend to not change the speed at which they communicate over time. 7
  • 8. Sending Text To send data to the serial device , use the function print(). The data to be printed can be in any format. Serial.print("Hello, world"); // Output an entire string Serial.print('!'); // Output a single character 8 Serial Communication-writing You need the following components: • Arduino Uno • USB cable
  • 9. Serial Communication-writing void setup( ) { pinMode(13, OUTPUT); Serial.begin(9600); // sets data rate to 9600 bps } void loop() { digitalWrite(13, HIGH); Serial.println("LED is On"); delay(1000); digitalWrite(13, LOW); Serial.println("LED is Off"); delay(1000); } 9
  • 10. Serial Communication-Reading Arduinos can also receive data. Receiving data can be used for many projects; computers can send data, for example, to control the brightness of an LED. To read data from the serial device , use the function Serial.read( ); int ledPin=13; int value; void setup() { Serial.begin(9600); pinMode(ledPin,OUTPUT); } 10
  • 11. Serial Communication-Reading void loop () {value = Serial.read(); if (value == '1') { digitalWrite(ledPin,HIGH); } else if (value == '0') { digitalWrite(ledPin,LOW); } } 11
  • 12. Reference James A. Langbridge,” Arduino sketches tools and techniques for programming wizardry”,2015. 12
  • 13. 13