You are on page 1of 23

Fundamentals of Computing

Basics of Data Communications and its applications using C language

Prepared by:

Eng. Atheer AlShaggah


School of Computing and Informatics– Al Hussein Technical University
Outlines
Introduction to Data Communication

Data Communication Terminology

Communication Medium (Channel)

Data Communication Protocols

Serial Communication

Role of C programming in Data Communication

Page 2
Data Communications

• Data Communication is to transfer data from one


device to another where the sender and the receiver
interpret the data correctly.

• Communication devices affect the ways in which


people are able to work, socialize, stay in touch with
one another and conduct important research, among
other activities and applications.
Data Communication System

Sender Receiver

Communication Channel

➢ Sender and receiver can be any device: Computer, Phone, sensor and
so on…..
Data Communication Terminology

• Communication channel is the communication medium allocated to the


sender and receiver for conveying information between them, can be
physical medium like copper wires and fiber optic cables or can be logical
Channel through wireless channel.

• Bandwidth: is a measure of the amount of data that the medium can transfer
over a given period of time. Each communication medium has a different
bandwidth.
• For digital it is measured bit per second (bps) in analogue measured in cycle
Bandwidth per second hertz (Hz).
Wired & Wireless Communication Channels

Wired

Wireless
Wired Channel
• Wired communication refers to the transmission of data over a wire-based
communication technology.
• Wired channels offers better performance compared to wireless channels, for
example the wired network can offer a bandwidth of 100 Mbps with Fast Ethernet
technology and with ranges of 10Gbps to 100 Gbps in fiber optic cables.
• Ethernet and fiber optic cables that are used in wired channels are reliable with a
high security considerations.
Wireless Channel

• The term wireless refers to the communication of information over a distance,


without requiring wires, cables or electrical conductors. It will be through air over
radio frequencies, infrared, satellite etc.
• Wireless channels offers less performance compared to wired channels, for
example the maximum bandwidth provided by the Wi-Fi network is approximately
11Mpbs and for Bluetooth is 800Kbps.
• The reliability of the wireless network is lower compared to the wired network.
Factors that affect the performance of Communication
• Data communication performance is about
response time - how fast a message can be sent
or how quickly a document can be retrieved
correctly. Which can be affected by :
1. The number of devices connected to the
communication network.
2. The bandwidth of the transmission medium.
3. The type of the traffic (video or text).
4. The latency.
5. The number of transmission errors.
Data Transfer Modes
Transfer Modes

Simplex Half Duplex Full Duplex

Only one device can Both devices can send both devices can send
send data and other and receive data, but and receive data at
can receive. not at the same time. the same time.
Ex. Tv remote, mouse.. Ex. Walkie talkie Ex. Two computers
Data Communication Protocols

A protocol is a set of rules that govern data communications. A protocol defines


what is communicated, how it is communicated, and when it is communicated.

Set of Rules Set of Rules


Sender Receiver

Communication Channel
Data Communication Protocols
Hundreds of communication protocols have been defined to achieve this data exchange,
and, in general, each can be separated into one of two categories: Parallel or Serial.

Data
Communication

Serial Parallel
Communication Communication
Serial & Parallel Communications
Serial Communication
▪ Serial communication is one of the primary means of data
transmission in many industrial and automated systems.
• Many commercial and industrial applications of networked
electronic devices contain a single serial interface. Monitoring,
sensing, and control devices all may make use of serial ports to
communicate with each other and their master controlling
computers.
• The Serial Direct Connection is the one which utilizes the COM
ports of your computers. Every desktop computer has at least
one COM port (COM1). The "COM" stands for
"Communications".
Serial Connection Protocols
There are several protocols available in serial communication, the most common used are:

UART (Universal Asynchronous


Receiver Transmitter)

Ethernet

USB (Universal Serial Bus)


UART (Universal Asynchronous Receiver Transmitter)

• It is a communication protocol used in serial


communication commonly in (COM) ports of the
computers, use interfaces like DB- 25 (RS232) or DB-
9.
• The RS-232 standard specifies maximum distance of
15 meters (50 feet). However this is a conservative
for 9600 common console speed.
Ethernet
• Ethernet internet protocol uses the Ethernet infrastructure to manage the
connection between various automation devices such as robots, PLCs, sensors,
CNCs and other industrial machines.

• RJ45 (Registered Jack 45) connector is used almost universally as the physical
connector used on Ethernet cables, and with networking cables in general. Its
maximum operating length from 100 meters to 2000 meters depend on the
cable type and specifications.
USB (Universal Serial Bus)

• USB used commonly with computers.


• USB operating specifications limit the
maximum length of the cable to 5
meters for full speed devices and 3
meters for any low speed devices.
How C language help devices to communicate?

• To send data or receive data through any communication port, it is generally


done in three steps: open the required port, read or write data, and close the
port. We can do these steps using C language easily.
• C language functionality is very wide where we can send data through serial
connection (USB, DB9) to light a LED or even we can control a robot!
How this will happen??
Very Simple! 1) Implement your C code

2) Connect the Arduino to


the laptop using USB cable

3) Run your code ! The LED is “ON”


or “Off” according to your input.
YOU CAN DO THE SAME FOR Robots !
Any Question?

You might also like