Unit - 3 Iot
Unit - 3 Iot
Classification of Sensors
There are several types of sensors available to measure virtually everything in the physical world.
In the first classification of the sensors, they are divided in to Active and Passive. Active Sensors are those
which require an external excitation signal or a power signal to produce an energy output. Passive Sensors,
do not require any external power signal and directly generates output response.
Contact or non-contact: whether they require physical contact with what they are measuring (contact) or not
(no- contact)
Absolute or relative: whether they measure on an absolute scale or based on a difference with a fixed or
variable reference value (relative).
The final classification of the sensors are Analog and Digital Sensors. Analog Sensors produce an analog
output i.e., a continuous output signal (usually voltage but sometimes other quantities like Resistance etc.)
with respect to the quantity being measured.
Digital Sensors, in contrast to Analog Sensors, work with discrete or digital data. The data in digital sensors,
which is used for conversion and transmission, is digital in nature.
The following is a list of different types of sensors that are commonly used in various
applications. All these sensors are used for measuring one of the physical properties like
Temperature, Resistance, Capacitance, Conduction, Heat Transfer etc.
Position Sensor: A position sensor is a sensor that measures the position of an object.. A
position sensor may indicate absolute position (location) or relative position (displacement). Ex:
potentiometer
Occupancy & motion: occupancy sensor detect the presence of people & animals in a
surveillance area, while motion sensors detect movement of people & objects. Ex: electric eye
Thermal and magnetic actuators usually consist of shape memory alloys that can be heated to produce
movement. Ex: linear solenoid
3. I/O INTERFACE:
Digital GPIO can support Pulse Width Modulation (PWM). PWM lets you very quickly
switch a power source on and off, with each “on” phase being a pulse of a particular duration,
or width. The effect in the device can be a lower or higher power level. For example, you can
use PWM to change the brightness of an LED; the wider the “on” pulses, the brighter the
LED glows.
in HTTP there are five methods that are commonly used in a REST-based Architecture i.e.,
POST, GET, PUT, PATCH, and DELETE. These correspond to create, read, update, and delete
(or CRUD) operations respectively.
GET: The HTTP GET method is used to read (or retrieve) a representation of a resource.
POST: The POST verb is most often utilized to create new resources. In particular, it’s used to
create subordinate resources.
PUT: It is used for updating the capabilities.
DELETE: It is used to delete a resource identified by a URI. On successful deletion, return
HTTP status 200 (OK) along with a response body.
The IoT based devices are more susceptible to threats. So these security loopholes can be reduced by using
the correct protocols. Communication protocols in IoT are types of communication that ensure the finest
security toward the data being exchanged among the IoT connected devices.
The connection of these devices can be done through an IP network otherwise a non IP network but, there is
a disparity within their power, range & memory used. The connection throughout IP networks is difficult &
takes huge memory as well as power from these devices as the range is not a trouble.
Alternatively, Bluetooth which is known as non-IP networks needs low power and memory however they
have a limitation in the range.
The main benefits of IoT communication protocols are high quality, credibility, interoperability, innovation
flexibility & global scalability. IoT protocols are available in two types mainly IoT network protocols and IoT
data protocols.
The list of Top 10 IoT Communication Protocols includes the following.
WiFi
SigFox
Bluetooth
LoRaWAN
5. MQTT protocol
MQTT stands for Message Queuing Telemetry Transport. MQTT is a machine to machine internet of things
connectivity protocol. It is an extremely lightweight and publish-subscribe messaging transport protocol
running on the top of TCP/IP. This protocol is useful for the connection with the remote location where the
bandwidth is a premium. These characteristics make it useful in various situations, including constant
environment such as for communication machine to machine and internet of things contexts. It is a publish
and subscribe system where we can publish and receive the messages as a client. It makes it easy for
communication between multiple devices. It is a simple messaging protocol designed for the constrained
devices and with low bandwidth, so it's a perfect solution for the internet of things applications.
Characteristics of MQTT
The MQTT has some unique features which are hardly found in other protocols. Some of the features of an
MQTT are given below:
It does not require that both the client and the server establish a connection at the same time.
It provides faster data transmission, like how WhatsApp/messenger provides a faster delivery.
It's a real-time messaging protocol.
It allows the clients to subscribe to the narrow selection of topics so that they can receive the
information they are looking for.
The publishe-subscribe model of MQTT is based on the Client-Server model, but the server running MQTT is
more like a broker or gateway [2]. The MQTT client can publish a message on a topic or subscribe to a topic,
The label provided to the message is checked against the subscription known by the server is known as TOPIC.
Architecture of MQTT
CoAP provides three different types of responses. If the request is in a CON message and
the resource is immediately available, then a Piggybacked response will be used, which means
the response is carried by the ACK message. But when the server need a longer time to obtain
the representation of the resource, and in order to avoid the situation that client keep sending the
same request, the server may use the Separate response. The server can reply with the ACK as a
empty message to inform the client that the request is received.
When the response is available, response will be sent back to the client in a CON
message. Furthermore, if the request is in NON, response will be a Non-Confirmable response, a
NON message will carry the response back to the client. Caching for requests and responses may
be enabled by the CoAP endpoints. In some cases, the request/response pair can be reused by
using the prior request/response payload (supposing the client is checking the state of the same
resource and its state has not changed); this feature increases performance by reducing response
time and reducing network bandwidth consumption.
Think of Bluetooth as having two well-defined layers of functionality in the stack. These layers
range from the lower level hardware-based radio system, to an upper level software stack that
specifies the linkages between the layers (Figure 1).
Service Discovery Protocol (SDP)− SDP takes care of service-related queries like device
information so as to establish a connection between contending Bluetooth devices.
Zigbee is a low-cost and low-powered mesh network widely deployed for controlling and
monitoring applications where it covers 10-100 meters within the range. Zigbee devices can
transmit data over long distances by passing data through a mesh network of intermediate
devices to reach more distant ones. This communication system is less expensive and simpler
than the other proprietary short-range wireless sensor networks as Bluetooth and Wi-Fi.
ZigBee Architecture
The ZigBee Network Protocol follows IEEE 802.15.4 standards for Physical and MAC layers, along with its own
Network and Application layers.
Physical Layer: This is the lowest protocol layer, and is responsible for controlling and
activating the radio transceiver, and also for selecting the channel frequency and monitoring
the channel. It is also responsible for communication with the radio devices. Communication
of data or commands is done using Packets. Each PHY Packet consists of a Synchronization
Bluetooth 1.2
Major enhancements include:
Faster Connection and Discovery
Extended Synchronous Connections (eSCO), which improve voice quality of audio links by
allowing retransmissions of corrupted packets, and may optionally increase audio latency to
provide better concurrent data transfer.
The specification is published as Bluetooth v2.0 + EDR, which implies that EDR is an optional feature. Aside
from EDR, the v2.0 specification contains other minor improvements, and products may claim compliance to
"Bluetooth v2.0" without supporting the higher data rate. At least one commercial device states "Bluetooth
v2.0 without EDR" on its data sheet.
Bluetooth Core Specification Version 2.1 + EDR was adopted by the Bluetooth SIG on 26 July 2007.
The headline feature of v2.1 is secure simple pairing (SSP): this improves the pairing experience for Bluetooth
devices, while increasing the use and strength of security.
Version 2.1 allows various other improvements, including extended inquiry response (EIR), which provides
more information during the inquiry procedure to allow better filtering of devices before connection; and
sniff subrating, which reduces the power consumption in low-power mode.
Bluetooth 3.0 + HS
Version 3.0 + HS of the Bluetooth Core Specification[77] was adopted by the Bluetooth SIG on 21 April 2009.
Bluetooth v3.0 + HS provides theoretical data transfer speeds of up to 24 Mbit/s, though not over the
Bluetooth link itself. Instead, the Bluetooth link is used for negotiation and establishment, and the high data
rate traffic is carried over a colocated 802.11 link.
The main new feature is AMP (Alternative MAC/PHY), the addition of 802.11 as a high-speed transport. The
high-speed part of the specification is not mandatory, and hence only devices that display the "+HS" logo
actually support Bluetooth over 802.11 high-speed data transfer. A Bluetooth v3.0 device without the "+HS"
suffix is only required to support features introduced in Core Specification Version 3.0[80] or earlier Core
Specification Addendum 1
Bluetooth 4.0
The Bluetooth SIG completed the Bluetooth Core Specification version 4.0 (called Bluetooth
Smart) and has been adopted as of 30 June 2010. It includes Classic Bluetooth, Bluetooth high
As an alternative to the Bluetooth standard protocols that were introduced in Bluetooth v1.0 to
v3.0, it is aimed at very low power applications powered by a coin cell. Chip designs allow for
two types of implementation, dual-mode, single-mode and enhanced past versions.
Bluetooth 4.1
The Bluetooth SIG announced formal adoption of the Bluetooth v4.1 specification on 4
December 2013. This specification is an incremental software update to Bluetooth Specification
v4.0, and not a hardware update.
L2CAP Connection Oriented and Dedicated Channels with Credit-Based Flow Control
802.11n PAL
Bluetooth 4.2
Internet Protocol Support Profile (IPSP) version 6 ready for Bluetooth Smart things to
support connected home
Bluetooth 5
The Bluetooth SIG released Bluetooth 5 on 6 December 2016. Its new features are mainly focused on
new Internet of Things technology.
Bluetooth 5 provides, for BLE, options that can double the speed (2 Mbit/s burst) at the expense
of range, or provide up to four times the range at the expense of data rate. The increase in
transmissions could be important for Internet of Things devices, where many nodes connect
throughout a whole house. Bluetooth 5 increases capacity of connectionless services such as
location-relevant navigation of low-energy Bluetooth connections
LE Long Range
LE Advertising Extensions
The TCP layer in the user’s system waits for the transmission to get finished and acknowledges once all
packets have been received.
TCP is reliable protocol. That is, the receiver always sends either positive or negative
acknowledgement about the data packet to the sender, so that the sender always has
bright clue about whether the data packet is reached the destination or it needs to resend
it.
TCP ensures that the data reaches intended destination in the same order it was sent.
TCP is connection oriented. TCP requires that connection between two remote points be
established before sending actual data.
TCP provides full duplex server, i.e. it can perform roles of both receiver and sender.
Header
The length of TCP header is minimum 20 bytes long and maximum 60 bytes.
It is a 16-bit field that indicates the port number of the source sending the data.
Destination port
It is a 16-bit field. The destination port is the numerical value indicating the destination port..
Sequence number
It is a 32-bit field that is used to put the data back in the correct order and also used to re-transmit
missing or damaged data segments.
Acknowledgment number
It is a 32-bit field that is used by the receiving host to acknowledge the successful delivery of
segments based on which the next stream of data segments is sent by the source. When the ACK
bit is set, this field contains the next sequence number that the sender of the segment is expecting
to receive. This value is always sent.
Header Length(HLEN)
It is a 4-bit field . This field indicates the length of the TCP header so that we know where the
actual data begins.
Reserved
It is a 16-bit field that is used to negotiate the window size b/w sending and receiving hosts. This
file specifies the number of bytes the receiver is willing to receive. It is used so the receiver can
tell the sender that it would like to receive more data than what it is currently receiving. Window
size is negotiated based on sender and receiver buffers and is negotiated to the lowest value.
Checksum
It is a 16 bits field that is used for integrity checks TCP segment. It is like CRC because TCP
doesn’t trust the lower layers and checks everything. The Cyclic Redundancy Check (CRC)
checks the header and data fields.
Urgent Pointer
There are 6 bits in this filed with each have a specific purpose. These Bits are used to establish a
connection between source and destination hosts before sending the data. Some of the fields are
used while sending data and while the connection is terminated with the destination host. Each
bit of the code bits is 1 bit long. Below are the details:
URG Bit
URG bit indicates that the Urgent pointer field is significant. When this bit is set, the data should
be treated as a priority over other data.
ACK Bit
ACK bit used for the acknowledgment of successful delivery of the previous segment.
PSH Bit
PSH Bit is used for Push function. Updates the receiving host to push the buffered data to the
receiving application.
RST Bit
RST bit is used to reset the connection, when the TCP host receives the segment with RST bit set
the connection is reset immediately. This bit is used when there are unrecoverable errors and it’s
not a normal way to finish the TCP connection.
SYN Bit
FIN bit is used to finish end the TCP connection in a normal way by both sending and receiving
hosts. This bit also specifies end of data.
Disadvantages
Application
Host
Controller
This layer sits above the Physical layer. It is responsible for advertising, scanning, and creating/maintaining
connections. The Link Layer is the part that directly interfaces with the physical layer and it is usually
implemented as a combination of custom hardware and software and it defines the main role of the device. it
defines the packet structure and control.
Host Controller Interface (HCI): HCI : It provides communication between controller and host through
standard interface types. This HCI layer can be implemented either using API or by interfaces such as
UART/SPI/USB.
Security Manager (SMP): This security Manager layer provides methods for device pairing and key
distributions. It offers services to other protocol stack layers in order to securely connect and exchange data
Generic Access Profile (GAP): This layer directly interfaces with application layer and/or profiles on it. It
handles device discovery and connection related services for BLE device. It also takes care of initiation of
security features. and to allow data exchange to take place between devices from different vendors.
GATT : This layer is service framework which specifies sub-procedures to use ATT. Data communications
between two BLE devices are handled through these sub-procedures.This defines how data or attributes are
formatted, packaged, and sent across connected devices according to its described rules. Similar to GAP,
there are certain roles that interacting devices can adopt:
Client: This typically sends a request to the GATT server. The client can read and/or write
attributes/data found on the server.
Server: One of the main roles of the server is to store attributes/data. Once the client makes a
request, the server must make the attributes/data available.
The Application, is the highest layer and the one responsible for containing the
application logic, user interface, and data handling of everything related to the actual use-case
that the application implements i.e user application sits here, interacts directly with the Bluetooth
stack.