JNTUA Introduction To Internet of Things Notes - R20
JNTUA Introduction To Internet of Things Notes - R20
me/jntua
LECTURE NOTES
LECTURE NOTES
B.TECH
Prepared by:
COURSE MATERIAL
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY ANANTAPUR
B.Tech (ECE)– IV-I Sem LTPC
3003
(20A04701b) INTRODUCTION TO INTERNET OF THINGS
(Professional Elective Course –III)
Course Objectives:
Students will understand the concepts of Internet of Things and can able to build IoT applications.
Course Outcomes:
Understand the concepts of Internet of Things
Identify hardware and software components of Internet of Things
Analyze basic communication protocols
Design IoT applications in different domain and be able to analyze their performance
UNIT 1
Introduction to IoT: Architectural overview, Design principles and needed capabilities, IoT
Applications, Sensing, Actuation, Basics of Networking, M2M and IoT Technology Fundamentals-
Devices and gateways, Data management, Business processes in IoT, Role of cloud in IoT
UNIT II
Elements of IoT:Hardware components – computing (Arduino, Raspberry Pi), communication, Sensing,
Actuation, I/O interfaces Software Components- Programming APIs (Using python/Arduino) for
communication protocols-MQTT, Zigbee, Bluetooth, CoAP, UDP, TCP
UNIT III
Sensing and Actuation: Definition of Sensor, Sensor features, Resolution, Classes, Different types of
sensors, Actuator, Different types of Actuators, purpose of Sensors and Actuators in IoT
UNIT IV
IoT Application Development: Solution frame work for IoT Applications-Implementation of Device
integration, Data acquisition and Integration, Device data storage on cloud/local server, Authentication,
authorization of Devices
UNIT V
IoT Case Studies: IoT Case studies and mini projects based on industrial Automation, Transportation,
Agriculture, Healthcare, Home Automation.
Textbooks:
1. Vijay Madisetti, ArshdeepBahga, “Internet of Things a Hands-On- Approach”,2014.
References:
1. Dr SRN Reddy, RachitThukral and Manasi Mishra ,” Introduction to Internet of Things”: A practical
Approach” ETI Labs
2. Raj Kamal , “ Internet of Things: Architecture and Design”, McGraw Hill
3. Adrian McEwen, “Designing the Internet of Things”, Wiley Publishers, 2013
UNIT 1
Introduction to IoT
What Is IoT:
IoT stands for Internet of Things. It refers to the interconnectedness of
physical devices, such as appliances and vehicles, that are embedded with
software, sensors, and connectivity which enables these objects to connect
and exchange data.
Main components used in IoT:
• Low-power embedded systems: Less battery consumption, high
performance are the inverse factors that play a significant role during
the design of electronic systems.
• Sensors: Sensors are the major part of any IoT application. It is a
physical device that measures and detects certain physical quantities
and converts it into signal which can be provided as an input to
processing or control unit for analysis purpose.
Different types of Sensors:
1. Temperature Sensors
2. Image Sensors
3. Gyro Sensors
4. Obstacle Sensors
5. RF Sensor
6. IR Sensor
7. MQ-02/05 Gas Sensor
8. LDR Sensor
9. Ultrasonic Distance Sensor
• Control Units: It is a unit of small computer on a single integrated
circuit containing microprocessor or processing core, memory and
programmable input/output devices/peripherals. It is responsible for
major processing work of IoT devices and all logical operations are
carried out here.
• Cloud computing: Data collected through IoT devices is massive, and
this data has to be stored on a reliable storage server. This is where
cloud computing comes into play. The data is processed and learned,
giving more room for us to discover where things like electrical
faults/errors are within the system.
Modern Applications:
1. Smart Grids and energy saving
2. Smart cities
3. Smart homes/Home automation
4. Healthcare
5. Earthquake detection
6. Radiation detection/hazardous gas detection
7. Smartphone detection
8. Water flow monitoring
9. Traffic monitoring
10. Wearables
11. Smart door lock protection system
12. Robots and Drones
13. Healthcare and Hospitals, Telemedicine applications
14. Security
15. Biochip Transponders (For animals in farms)
Internet of Things (IoT) technology has a wide variety of applications and use
of Internet of Things is growing so faster. Depending upon different
application areas of Internet of Things, it works accordingly as per it has been
designed/developed. But it has not a standard defined architecture of working
which is strictly followed universally.
So. here in this we will discuss basic fundamental architecture of IoT i.e., 4
Stage IoT architecture.
Sensing Layer
The sensing layer is the first layer of the IoT architecture and is responsible for
collecting data from different sources. This layer includes sensors and
actuators that are placed in the environment to gather information about
temperature, humidity, light, sound, and other physical parameters.
Network Layer
The network layer of an IoT architecture is responsible for providing
communication and connectivity between devices in the IoT system
Data processing Layer
The data processing layer of IoT architecture refers to the software and
hardware components that are responsible for collecting, analyzing, and
interpreting data from IoT devices.
Application Layer
The application layer of IoT architecture is the topmost layer that interacts
directly with the end-user.
Needed capabilities
IoT applications bring a lot of value in our lives. The Internet of Things provides
objects, computing devices, or unique identifiers and people's ability to transfer data across a
network without the human-to-human or human-to-computer interaction.
Example 1
This gateway receives data from such cameras and transmits information to the
city's traffic monitoring system.
Example 2
The municipal corporation has decided to repair a road that is connected to the national
highway. It may cause traffic congestion to the national highway. The insight is sent to
the traffic monitoring system.
The intelligent system analyzes the situation, estimate their impact, and relay
information to other cities connected to the same highway. It generates live instructions
to drivers by smart devices and radio channels.
Applications of IoT
1. Wearables
2. Smart Home Applications
3. Health care
4. Smart Cities
5. Agriculture
6. Industrial Automation
7. Hacked Car
8. Smart Retail
9. Smart Supply Chain
10. Smart Farming
The sensor attains a physical parameter and converts it into a signal suitable
for processing (e.g. electrical, mechanical, optical) the characteristics of any
device or material to detect the presence of a particular physical quantity.
The output of the sensor is a signal which is converted to a human-readable
form like changes in characteristics, changes in resistance, capacitance,
impedance, etc.
IOT HARDWARE
Transducer :
• A transducer converts a signal from one physical structure to another.
• It converts one type of energy into another type.
• It might be used as actuator in various systems.
Sensor Classification :
• Passive & Active
• Analog & digital
• Scalar & vector
1. Passive Sensor –
Can not independently sense the input. Ex- Accelerometer (The
accelerometer works on the movement or the vibration of the body.),
soil moisture (The Soil Moisture Sensor uses capacitance to measure
dielectric permittivity of the surrounding medium.), water level (when
the sensor is put into a certain depth in the liquid to be calculated, the
pressure on the sensor's front surface is converted into the water
level height) and temperature sensors (the voltage across the
terminals of the diode).
2. Active Sensor –
Independently sense the input. Example- Radar, sounder and laser
altimeter sensors.
3. Analog Sensor –
The response or output of the sensor is some continuous function of
its input parameter. Ex- Temperature sensor, LDR, analog pressure
sensor and analog hall effect.
4. Digital sensor –
Response in binary nature. Design to overcome the disadvantages of
analog sensors. Along with the analog sensor, it also comprises extra
electronics for bit conversion. Example – Passive infrared (PIR) sensor
and digital temperature sensor(DS1620).
5. Scalar sensor –
Detects the input parameter only based on its magnitude. The answer
for the sensor is a function of magnitude of some input parameter.
Not affected by the direction of input parameters.
Example – temperature, gas, strain, color and smoke sensor.
6. Vector sensor –
The response of the sensor depends on the magnitude of the
direction and orientation of input parameter. Example –
Accelerometer, gyroscope, magnetic field and motion detector
sensors.
Types of sensors –
• Electrical sensor
• Light sensor
• Touch sensor
• Range sensing
• Mechanical sensor
• Pneumatic sensor
• Optical sensor
• Speed Sensor
• Temperature Sensor
• PIR Sensor
• Ultrasonic Sensor
The control system acts upon an environment through the actuator. It requires
a source of energy and a control signal. When it receives a control signal, it
converts the source of energy to a mechanical operation. On this basis, on
which form of energy it uses, it has different types given below.
Types of Actuators :
1. Hydraulic Actuators –
A hydraulic actuator uses hydraulic power to perform a mechanical operation.
They are actuated by a cylinder or fluid motor. The mechanical motion is
converted to rotary, linear, or oscillatory motion, according to the need of the
IoT device. Ex- construction equipment uses hydraulic actuators because
hydraulic actuators can generate a large amount of force.
Advantages :
• Hydraulic actuators can produce a large magnitude of force and high
speed.
• Thermal/Magnetic Actuators –
These are actuated by thermal or mechanical energy. Shape Memory
Alloys (SMAs) or Magnetic Shape‐Memory Alloys (MSMAs) are used
by these actuators. An example of a thermal/magnetic actuator can
be a piezo motor using SMA.
• Mechanical Actuators –
A mechanical actuator executes movement by converting rotary
motion into linear motion. It involves pulleys, chains, gears, rails, and
other devices to operate. Example – A crankshaft.
• Soft Actuators
• Shape Memory Polymers
• Light Activated Polymers
• With the expanding world of IoT, sensors and actuators will find
more usage in commercial and domestic applications along with the
pre-existing use in industry.
IoT Components
Example
IoT Gateways
Complexity of Networks
• Growth of networks
• Interference among devices
• Network management
• Heterogeneity in networks
• Protocol standardization within networks
Wireless Networks
Scalability
Abbreviation IoT stands for the Internet of Things. M2M stands for Machine-to-
Machine communication.
processes. observed.
Communication IoT has used internet protocols like Communication technology and
Protocol Used FTP, Telnet, and HTTP. Traditional protocols are uses in
M2M technology.
Connection Type The connection of IoT is through the M2M uses a point to point
Used network and using various types of connection.
communication.
Scope It has a wide range of devices, yet the It has a limited Scope for
scope is large. devices.
Business Type It has Business to Consumer (B2C) It has Business to Business (B2B)
Used and Business to Business (B2B). communication.
Data Sharing In IoT, data sharing depends on the In M2M, devices may be
Internet protocol network. connected through mobile or
any other network.
Open API Support IoT technology supports Open API In M2M technology, there is no
integrations. Open API support.
Example Big Data, Cloud, Smart wearables, and Data and Information, sensors,
many more. and many more.
▪ Basic devices;
▪ Advanced devices.
Basic devices, microcontroller-class devices are those which can perform simple operations and
usually cannot communicate with each other without gateways.
Advanced devices or general purpose-class devices are performing application level logic and
support communication protocols.
Basic and advanced IoT devices are different in terms of scenarios and processes. Basic IoT
devices are good for performing simple processes like alarms, metering, standalone smart
thermostats and others.
Advanced IoT devices are designed for more complex processes, representing automated units,
and processing multiple different actions at the same time.
Basic IoT devises usually serve a single operation – measure temperature, wind force or others.
The hardware requirements are relatively low for this type of devices. The components used for
this type of devices are inexpensive, usually using an SoC inside, containing at least two
microprocessors, and several wireless connectivity stacks.
The type of communication maybe different as there is a few of them available in the market.
In terms of energy performance, these devices should perform a minimum consumption.
Microcontrollers are equipped with several GPIO ports for interaction with external devices,
supporting I2C, and ADCs, SPI protocols as a minimum. STMicroelectronics MCU structure is
depicted in Figure 1 below.
• Security: Gateways can act as a secure access point for IoT devices,
providing a layer of protection against cyber threats.
• Scalability: Gateways can support a large number of IoT devices and
can be easily scaled up or down to meet changing needs.
• Improved reliability: Gateways can help to improve the reliability of
IoT devices by managing network connectivity and providing a backup
mechanism in case of network failure.
• Cost-effective: Gateways can be a cost-effective way to manage and
control a large number of IoT devices, reducing the need for
expensive infrastructure and IT resources.
Billions of sensors interact with people, homes, cities, farms, factories, workplaces, vehicles,
wearables and medical devices, and beyond. The Internet of Things (IoT) is changing our lives
from managing home appliances to vehicles. Devices can now advise us about what to do, when
to do and where to go. Industrial applications of the IoT assist us in managing processes, and
predicting faults and disasters. The IoT platforms help set and maintain parameters to refine
and store data accordingly.
Data management is the process of taking the overall available data and refining it down to
important information. Different devices from different applications send large volumes and
varieties of information. Managing all this IoT data means developing and executing
architectures, policies, practices and procedures that can meet the full data lifecycle needs.
Things are controlled by smart devices to automate tasks, so we can save our time. Intelligent
things can collect, transmit and understand information, but a tool will be required to aggregate
data and draw out inferences, trends and patterns.
In edge computing, data is processed near the data source or at the edge of the network. While
in a typical cloud environment, data processing happens in a centralised data storage location.
By processing and using some data locally, the IoT saves storage space for data, processes
information faster and meets security challenges.
Edge computing, data governance policies and metadata management help firms deal with
issues of scalability and agility, security and usability. This further assist them decide whether to
manage data on the edge or only after sending it to the cloud.
Sensors produce a large amount of data for edge gateway devices so that these can make
decisions by analysing the data. These high-performance systems not only need to collect data
in real time but also to organise and provide data to other systems.
This is critical across industrial, consumer and commercial applications such as an industrial and
connected home. It enables customers to manage large and diverse device fleets such as
operational technology systems, cameras, machines, vehicles, appliances and more.
It enables monitoring of usage and performance metrics for devices across industrial sectors
such as manufacturing, oil and gas, and mining. It allows monitoring metadata and policy
changes with service alerts to inform about any adjustments to the devices’ configuration. It
also allows detection of any unusual behaviour across a device and to take mitigating actions.
It is easy to find devices based on a combination of attributes like device ID, device state and
type, so that action can be taken, in addition to troubleshooting. Actions such as reboots,
factory resets and security patches can also be remotely executed.
There are several ways through IoT is transforming the business. Some of them are
mentioned below:
As the large volume of data flow from data centers, production systems, sensors and IoT
systems to the business enterprise at real or non-real-time helps the enterprise to offer
opportunities for innovation and growth.
Greater Efficiency
Business enterprise is also looking towards more flexibility and efficiency. The higher
efficiency will be achieved through IoT as it expands over various technologies and parts
of the organization. The capabilities of product or services are realized as data streaming
from sensors is analyzed, and changes are deployed without human intervention.
• Speed and scale are two essential aspects of cloud computing, and they
work in unmatched harmony with IoT networking and mobility.
• So, user can benefit more by combine use of cloud computing and IoT.
Some factors show that the cloud is necessary for the success of IoT, and here
are some of them.
IoT involves significant data generation. And when you work with data, the data
security and data privacy become issue. IoT also makes use of mobility. Cloud
uses advance encryption algorithms and authentication. Which enable cloud to
provide its user high security.
For IoT devices, plug-and-play hosting services are necessary. This will become
quite expensive due to plug-and-play hosting services. This will cost more to
organizations. This type of hosting services needs hardware system. Due to the
combined power of cloud computing and IoT, you do not need to depend on
substantial machinery. As cloud computing infrastructure make it ready to use
without having hardware storage device set-up offline. This makes it easy for
IoT hosting organizations.
We can use cloud technology for the communication using the IoT. Smart device
can easily connect with each other using IoT APIs. It also makes internal
communication between devices fast and easy.
IoT innovations with low entry barriers require hassle-free hosting options. As a
result, cloud computing in IoT is a suitable solution. IoT players can use the
power of distant data centers due to cloud computing without requiring on-
premises gear and software. IoT cloud computing is the best option financially
because users need to adhere to the pay-as-you-go concept. It also saves a
tonne of money upfront.
This helps businesses can launch massive IoT projects with ease. This removes
many obstacles to entry for the majority of IoT-based organizations.
By using cloud computing in proper way, IoT devices can communicate with
each other seamlessly. As a result, connected devices and smart devices can
communicate with various reliable APIs. In this way, networked technologies
are made possible by cloud computing.
Unit-2 Elements of Io T
Arduino board
There are many varieties of Arduino boards (explained on the next page) that can be used
for different purposes. Some boards look a bit different from the one below, but most
Arduinos have the majority of these components in common:
• Power (USB / Barrel Jack): Every Arduino board needs a way to be connected to a
power source. The Arduino UNO can be powered from a USB cable coming from your
computer or a wall power supply (like this) that is terminated in a barrel jack. In the
picture above the USB connection is labeled (1) and the barrel jack is labeled (2).
• Pins (5V, 3.3V, GND, Analog, Digital, PWM, AREF): The pins on your Arduino are
the places where you connect wires to construct a circuit (probably in conjuction with
a breadboard and some wire. They usually have black plastic ‘headers’ that allow you
to just plug a wire right into the board. The Arduino has several different kinds of pins,
each of which is labeled on the board and used for different functions.
✓ GND (3): Short for ‘Ground’. There are several GND pins on the Arduino, any of
which can be used to ground your circuit.
✓ 5V (4) & 3.3V (5): As you might guess, the 5V pin supplies 5 volts of power, and
the 3.3V pin supplies 3.3 volts of power. Most of the simple components used with
the Arduino run happily off of 5 or 3.3 volts.
✓ Analog (6): The area of pins under the ‘Analog In’ label (A0 through A5 on the
UNO) is Analog In pins. These pins can read the signal from an analog sensor (like
a temperature sensor) and convert it into a digital value that we can read.
✓ Digital (7): Across from the analog pins are the digital pins (0 through 13 on the
UNO). These pins can be used for both digital input (like telling if a button is
pushed) and digital output (like powering an LED).
✓ PWM (8): You may have noticed the tilde (~) next to some of the digital pins (3, 5,
6, 9, 10, and 11 on the UNO). These pins act as normal digital pins, but can also be
used for something called Pulse-Width Modulation (PWM). We have a tutorial on
PWM, but for now, think of these pins as being able to simulate analog output (like
fading an LED in and out).
✓ AREF (9): Stands for Analog Reference. Most of the time you can leave this pin
alone. It is sometimes used to set an external reference voltage (between 0 and 5
Volts) as the upper limit for the analog input pins.
• Reset Button: Just like the original Nintendo, the Arduino has a reset button (10).
Pushing it will temporarily connect the reset pin to ground and restart any code that is
loaded on the Arduino. This can be very useful if your code doesn’t repeat, but you
want to test it multiple times. Unlike the original Nintendo however, blowing on the
Arduino doesn't usually fix any problems.
• Power LED Indicator: Just beneath and to the right of the word “UNO” on your circuit
board, there’s a tiny LED next to the word ‘ON’ (11). This LED should light up
whenever you plug your Arduino into a power source. If this light doesn’t turn on,
there’s a good chance something is wrong.
• TX RX LEDs: TX is short for transmit, RX is short for receive. These markings appear
quite a bit in electronics to indicate the pins responsible for serial communication. In
our case, there are two places on the Arduino UNO where TX and RX appear -- once
by digital pins 0 and 1, and a second time next to the TX and RX indicator LEDs (12).
These LEDs will give us some nice visual indications whenever our Arduino is
receiving or transmitting data (like when we’re loading a new program onto the board).
• Main IC: The black thing with all the metal legs is an IC, or Integrated Circuit (13).
Think of it as the brains of our Arduino. The main IC on the Arduino is slightly
different from board type to board type, but is usually from the ATmega line of IC’s
from the ATMEL company. This can be important, as you may need to know the IC
type (along with your board type) before loading up a new program from the Arduino
software. This information can usually be found in writing on the top side of the IC. If
you want to know more about the difference between various IC's, reading the
datasheets is often a good idea.
• Voltage Regulator: The voltage regulator (14) is not actually something you can (or
should) interact with on the Arduino. But it is potentially useful to know that it is there
and what it’s for. The voltage regulator does exactly what it says -- it controls the
amount of voltage that is let into the Arduino board. Think of it as a kind of gatekeeper;
it will turn away an extra voltage that might harm the circuit. Of course, it has its limits,
so don’t hook up your Arduino to anything greater than 20 volts.
• Raspberry pi
The Raspberry pi is a single computer board with credit card size, that can be used for
many tasks that your computer does, like games, word processing, spreadsheets and also
to play HD video. It was established by the Raspberry pi foundation from the UK. It has
been ready for public consumption since 2012 with the idea of making a low-cost
educational microcomputer for students and children. The main purpose of designing the
raspberry pi board is, to encourage learning, experimentation and innovation for school
level students. The raspberry pi board is a portable and low cost. Maximum of the
raspberry pi computers is used in mobile phones. In the 20th century, the growth of mobile
computing technologies is very high, a huge segment of this being driven by the mobile
industries. The 98% of the mobile phones were using ARM technology.
The raspberry pi board comprises a program memory (RAM), processor and graphics
chip, CPU, GPU, Ethernet port, GPIO pins, Xbee socket, UART, power source connector
and various interfaces for other external devices. It also requires mass storage, for that we
use an SD flash memory card. So that raspberry pi board will boot from this SD card
similarly as a PC boots up into windows from its hard disk
• Memory: The raspberry pi model Aboard is designed with 256MB of SDRAM and
model B is designed with 51MB.Raspberry pi is a small size PC compare with other
PCs. The normal PCs RAM memory is available in gigabytes. But in raspberry pi
board, the RAM memory is available more than 256MB or 512MB
• CPU (Central Processing Unit): The Central processing unit is the brain of the
raspberry pi board and that is responsible for carrying out the instructions of the
computer through logical and mathematical operations. The raspberry pi uses ARM11
series processor, which has joined the ranks of the Samsung galaxy phone.
• GPU (Graphics Processing Unit): The GPU is a specialized chip in the raspberry pi
board and that is designed to speed up the operation of image calculations. This board
designed with a Broadcom video core IV and it supports OpenGL
• Ethernet Port: The Ethernet port of the raspberry pi is the main gateway for
communicating with additional devices. The raspberry pi Ethernet port is used to plug
your home router to access the internet.
• GPIO Pins: The general purpose input & output pins are used in the raspberry pi to
associate with the other electronic boards. These pins can accept input & output
commands based on programming raspberry pi. The raspberry pi affords digital GPIO
pins. These pins are used to connect other electronic components. For example, you can
connect it to the temperature sensor to transmit digital data.
• XBee Socket: The XBee socket is used in raspberry pi board for the wireless
communication purpose.
• Power Source Connector: The power source cable is a small switch, which is placed
on side of the shield. The main purpose of the power source connector is to enable an
external power source.
• UART: The Universal Asynchronous Receiver/ Transmitter is a serial input & output
port. That can be used to transfer the serial data in the form of text and it is useful for
converting the debugging code.
• Display: The connection options of the raspberry pi board are two types such as HDMI
and Composite. Many LCD and HD TV monitors can be attached using an HDMI male
cable and with a low-cost adaptor. The versions of HDMI are 1.3 and 1.4 are supported
and 1.4 version cable is recommended. The O/Ps of the Raspberry Pi audio and video
through HMDI, but does not support HDMI I/p. Older TVs can be connected using
composite video. When using a composite video connection, audio is available from the
3.5mm jack socket and can be sent to your TV. To send audio to your TV, you need a
cable which adjusts from 3.5mm to double RCA connectors.
2. Communication in IoT
IoT is connection of devices over internet, where these smart devices communicate with
each other, exchange data , perform some tasks without any human involvement. These
devices are embedded with electronics, software, network and sensors which help in
communication. Communication between smart devices is very important in IOT as it
enables these devices to gather, exchange data which contribute in success of that IOT
product/project.
H2M communication
Merits: This H2M has a user-friendly interface that can be quickly accessed by
following the instructions. It responds more quickly to any fault or failure. Its features
and functions can be customized.
Examples:
• Facial recognition.
• Bio-metric Attendance system.
• Speech or voice recognition.
M2M communication
Merits: This M2M can operate over cellular networks and is simple to manage. It can be
used both indoors and outdoors and aids in the communication of smart objects without
the need for human interaction. The M2M contact facility is used to address security and
privacy problems in IoT networks. Large-scale data collection, processing, and security
are all feasible.
Demerits: However, in M2M, use of cloud computing restricts versatility and creativity.
Data security and ownership are major concerns here. The challenge of
achieving interoperability between cloud/M2M IoT systems is daunting. M2M
connectivity necessitates the existence of a reliable internet connection.
Examples:
• Smart Washing machine sends alerts to the owners’ smart devices after completion
of washing or drying of clothes.
• Smart meters tracks amount of energy used in household or in companies and
automatically alert the owner.
M2H communication
Examples:
• Fire Alarms
• Traffic Light
• Fitness bands
• Health monitoring devices
H2H communication
The process of connecting devices together so that they can exchange the information is called
interfacing. In order for these devices to swap their information, they must share a common
communication protocol.
Interfaces
Parallel: A parallel interface refers to a multi-line channel with each line capable of
transmitting several bits of data simultaneously. They usually require buses of data —
transmitting across eight, sixteen, or more wires. Data is transferred in huge, crashing waves
of 1’s and 0’s.
Serial: Serial interfaces stream their data, one single bit at a time. These interfaces can operate
on as little as one wire, usually never more than four.
Serial interfaces have certain advantages over parallel interfaces. The most significant
advantage is simpler wiring. In addition, serial interface cables can be longer than parallel
interface cables, because there is much less interaction (crosstalk) among the conductors in the
cable.
Most hardware interfaces are serial interfaces sacrificing potential speed in parallel. Serial
interfaces generally use multiple wires to control the flow and timing of binary information
along the primary data wire. Each type of hardware interface defines a method of
communicating between a peripheral and the central processor.
IoT hardware platforms use a number of common interfaces. Sensor and actuator modules can
support one or more of these interfaces:
• 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.
• When you read the value of a digital I/O pin in code, the value can must be either
HIGH or LOW, where an analog input pin at any given moment could be any value in a
range. The range depends on the resolution of the ADC. For example an 8-bit ADC can
produce digital values from 0 to 255, while a 10-bit ADC can yield a wider range of
values, from 0 to 1024. More values means higher resolution and thus a more faithful
digital representation of any given analog signal.
• The ADC sampling rate determines the frequency range that an ADC can reproduce. A
higher sampling rate results in a higher maximum frequency in the digital data. For
example, an audio signal sampled at 44,100 Hz produces a digital audio file with a
frequency response up to 22.5 kHz, ignoring typical filtering and other processing.
The bit precision dictates the resolution of the amplitude of the signal.
• I2C. Inter-Integrated Circuit serial bus uses a protocol that enables multiple modules to
be assigned a discrete address on the bus. I2C is sometimes pronounced “I two C”, “I-I-
C”, or “I squared C”. I has two wires, a clock and data wire.
• RS 232 Recommended Standard 232 is used for obtaining communication between the
computer and circuit such to transfer data between circuit and computer.
➢ Programming
The software and the programming languages on which IoT works uses very common
programming languages that programmers use and already know, So which language
should be chosen?
Firstly, because embedded systems have less storage and processing power, their language
needs are different. The most commonly used operating systems for such embedded
systems are Linux or UNIX-like OSs like Ubuntu Core or Android.
IoT software encompasses a wide range of software and programming languages from
general-purpose languages like C++ and Java to embedded-specific choices like Google’s
Go language or Parasail.
• C & C++: The C programming language has its roots in embedded systems—it even
got its start for programming telephone switches. It’s pretty ubiquitous, that is, it can
be used almost everywhere and many programmers already know it. C++ is theobject-
oriented version of C, which is a language popular for both the Linux OS and Arduino
embedded IoT software systems. These languages were basically written for the
hardware systems which make them so easy to use.
• Java: While C and C++ are hardware specific, the code in JAVA is more portable. It
is more like a write once and read anywhere language, where you install libraries,
invests time in writing codes once and you are good to go.
• Python: There has been a recent surge in the number of python users and has now
become one of the “go-to” languages in Web development. Its use is slowly spreading
to the embedded control and IoT world—specially the Raspberry Pi processor. Python
is an interpreted language, which is, easy to read, quick to learn and quick to write.
Also, it’s a powerhouse for serving data-heavy applications.
• B#: Unlike most of the languages mentioned so far, B# was specifically designed for
embedded systems, it’s small and compact and has less memory size.
• Data Collection: It is used for data filtering, data security, sensing, and measurement.
The protocols aid in decision making by sensing form real-time objects. It can work
both ways by collecting data from devices or distributing data to devices. All the data
transmits to a central server.
• Device Integration: This software ensures that devices bind and connect to networks
facilitating information sharing. A stable cooperation and communication ensure
between multiple devices.
• Real-Time Analytics: In this, the input from users serves as potential data for
carrying out real-time analysis, making insights, suggesting recommendations to solve
organizations problems and improve its approach. This, as a result, allows automation
and increased productivity.
• Application and Process Extension: These applications extend the reach of existing
systems and software to allow a wider, more effective system. They integrate
predefined devices for specific purposes such as allowing certain mobile devices or
engineering instruments access. It supports improved productivity and more accurate
data collection.
5. Protocols in IoT
➢ 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. 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:
History of MQTT
The MQTT was developed by Dr. Andy Stanford-Clark, IBM and Arlen Nipper. The
previous versions of protocol 3.1 and 3.1.1 were made available under MQTT ORG. In
2014, the MQTT was officially published by OASIS. The OASIS becomes a new home
for the development of the MQTT. Then, the OASIS started the further development of the
MQTT. Version 3.1.1 is backward comfortable with a 3.1 and brought only minor changes
such as changes to the connect message and clarification of the 3.1 version. The recent
version of MQTT is 5.0, which is a successor of the 3.1.1 version. Version 5.0 is not
backward, comfortable like version 3.1.1. According to the specifications, version 5.0 has
a significant number of features that make the code in place.
o Enhancement in the scalability and the large-scale system in order to set up with the
thousands or the millions of devices.
o Improvement in the error reporting
MQTT Architecture
To understand the MQTT architecture, we first look at the components of the MQTT.
• Message
• Client
• Server or Broker
• TOPIC
Message: The message is the data that is carried out by the protocol across the network
for the application. When the message is transmitted over the network, then the message
contains the following parameters:
1. Payload data
2. Quality of Service (QoS)
3. Collection of Properties
4. Topic Name
Client: In MQTT, the subscriber and publisher are the two roles of a client. The clients
subscribe to the topics to publish and receive messages. In simple words, we can say that
if any program or device uses an MQTT, then that device is referred to as a client. A
device is a client if it opens the network connection to the server, publishes messages that
other clients want to see, subscribes to the messages that it is interested in receiving,
unsubscribes to the messages that it is not interested in receiving, and closes the network
connection to the server.
• Publish: When the client sends the data to the server, then we call this operation as a
publish.
• Subscribe: When the client receives the data from the server, then we call this
operation a subscription.
Server: The device or a program that allows the client to publish the messages and
subscribe to the messages. A server accepts the network connection from the client,
accepts the messages from the client, processes the subscribe and unsubscribe requests,
forwards the application messages to the client, and closes the network connection from
the client.
TOPIC:
The label provided to the message is checked against the subscription known by the
server is known as TOPIC.
Architecture of MQTT
Suppose a device has a temperature sensor and wants to send the rating to the server or the
broker. If the phone or desktop application wishes to receive this temperature value on the
other side, then there will be two things that happened. The publisher first defines the topic;
for example, the temperature then publishes the message, i.e., the temperature's value. After
publishing the message, the phone or the desktop application on the other side will subscribe
to the topic, i.e., temperature and then receive the published message, i.e., the value of the
temperature. The server or the broker's role is to deliver the published message to the phone
or the desktop application.
The MQTT uses the command and the command acknowledgment format, which means that
each command has an associated acknowledgment. As shown in the above figure that the
connect command has connect acknowledgment, subscribe command has subscribe
acknowledgment, and publish command has publish acknowledgment. This mechanism is
similar to the handshaking mechanism as in TCP protocol.
The MQTT message format consists of 2 bytes fixed header, which is present in all the
MQTT packets. The second field is a variable header, which is not always present. The third
field is a payload, which is also not always present. The payload field basically contains the
data which is being sent. We might think that the payload is a compulsory field, but it does
not happen. Some commands do not use the payload field, for example, disconnect message.
Fixed Header
As we can observe in the above format that the fixed header contains two bytes. The first byte
contains the following fields:
o MQTT Control Packet Type: It occupies 4 bits, i.e., 7 to 4-bit positions. This 4-bit is
an assigned value, and each bit represents the MQTT control packet type.
o Flag specific to each MQTT packet type: The remaining 4-bits represent flag
specific to each MQTT packet type.
The byte 2 contains the remaining length, which is a variable-length byte integer. It represents
the number of bytes remaining in a current control packet, including data in the variable
header and payload. Therefore, we can say that the remaining length is equal to the sum of
the data in the variable header and the payload.
The above table shows the control packet types with 4-bit value and direction flow. As we
can observe that every command is followed by acknowledgment like CONNECT has
CONNACK, PUBLISH has PUBACK, PUBREC, PUBREL, and PUBCOMP, SUBSCRIBE
has SUBACK, UNSUBSCRIBE has UNSUBACK.
Flag Bit
The above table shows the flag value associated with each command. Here, reserved refers to
future use, which means that it is not being used right now. In the case of PUBLISH
command, flag bits are further divided into DUP, QoS, and RETAIN, where DUP is a
duplicate delivery of a PUBLISH packet, QoS is Quality of Service, and RETAIN is retained
message flag.
Remaining length
The remaining length is a variable-length integer that denotes the number of bytes remaining
within the current control packet, including data in the variable header and the payload.
Therefore, the remaining length is equal to the data in the variable header plus payload.
For example, if the length of the variable header is 20 and the length of the payload is 30,
then the remaining length is 50.
The remaining length can be used upto 4 bytes, and it starts from 2 bytes and can be used
upto 4 bytes.
This field uses 7-bit for the lengths, and MSB bit can be used to continue a flag. If the
continuation flag is 1, the next byte is also a part of the
remaining length. If the continuation flag is 0, a byte is the last one of the remaining length.
Variable header
Some types of MQTT control packet types contain an optional field also, i.e., variable header
component. This field resides between the fixed header and the payload. The content of the
variable header depends upon the packet type. The variable header contains the packet
identifier field, which is common in several packet types. The variable header component of
many MQTT control packet types includes 2-byte integer, i.e., the packet identifier field.
o PUBLISH
o PUBACK
o PUBREC
o PUBREL
o PUBCOMP
o SUBSCRIBE
o SUBACK
o UNSUBSCRIBE
o UNSUBACK
➢ ZIGBEE
ZigBee is a Personal Area Network task group with low rate task group 4. It is a
technology of home networking. ZigBee is a technological standard created for
controlling and sensor the network. As we know that ZigBee is the Personal Area
network of task group 4 so it is based on IEEE 802.15.4 and is created by Zigbee
Alliance.
ZigBee is a standard that addresses the need of very low-cost implementation of Low
power devices with Low data rate for short-range wireless communications.
Types of ZigBee Devices:
• Zigbee Coordinator Device – It communicates with routers. This device is used for
connecting the devices.
• Zigbee Router – It is used for passing the data between devices.
• Zigbee End Device – It is the device that is going to be controlled
Operating Frequency Bands (Only one channel will be selected for use in a
network):
1. Channel 0: 868 MHz (Europe)
2. Channel 1-10: 915 MHz (US and Australia)
3. Channel 11-26: 2.4 GHz (Across the World)
Architecture of Zigbee:
Zigbee architecture is a combination of 6 layers.
1. Application Layer
2. Application Interface Layer
3. Security Layer
4. Network Layer
5. Medium Access Control Layer
6. Physical Layer
Channel Access:
1. Contention Based Method (Carrier-Sense Multiple Access With Collision
Avoidance Mechanism)
2. Contention Free Method (Coordinator dedicates specific time slot to each device
(Guaranteed Time Slot (GTS)))
• Industrial Automation: ZigBee offers a faster and low-cost communication that can
communicate with almost all devices in factories and centralise them at one place
making it easy for you to monitor every process and thereby optimise the control
process. ZigBee protocol also finds its presence in many medical and scientific
equipments such as personal chronic monitoring, sports and fitness trackers, and can
even be used for remote patient monitoring.
• Smart Metering and Smart Grid Monitoring: In case of smart metering, ZigBee is
used for better energy consumption response, security over power theft, pricing
support etc. Additionally in case of smart grids, ZigBee is even used for reactive
power management, fault locations, remote temperature monitoring, etc.
• Home Automation: ZigBee is one of the most widely used protocol in most of the
home automation equipments. Right from offering lighting system solutions, sensor
responsive solutions to security solutions and surveillance, ZigBee has its presence
everywhere.
ZigBee protocol is widely used for home automation solutions and caters to complete
holistic solutions of lighting control, security control, comfort control and even energy
management.
There are several well-known globals brands in home automation that use ZigBee for their
devices. Since Zigbee is cross-compatible and interoperable, it makes managing multi-
vendor devices easy and simple. If a device is ZigBee Home Automation (HA
2.1) compliant, you can be rest assured that it will work with your automation system,
irrespective of the vendor.
The mesh-routing network of ZigBee wherein one device can talk to multiple device and
data packets travel on no fixed routes, offers better flexibility and faster communication
across devices.
➢ Bluetooth
Bluetooth has been in the tech market as a wireless channel of connection between
devices since Ericsson invented it in 1994. Since then, Bluetooth technology has evolved
and has become the go-to wireless connectivity solution for wearables, gadgets, and
other devices. Nowadays, you will find Bluetooth everywhere; cars, speakers, wearables,
medical devices, wireless headphones, shoes, etc. If you own any modern device, it is
safe to assume that you have encountered and used Bluetooth technology at one point or
the other. In other words, Bluetooth is a short-range wireless technology medium used
for exchanging data between two electronic devices (usually mobile) over a short
distance. This process completely eliminates the primitive use of cables for connectivity.
A typical example is how you can listen to music with a headset on the go without
having to plug it into the headset jack of your mobile device.
Bluetooth exchange works using UHF radio waves, otherwise known as short wave
radio, with radio bands ranging from 2.402 GHz to 2.480 GHz and building a Personal
Area Network (PAN). Typically, a master Bluetooth device can connect to a maximum of
seven devices at a go. Still, some Bluetooth devices do not have the capacity to connect
up to this number of devices. However, this kind of connection is called a piconet, an ad
hoc computer network created at that moment using Bluetooth technology. And in this
technology system, connected operate in a master-slave relationship. For example,
suppose you initiate a connection between a phone and a wireless headset through a
headset; in that case, the headset becomes the master (the initiator), and the phone is the
slave. Subsequently, both devices can switch roles and have the phone operate as the
master, while the headset becomes the slave. Ultimately, in a Bluetooth piconet, it is
possible for a master to have seven slaves; and for a slave to have more than one master.
There are two Bluetooth variants of the Bluetooth technology; hence all Bluetooth
devices can be classified into two categories – Bluetooth Classic and Bluetooth Low
Energy (BLE). On the one hand, the Bluetooth Classic is usually used in wireless
speakers, headsets, and car infotainment systems. On the other hand, Bluetooth Low
Energy (just as the name implies) is more prominent in applications that are keen on
power consumption and transfer small amounts of data less often. In other words, BLE is
commonly found in battery-powered devices like mobile phones, sensor devices, etc. As
opposed to the Bluetooth Classic that consumes high energy, Bluetooth Low Energy
thrives on reduced power consumption and cost, even while maintaining a similar
communication range as Bluetooth Classic.
It is important to note that these two kinds of Bluetooth devices are inharmonious even
when they share the same brand and specification document. That is to say, a Bluetooth
Classic cannot work together with Bluetooth Low Energy. So, it is not farfetched why
some devices like smartphones integrate both Bluetooth variants to communicate with
and connect to either type of Bluetooth present in other devices.
Bluetooth In IoT
Despite its common uses, Bluetooth has become a household name in the Internet of
Things community. It is a serious technology used for IoT applications. Apart from being
the ubiquitous solution for hands-free calling and wireless transmission technology for
audio, Bluetooth technology is leading in consumer and business IoT. Since a device-to-
device connection is expected to be fast, seamless, and wireless in the Internet of
Things, internet of things Bluetooth (Bluetooth IoT) is highly deployed because of its no-
internet function on the one hand and its capability to create large-scale device networks
via Bluetooth mesh, on the other hand.
Bluetooth mesh IoT is a computer mesh networking system based on Bluetooth Low
Energy (BLE) that allows for many-to-many communication among connected devices
over a Bluetooth radio. In a Bluetooth mesh IoT network, every message has a source
and destination address through which devices publish messages to their destinations,
which is a single thing, group of things, or everything.
Bluetooth mesh IoT networking is a game changer for wireless device networks. It is no
surprise that it sets a stage for a new wave of connectivity from whole-building networks
to city-wide smart services, especially in the present era of the home, building,
community, and industrial automation.
Bluetooth Low Energy in IoT can help IoT devices conserve energy by keeping the
devices in sleep mode when they are not in use, then let users exit the mode when
connected or reconnected. Bluetooth Low Energy in IoT is ideal for IoT applications
because, contrary to the classic Bluetooth applications, which reconnect to devices at a
time of six seconds or more, IoT BLE applications can quickly pair and reconnect with
devices in six milliseconds instead.
In IoT BLE, a device can function in three stages; the Advertising stage, Scanning stage,
and Connected stage. In a scenario where you want to integrate two BLE devices with
each other, one device has to advertise. In contrast, the other has to scan for the device
Advertising is deployed in all Bluetooth IoT devices, but one prominent application that
exclusively functions in this state is the Beacon technology. Beacon devices, like
the MOKOBlue M1 Ultra-thin Beacon, stay in the Advertising mode while broadcasting
data to other devices that they can explore and read such data from. Since advertising
data capacity is increased in Bluetooth 5.0, Beacons can unlock new IoT applications and
use cases by transmitting more data.
• It is wireless.
• It is cheap.
• It is easy to install.
• It is free to use if the device is installed with it.
CoAP and HTTP follow the same working procedure. However, CoAP attains its
functionality via asynchronous transactions (using UDP). It utilizes the POST, GET,
PUT, and DELETE calls. That’s the reason why API security is of higher grade while
CoAP is active as it is an RPK and PSK-certified protocol.
CoAP Architecture
The WWW and the constraints ecosystem are the 2 foundational elements of the CoAP
protocol architecture. Here, the server monitors and helps in communication happening
using CoAP and HTTP while proxy devices bridge the existing gap for these 2
ecosystem, making the communication smoother.
CoAP allows HTTP clients (also called CoAP clients here) to talk or exchange
data/information with each other within resource constraints. While one tries to
understand this architecture, gaining acquaintances with some key terms is crucial:
CoAP Function
The key role of CoAP is to act like HTTP wherever restricted devices are a part of
communication. While filling the gap of HTTP, it enables devices like actuators and
sensors to interact over the internet.
The devices, involved in the process, are administered and controlled by considering data
as a system’s component. CoAP protocol can operate its functions in an environment
having reduced bandwidth and extreme congestion as it consumes reduced power and
network bandwidth.
Networks featuring intense congestion and constrained connectivity are not ideal
conditions for TCP-based protocols to carry out their responsibilities. CoAP comes as a
rescuer at this place and supports the wen transfers.
Web transfers happening using satellites and covering long distances can be
accomplished with full perfection using CoAP. Networks featuring billions of nodes take
the help of the CoAP protocol for information exchange.
Regardless of the function handled or role played, CoAP promised security of highest
grade as DTLS parameters as default security parameter; the counterpart of 128 bit RSA
keys.
Speaking of its deployment, it’s simple and hassle-free. It can be implemented from
scratch for a straightforward application.
For the application ecosystem where CoAP is not desirable, generic implementations are
offered for various platforms. Most of the CoAP implementations are done privately
while few are published in open-source libraries like MIT license.
CoAP Features
The defining features that place CoAP protocol separate from other protocols are as
stated next. As it shares great similarities with HTTP, developers face bare minimum
difficulties while using it.
CoAP is an integration-friendly protocol and can be paired easily with applications using
cross-protocol proxies. Seamlessly, it integrates with JSON, XML, CBOR, and various
other data formats. In the process, the web client doesn’t get hints about a sensor
resource being accessed.
Developers are endowed with various payloads and have the freedom to make a choice to
bring the ideal payload into action.
The successful IoT device/application demands the usage of billions of nodes at a time.
CoAP is designed to handle such huge mode amounts with full perfection while keeping
the overheads under control. It can operate on tons of microcontrollers while using the
least possible resources. RAM space as low as 10KiB and code space as 100 KiB is
enough for CoAP.
As resources demanded by CoAP are on the minimum side, it keeps the wastes under
control. There is no need to deploy a hefty transport stack for web transfers. The header
and encoding, used for message processing, are compact and don’t cause any fragments
on the link layer. At a time, it supports the functions of multiple servers.
CoAP offers a comprehensive resource directory to spot the properties of the node.
CoAP is verified by RFC 7252, is developed for the future, and is able to deal with
congestion control issues.
CoAP Layer
The 3 key parts involved to build this layer are binary header, computer option, and
payload.
As explained before, confirmable texts are reliable and easy-to-construct message that
are fast and are resent until the receipt of a confirmation of successful delivery (ACK)
with message ID.
This layer takes care of CON and NON message requests. Acceptance of these requests
depend on server’s availability. Cases are:
1. If idle, the server will handle the request right away. If a CON, the client will get an
ACK for it. If the ACK is shared as a Token and differs from the ID, it is essential to
map it properly by matching request-response pairs.
2. If there is a delay or wait involved, the ACK is sent but as an empty text. When its
turn arrvies, the request is processed andthe client gets a fresh CON.
• Request or response codes for CoAP are same as for the HTTP, except for the fact that
they are in the binary format (0-8 byte Tokens) in CoAP’s case.
• Request methods for making calls (GET, PUT, POST, and DELETE) are declared in
the process.
• A CON response could either be stored in an ACK message or forward as
CON/NON.
CoAP vs MQTT
As there are great similarities, we won’t blame you if you consider these two identical.
For instance, they both are used for IoT devices as they both necessitate less amounts of
network packets causing more power-optimized performance, less storage consumption,
and longer battery power.
CoAP vs MQTT
MQTT CoAP
No message labeling but have to use diverse It defines messages properly and makes its
messages for different purposes. discovery easy.
➢ UDP
The TCP/IP protocol despite being most common protocol stack on internet is not much
suitable for IoT applications due to large overhead. It is more suitable for applications where
reliable delivery of data with high bandwidth in hand is required. The IoT applications
generally have limited bandwidth and need swift transfer of small data packets. In such case,
the UDP/IP stack is far better than TCP/IP.
The User Datagram Protocol (UDP) is the simplest transportation layer protocol used
primarily for establishing low-latency and loss tolerating connections between applications
on the communication network. Both TCP and UDP run on the top of Internet Protocol (IP)
that is why they are referred as TCP/IP and UDP/IP.
UDP is a connectionless protocol which means the sender just transmits the data without
waiting for the connection with the receiver. It is an unreliable protocol when compared with
TCP. There is no error checking mechanism or correcting mechanism involved in data
transmission which results in using less bandwidth. UDP protocol just sends the packets (or
datagram). There is no acknowledgement guarantee of packet received by the other end. It
allows for less data overhead and delays.
To achieve higher performance, the protocol allows individual packets to be dropped (with no
retries) and UDP packets to be received in a different order than they were sent, as dictated by
the application.
Features of UDP –
UDP can be used when acknowledgement of data does not hold any significance.
3) It is connectionless protocol.
UDP Datagrams –
UDP traffic works through packets called datagram, with every datagram consisting of a
single message unit. The header details are stored in the first eight bytes, but the rest is what
holds onto the actual message. The UDP datagram header can be divided into four parts each
of which is two bytes long. These parts are as follow –
1) Source Port – This 16 bits (2 bytes) information is used to identify the sender port which
will send the data. A valid UDP port number ranges from 0 to 65535.
2) Destination Port – This 16 bits information is used to identify the receiver’s port on
which the data will be received. A valid UDP port number ranges from 0 to 65535. This field
identifies the receiver’s port and is required.
3) Length – The length field specifies the entire length of the UDP packet (UDP header and
UDP data). This individual field is 16-bits field. The minimum length of the Length field is 8
bytes in case of no UDP data.
4) Checksum – This field stores the checksum value generated by the sender before sending
the data to the receiver. UDP checksums protect message data from being corrupted. The
checksum value represents an encoding of the datagram data calculated first by the sender
and later by the receiver. In UDP, checksum is optional, as opposed to TCP where checksum
is mandatory.
Advantages of UDP –
1) It is better than TCP for applications that require constant data flow, bulk data and which
require more swiftness than reliability.
2) For multicast and broadcast purposes, UDP is best suited because it supports point to
multipoint transmission method. The sender does not need to keep track of retransmission of
data for multiple receivers in contrast with the TCP/IP where sender needs to take care of
each packet.
3) There is small packet header overhead in UDP (only 8 bytes) whereas TCP has 20 bytes of
header.
UNIT III
Sensing and Actuation
Definition of Sensor
A sensor is a device that detects and responds to some type of input from the physical
environment. The input can be light, heat, motion, moisture, pressure or any number of other
environmental phenomena.
Important static characteristics of sensors include sensitivity, resolution, linearity, zero drift
and full-scale drift, range, repeatability and reproducibility.
• Sensitivity is a measure of the change in output of the sensor relative to a unit change in
the input (the measured quantity.) Example: The speakers you purchase for your home
entertainment may have a rated sensitivity of 89 dB Signal Pressure Level per Watt per
meter.
• Resolution is the smallest amount of change in the input that can be detected and
accurately indicated by the sensor. Example: What is the resolution of an ordinary ruler?
Of a Vernier Calipers?
• Linearity is determined by the calibration curve. The static calibration curve plots the
output amplitude versus the input amplitude under static conditions. Its degree of
resemblance to a straight line describes the linearity.
• Drift is the deviation from a specific reading of the sensor when the sensor is kept at that
value for a prolonged period of time. The zero drift refers to the change in sensor output
if the input is kept steady at a level that (initially) yields a zero reading. Similarly, the full
-scale drift is the drift if the input is maintained at a value which originally yields a full
scale deflection. Reasons for drift may be extraneous, such as changes in ambient
pressure, humidity, temperature etc., or due to changes in the constituents of the sensor
itself, such as aging, wear etc.
• The range of a sensor is determined by the allowed lower and upper limits of its input or
output. Usually, the range is determined by the accuracy required.
• Repeatability is defined as the deviation between measurements in a sequence when the
object under test is the same and approaches its value from the same direction each time.
The measurements have to be made under a short enough time duration so as not to allow
The dynamic characteristics of a sensor represent the time response of the sensor system.
Knowledge of these is essential to fruitfully use a sensor. Important common dynamic responses
of sensors include rise time, delay time, peak time, settling time percentage error and
steady-state error. These are defined following figure 2.7 which shall be used to represent them
graphically.
• Rise time is the time it takes a sensor to pass between 10% to 90% of the steady state
response.
• Delay time is the time it takes to reach 50% of the steady state value for the first time.
• Peak time is the time it takes to reach the maximum reading for the first time for a given
excitement.
• Settling time is the time it takes the sensor to settle down to within a certain percentage
of the steady state value (say � 1%).
• The percentage overshoot is a measure of the peak minus the steady state value,
expressed as a percentage of the ssv.
• Steady-state error is the deviation of the actual steady-state value from the desired
value. It can be corrected by calibration.
Two other terms are used to describe sensor behavior, and shall be described here. These are
accuracy and precision.
The accuracy of a system is the difference between the actual and the measured value. The
distinction between accuracy and resolution is important. While resolution is the smallest change
in measurement value that can be indicated, the accuracy is determined by the actual indication
of the sensor and the real value of the measured entity. Thus while resolution depends solely on
the sensor hardware, the accuracy is a function of the sensor hardware as well as the
measurement environment and other extraneous factors that modify the sensor behavior.
The precision is a statistical measure. It is usually indicated by the standard deviation (or
variance) of a set of readings of the sensor for the same input. The distinction between accuracy
and precision is clarified by the following figure.
Figure: Illustration of Accuracy and Precision. The center of the target represents the desired
'true' value.
Resolution
Resolution is the smallest amount of change in the input that can be detected and accurately
indicated by the sensor. There are four types
• Spatial Resolution
• Spectral Resolution
• Temporal
• Radiometric
Spatial Resolution
“A measure of the smallest angular or linear separation between two objects that can be resolved
by the sensor”.
• Resolving power is the ability to perceive two adjacent objects as being distinct
– size
– distance
– shape
– color
– contrast characteristics
– sensor characteristics
Spectral Resolution
• The width and number of spectral intervals in the electromagnetic spectrum to which a
remote sensing instrument is sensitive
• Allows characterization based on geophysical parameters (chemistry, mineralogy, etc.)
Temporal Resolution
• Depend on:
Radiometric Resolution
Number of digital levels that a sensor can use to express variability of brightness within the data
Determined by the number of bits of within which the digital information is encoded
22 = 4 levels
28 = 256 levels
Classes
The general classes include electrical, electrochemical, optical, mass sensitive, and acoustic.
Among these classes, electrochemical and optical sensors are prevalent, and have been used
elsewhere and well demonstrated.
1. Passive Sensor –
Can not independently sense the input. Ex- Accelerometer (The accelerometer works on the
movement or the vibration of the body.), soil moisture (The Soil Moisture Sensor uses
capacitance to measure dielectric permittivity of the surrounding medium.), water level (when
the sensor is put into a certain depth in the liquid to be calculated, the pressure on the sensor's
front surface is converted into the water level height) and temperature sensors (the voltage across
the terminals of the diode).
2. Active Sensor –
Independently sense the input. Example- Radar, sounder and laser altimeter sensors.
3. Analog Sensor –
The response or output of the sensor is some continuous function of its input parameter. Ex-
Temperature sensor, LDR, analog pressure sensor and analog hall effect.
4. Digital sensor –
Response in binary nature. Design to overcome the disadvantages of analog sensors. Along with
the analog sensor, it also comprises extra electronics for bit conversion. Example – Passive
infrared (PIR) sensor and digital temperature sensor(DS1620).
5. Scalar sensor –
Detects the input parameter only based on its magnitude. The answer for the sensor is a function
of magnitude of some input parameter. Not affected by the direction of input parameters.
6. Vector sensor –
The response of the sensor depends on the magnitude of the direction and orientation of input
parameter. Example – Accelerometer, gyroscope, magnetic field and motion detector sensors.
Types of sensors –
• Electrical sensor
• Light sensor
• Touch sensor
• Range sensing
• Mechanical sensor
• Pneumatic sensor
• Optical sensor
• Speed Sensor
• Temperature Sensor
• PIR Sensor
• Ultrasonic Sensor
1. Temperature: Beginning with the most common type of sensor, the temperate sensor records
the amount of heat in a given setting. It can be a machine, a room, a car, a lab, etc. This
information can be used to take the desired action, like changing the temperature to optimal
settings. The same can be automated according to some specific environmental conditions and
settings.
2. Moisture: Where temperature sensors record the heat, moisture sensors record the amount of
humidity. They have a wide array of applications in the environment, food supply chains,
medicinal labs, agriculture, etc. Moisture sensors either have a hair tension moisture element or a
psychrometer to record the moisture content.
3. Light: Light sensors record and assess the ambient light settings in a defined area and
recommend actions to change the same. In your smartphone, when the brightness is adjusted
according to the exposure to light, the light sensor and the electrical actuator play their part. In
the modern homes that have automated light settings, these sensors are used.
4. Motion: Motion sensors are usually installed in security systems and help detect unauthorized
activity. Upon sensing activity either by changes in the heat or weight, the sensor activates an
alarm system sending notifications to the right people. Motion IoT sensors use radar, infrared, or
ultrasonic waves to detect activity in their vicinity.
5. Noise: Noise sensors, as the name suggests, record the noise levels in the given environment.
It can be an entire city, a room, a car, etc. In IoT, these sensors are used to build safe working and
living environments for people. They are also used to send warning notifications to the right
people when noise levels go beyond the stipulated threshold limit.
6. Proximity: Motion sensors and proximity sensors can be kept in the same basket, as the
majority of their functions are similar. These sensors record activity nearby with the help of
electromagnetic waves, including infrared. They are used in cars, parking lots, retail stores,
stadiums, airports, and in several other places to notify the people about their proximity to
different components.
7. Level: From granular materials to semi-solid liquids, level sensors detect the quantity or level
of different substances. Manufacturing industries, particularly beverage, water treatment, and
waste management organizations, have the best use of level sensors.
8. Accelerometers: Accelerometers are an impressive type of IoT sensor used to record and
measure an object’s acceleration. These types of sensors record the rate of change of an object’s
speed in relation to time. Plus, they have the added advantage of recording changes in gravity.
They can be popularly used in driving fleets and smart pedometers or to detect movement in a
stationary object, helping to identify theft.
9. Gas: Gas sensors are used to detect changes in air quality. These sensors are built to detect the
presence of toxic, combustible, and other hazardous gasses in a given area. Most of the time, we
see the installation of this type of sensor in mining, oil, gas, and energy organizations. However,
they are also installed in smart homes and buildings to detect levels of CO2, carbon monoxide,
particulate matter, etc.
10. Optical: Optical sensors have several use cases but have become an important part of
driverless cars. These sensors are used to detect signals and signs to provide information about
the surrounding environment. In a driverless car, these sensors are used to detect objects and
signs on the road, send the signals to the central control unit and dictate a change in behavior if
required.
11. Gyroscope: These sensors are used to measure the velocity of a moving object. Velocity
refers to the speed and rotation of an object around its axis. Gyroscope sensors are commonly
used in car navigation systems and in stability control systems.
12. Chemical: We can put chemical sensors and gas sensors in the same category. With these
sensors, we can expect measurements and detection of several types of chemicals. To build IoT
solutions in a factory setting, these sensors can play an important role in ensuring workers' safety
and that of the environment.
Sensors measure and record the elements they are built to do based on their sensitivity, drift,
linearity, resolution, range, precision, and accuracy. The IoT sensors built with these
characteristics can provide accurate information.
Actuation (Actuators in IoT)
An actuator is a machine component or system that moves or controls the mechanism of the
system. Sensors in the device sense the environment, then control signals are generated for the
actuators according to the actions needed to perform.
A servo motor is an example of an actuator. They are linear or rotatory actuators, can move to a
given specified angular or linear position. We can use servo motors for IoT applications and
make the motor rotate to 90 degrees, 180 degrees, etc., as per our need.
The following diagram shows what actuators do; the controller directs the actuator based on the
sensor data to do the work.
The control system acts upon an environment through the actuator. It requires a source of energy
and a control signal. When it receives a control signal, it converts the source of energy to a
mechanical operation. On this basis, on which form of energy it uses, it has different types given
below.
Types of Actuators :
1. Hydraulic Actuators –
A hydraulic actuator uses hydraulic power to perform a mechanical operation. They are actuated
by a cylinder or fluid motor. The mechanical motion is converted to rotary, linear, or oscillatory
motion, according to the need of the IoT device. Ex- construction equipment uses hydraulic
actuators because hydraulic actuators can generate a large amount of force.
Advantages :
• Hydraulic actuators can produce a large magnitude of force and high speed.
• Used in welding, clamping, etc.
• Used for lowering or raising the vehicles in car transport carriers.
Disadvantages :
• Hydraulic fluid leaks can cause efficiency loss and issues of cleaning.
• It is expensive.
• It requires noise reduction equipment, heat exchangers, and high maintenance systems.
2. Pneumatic Actuators –
A pneumatic actuator uses energy formed by vacuum or compressed air at high pressure to
convert into either linear or rotary motion. Example- Used in robotics, use sensors that work like
human fingers by using compressed air.
Advantages :
• They are a low-cost option and are used at extreme temperatures where using air is a
safer option than chemicals.
• They need low maintenance, are durable, and have a long operational life.
• It is very quick in starting and stopping the motion.
Disadvantages :
An electric actuator uses electrical energy, is usually actuated by a motor that converts electrical
energy into mechanical torque. An example of an electric actuator is a solenoid based electric
bell.
Advantages :
• It is expensive.
• It depends a lot on environmental conditions.
Other actuators are –
Thermal/Magnetic Actuators –
These are actuated by thermal or mechanical energy. Shape Memory Alloys (SMAs) or Magnetic
Shape‐Memory Alloys (MSMAs) are used by these actuators. An example of a thermal/magnetic
actuator can be a piezo motor using SMA.
Mechanical Actuators –
A mechanical actuator executes movement by converting rotary motion into linear motion. It
involves pulleys, chains, gears, rails, and other devices to operate. Example – A crankshaft.
• Soft Actuators
• Shape Memory Polymers
• Light Activated Polymers
With the expanding world of IoT, sensors and actuators will find more usage in commercial and
domestic applications along with the pre-existing use in industry.
Sensors play a critical role in the IoT ecosystem. They enable the collection and transmission of
real-time data, which is used to monitor and control various systems, optimize operations, and
improve decision-making.
In short, it is the part of any machine that makes movement possible. In IoT, an actuator is
responsible for the physical movement of an object. It can be a device that can move things and
is powered using different sources such as the battery, electric, or manually-generated energy.
UNIT IV
IoT Application Development
IoT app development?
• IoT app development refers to creating software applications that leverage the Internet of
Things (IoT) technology to enhance functionality and user experience for IoT devices.
• These apps can connect with devices through sensors and internet connectivity to offer
features such as remote monitoring, battery status updates, and even predictive
maintenance alerts.
• By developing IoT apps, we can improve the efficiency, convenience, and sustainability
of device usage, ultimately benefiting both manufacturers and users.
Now that you have all the prerequisites in place, let’s take another look at the IoT architecture
and see what needs to be done for each of the layers:
An important step in developing an IoT application is to define the goal and scope of your app.
This entails you getting to the bare bones of your objective. Decide what you want to achieve
once the app is live. The goals may include:
• Tracking movement or location in real-time, allowing users to see where their devices are
throughout the day (e.g., EVs owned by a delivery chain)
• Monitoring temperature or humidity levels, which could help you manage
heating/cooling systems (e.g., hospitals)
• Using sensors to detect harmful gases such as carbon monoxide, methane, and hydrogen
sulfide at industrial plants (e.g., refineries)
The scope of your application will include the features that you require. This could include:
• Device Management
• Dashboarding
• Device to Mobile Communication
• Remote Shell
• Over-the-air updates
• Device Shadow
• Metadata management
• Data visualization
When you define the requirements of your IoT application, you will be able to develop an app
that will speed up your processes and bring down your costs.
The type of hardware depends on your project requirements. It could be sensors, GPS trackers, or
even wearables. But it is important to pick devices that are reliable and relevant to your project.
Take a look at the sensors that are available. If you are developing smartwatches, for example,
you will need oxymeters, pedometers, and pulse monitors. But if you are developing smart
vehicles, you will need different sensors like GPS or altitude monitors.
Once you have settled on the sensors, you also need to look at the larger hardware architecture
and figure out if you need microcontrollers or microprocessors on the device to process the data.
These details may seem overwhelming, but it is important to get them right as changing your
hardware down the road is going to be time-consuming and expensive.
There are several network protocols that you can use like WiFi, 2G, 5G, Bluetooth, LoRa, NB-
IoT, or Zigbee. Depending on your devices and the availability of resources, you need to pick the
right channels for connectivity.
If your devices are usually used in a home or office environment, for example, you can use WiFi
for data transmission. Whereas if your devices are going to be in motion or in remote locations,
you may want to pick GSM. Similarly, a companion device such as a smartwatch could use
Bluetooth.
As with hardware, it is unlikely that you will be able to change this decision down the road, so it
is important to pick the right protocol for the use cases you have in mind. This will also affect
your cost structures. Adding GSM connectivity will mean you will have to incur cellular data
charges whereas with WiFi & Bluetooth these concerns don’t exist.
Firmware, or device-side software, are the technical terms for the program that runs your
hardware. It is essential to ensure that your firmware is well equipped, or else you could
experience data loss, and end up spending a lot more on data storage and transmission than
necessary. Ensure that your firmware has the following capabilities:
Retries for pushing data on network disconnections so that connectivity issues do not lead to data
loss.
Disk persistence in the absence of network for long periods of time. This is absolutely necessary
if your devices are going to be mobile or remotely located.
Batching & compression to save data costs. Data costs can pile up over time and drastically bring
down your ROI.
Data encryption using TLS allows you to ensure data security for sensitive data.
Reliable downloads of over-the-air update images will ensure frequent updates that improve
efficiency and device performance over time.
The right IoT platform will hand you the necessary tools to create an application that serves your
purpose. In order to choose an IoT platform that works for you, you need to look for the
following:
• Uptime
• Data security
• Debugging
• Feature stability
• Security
• Migration capabilities
• Connectivity, and
• Scalability
We have created an in-depth guide on how to choose the right IoT platform, that you can take a
look at here.
UNIT V