SlideShare a Scribd company logo
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

What's hot

Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
Vishnu
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
Amarjeetsingh Thakur
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
eddy royappa
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Richard Rixham
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
Md. Nahidul Islam
 
Arduino
ArduinoArduino
Arduino
vipin7vj
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
Amarjeetsingh Thakur
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
Omkar Rane
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Gaurav Pandey
 
Arduino Projects
Arduino ProjectsArduino Projects
Arduino Projects
Luki B. Subekti
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
Emertxe Information Technologies Pvt Ltd
 
Programmable Logic Array(PLA) & Programmable Array Logic(PAL)
Programmable Logic Array(PLA) & Programmable Array Logic(PAL)Programmable Logic Array(PLA) & Programmable Array Logic(PAL)
Programmable Logic Array(PLA) & Programmable Array Logic(PAL)
Revathi Subramaniam
 
Arduino uno
Arduino unoArduino uno
Arduino uno
creatjet3d labs
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
Betsy Eng
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
Niket Chandrawanshi
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
student
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boards
elprocus
 

What's hot (20)

Interfacing to lcd with arduino
Interfacing  to lcd with arduinoInterfacing  to lcd with arduino
Interfacing to lcd with arduino
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Introduction to Node MCU
Introduction to Node MCUIntroduction to Node MCU
Introduction to Node MCU
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction of Arduino Uno
Introduction of Arduino UnoIntroduction of Arduino Uno
Introduction of Arduino Uno
 
Arduino
ArduinoArduino
Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Verilog full adder in dataflow & gate level modelling style.
Verilog full adder in dataflow  & gate level modelling style.Verilog full adder in dataflow  & gate level modelling style.
Verilog full adder in dataflow & gate level modelling style.
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Arduino Projects
Arduino ProjectsArduino Projects
Arduino Projects
 
Communication protocols - Embedded Systems
Communication protocols - Embedded SystemsCommunication protocols - Embedded Systems
Communication protocols - Embedded Systems
 
Programmable Logic Array(PLA) & Programmable Array Logic(PAL)
Programmable Logic Array(PLA) & Programmable Array Logic(PAL)Programmable Logic Array(PLA) & Programmable Array Logic(PAL)
Programmable Logic Array(PLA) & Programmable Array Logic(PAL)
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Lesson sample introduction to arduino
Lesson sample   introduction to arduinoLesson sample   introduction to arduino
Lesson sample introduction to arduino
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
What are the different types of arduino boards
What are the different types of arduino boardsWhat are the different types of arduino boards
What are the different types of arduino boards
 

Similar to Arduino- Serial communication

UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )
Tarun Khaneja
 
Network system on Ahsanullah University of Science & Technology
Network system on Ahsanullah University of Science & TechnologyNetwork system on Ahsanullah University of Science & Technology
Network system on Ahsanullah University of Science & Technology
Manas Saha
 
Serial Communication Interface with Error Detection
Serial Communication Interface with Error DetectionSerial Communication Interface with Error Detection
Serial Communication Interface with Error Detection
iosrjce
 
M010617376
M010617376M010617376
M010617376
IOSR Journals
 
Universal serial bus
Universal serial busUniversal serial bus
Universal serial bus
Muhammad Muzaffar Khan
 
Network Devices
Network DevicesNetwork Devices
Network Devices
SamiuR RahmaN
 
Ethernet and switches
Ethernet and switchesEthernet and switches
Ethernet and switches
Bhavik Vashi
 
Automation and Robotics 20ME51I_Week_3_Practicals.pdf
Automation and Robotics 20ME51I_Week_3_Practicals.pdfAutomation and Robotics 20ME51I_Week_3_Practicals.pdf
Automation and Robotics 20ME51I_Week_3_Practicals.pdf
Gandhibabu8
 
Computer networks
Computer networksComputer networks
Computer networks
Sayma Sultana
 
Hands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP TroubleshootingHands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP Troubleshooting
Living Online
 
Types of Networks
Types of NetworksTypes of Networks
What is computer network? Give details.
What is computer network? Give details.What is computer network? Give details.
What is computer network? Give details.
MuhammadTanveer121
 
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docxSupportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
picklesvalery
 
computer network basics
computer network basicscomputer network basics
computer network basics
MohammedAdhil11
 
Design and implementation of uart on soc
Design and implementation of uart on socDesign and implementation of uart on soc
Design and implementation of uart on soc
Ijrdt Journal
 
Data Communication Basics
Data Communication BasicsData Communication Basics
Data Communication Basics
Hetauda City College
 

Similar to Arduino- Serial communication (20)

UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )UART project report by Tarun Khaneja ( 09034406598 )
UART project report by Tarun Khaneja ( 09034406598 )
 
Network system on Ahsanullah University of Science & Technology
Network system on Ahsanullah University of Science & TechnologyNetwork system on Ahsanullah University of Science & Technology
Network system on Ahsanullah University of Science & Technology
 
Serial Communication Interface with Error Detection
Serial Communication Interface with Error DetectionSerial Communication Interface with Error Detection
Serial Communication Interface with Error Detection
 
M010617376
M010617376M010617376
M010617376
 
Universal serial bus
Universal serial busUniversal serial bus
Universal serial bus
 
Network Devices
Network DevicesNetwork Devices
Network Devices
 
Ethernet and switches
Ethernet and switchesEthernet and switches
Ethernet and switches
 
Automation and Robotics 20ME51I_Week_3_Practicals.pdf
Automation and Robotics 20ME51I_Week_3_Practicals.pdfAutomation and Robotics 20ME51I_Week_3_Practicals.pdf
Automation and Robotics 20ME51I_Week_3_Practicals.pdf
 
Computer networks
Computer networksComputer networks
Computer networks
 
Hands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP TroubleshootingHands On Data Communications, Networking and TCP/IP Troubleshooting
Hands On Data Communications, Networking and TCP/IP Troubleshooting
 
Types of Networks
Types of NetworksTypes of Networks
Types of Networks
 
What is computer network? Give details.
What is computer network? Give details.What is computer network? Give details.
What is computer network? Give details.
 
Project_intership
Project_intershipProject_intership
Project_intership
 
Project_intership
Project_intershipProject_intership
Project_intership
 
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docxSupportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
Supportive Security Policies in SOHOTopic SUPPORTIVE SECURI.docx
 
computer network basics
computer network basicscomputer network basics
computer network basics
 
Networking
NetworkingNetworking
Networking
 
Design and implementation of uart on soc
Design and implementation of uart on socDesign and implementation of uart on soc
Design and implementation of uart on soc
 
Data Communication Basics
Data Communication BasicsData Communication Basics
Data Communication Basics
 
Ethernet_Networks
Ethernet_NetworksEthernet_Networks
Ethernet_Networks
 

More from Jawaher Abdulwahab Fadhil

Binary adder
Binary adderBinary adder
Number system
Number systemNumber system
Add instruction-part1
Add instruction-part1Add instruction-part1
Add instruction-part1
Jawaher Abdulwahab Fadhil
 
Dealing with 8086 memory
Dealing with 8086 memoryDealing with 8086 memory
Dealing with 8086 memory
Jawaher Abdulwahab Fadhil
 
MOV instruction part1
MOV  instruction part1MOV  instruction part1
MOV instruction part1
Jawaher Abdulwahab Fadhil
 
Cisco webex installation guide
Cisco webex installation guideCisco webex installation guide
Cisco webex installation guide
Jawaher Abdulwahab Fadhil
 
A survey on the applications of smart home
A survey on the applications of smart homeA survey on the applications of smart home
A survey on the applications of smart home
Jawaher Abdulwahab Fadhil
 
Flag register and add instruction
Flag register and  add instructionFlag register and  add instruction
Flag register and add instruction
Jawaher Abdulwahab Fadhil
 
Computer Organization -part 1
Computer Organization -part 1Computer Organization -part 1
Computer Organization -part 1
Jawaher Abdulwahab Fadhil
 
iOS Operating System
iOS Operating SystemiOS Operating System
iOS Operating System
Jawaher Abdulwahab Fadhil
 
Android Operating system
Android Operating systemAndroid Operating system
Android Operating system
Jawaher Abdulwahab Fadhil
 
Types of Mobile Applications
Types of Mobile ApplicationsTypes of Mobile Applications
Types of Mobile Applications
Jawaher Abdulwahab Fadhil
 
Ultrasonic with buzzer
Ultrasonic with buzzerUltrasonic with buzzer
Ultrasonic with buzzer
Jawaher Abdulwahab Fadhil
 
Lecture6 modulation
Lecture6 modulationLecture6 modulation
Lecture6 modulation
Jawaher Abdulwahab Fadhil
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
Jawaher Abdulwahab Fadhil
 
Lecture 4: Classification of system
Lecture 4: Classification of system Lecture 4: Classification of system
Lecture 4: Classification of system
Jawaher Abdulwahab Fadhil
 
Lecture3: Operations of Ct signals
Lecture3: Operations of Ct signalsLecture3: Operations of Ct signals
Lecture3: Operations of Ct signals
Jawaher Abdulwahab Fadhil
 
Lecture2 : Common continuous time signals
Lecture2 : Common continuous time signalsLecture2 : Common continuous time signals
Lecture2 : Common continuous time signals
Jawaher Abdulwahab Fadhil
 
Lecture1: Introduction to signals
Lecture1: Introduction to signalsLecture1: Introduction to signals
Lecture1: Introduction to signals
Jawaher Abdulwahab Fadhil
 
Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
Jawaher Abdulwahab Fadhil
 

More from Jawaher Abdulwahab Fadhil (20)

Binary adder
Binary adderBinary adder
Binary adder
 
Number system
Number systemNumber system
Number system
 
Add instruction-part1
Add instruction-part1Add instruction-part1
Add instruction-part1
 
Dealing with 8086 memory
Dealing with 8086 memoryDealing with 8086 memory
Dealing with 8086 memory
 
MOV instruction part1
MOV  instruction part1MOV  instruction part1
MOV instruction part1
 
Cisco webex installation guide
Cisco webex installation guideCisco webex installation guide
Cisco webex installation guide
 
A survey on the applications of smart home
A survey on the applications of smart homeA survey on the applications of smart home
A survey on the applications of smart home
 
Flag register and add instruction
Flag register and  add instructionFlag register and  add instruction
Flag register and add instruction
 
Computer Organization -part 1
Computer Organization -part 1Computer Organization -part 1
Computer Organization -part 1
 
iOS Operating System
iOS Operating SystemiOS Operating System
iOS Operating System
 
Android Operating system
Android Operating systemAndroid Operating system
Android Operating system
 
Types of Mobile Applications
Types of Mobile ApplicationsTypes of Mobile Applications
Types of Mobile Applications
 
Ultrasonic with buzzer
Ultrasonic with buzzerUltrasonic with buzzer
Ultrasonic with buzzer
 
Lecture6 modulation
Lecture6 modulationLecture6 modulation
Lecture6 modulation
 
Lecture 5: The Convolution Sum
Lecture 5: The Convolution SumLecture 5: The Convolution Sum
Lecture 5: The Convolution Sum
 
Lecture 4: Classification of system
Lecture 4: Classification of system Lecture 4: Classification of system
Lecture 4: Classification of system
 
Lecture3: Operations of Ct signals
Lecture3: Operations of Ct signalsLecture3: Operations of Ct signals
Lecture3: Operations of Ct signals
 
Lecture2 : Common continuous time signals
Lecture2 : Common continuous time signalsLecture2 : Common continuous time signals
Lecture2 : Common continuous time signals
 
Lecture1: Introduction to signals
Lecture1: Introduction to signalsLecture1: Introduction to signals
Lecture1: Introduction to signals
 
Arduino based Applications-part 6
Arduino based Applications-part 6Arduino based Applications-part 6
Arduino based Applications-part 6
 

Recently uploaded

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
Steve Thomason
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 

Recently uploaded (20)

Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 

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