POIT Lecture Notes
POIT Lecture Notes
(AUTONOMOUS)
Dundigal, Hyderabad - 500 043
LECTURE NOTES:
DRAFTED BY:
Ms. B. Lakshmi Prasanna (IARE10706)
Assistant Professor
Contents ............................................................................................................................. I
List of Figures ....................................................................................................................... III
1 INTRODUCTION TO INTERNET OF THINGS (IoT).......................................... 1
1.1 Definition & Characteristics of IoT..................................................................................
1.2 Physical Design of IoT ....................................................................................................
1.3 Logical design of IoT .....................................................................................................
1.4 IoT Enabling Technologies..............................................................................................
1.5 IoT Levels and Deployment Templates............................................................................
1.6 Domain specific of IoTs................................................................................................... 16
I
Contents 2
Bibliography 74
II
List of Figures
III
Chapter 1
INTRODUCTION TO INTERNET OFTHINGS (IoT)
Course Outcomes
After successful completion of this module, students should be able to:
CO 1 Relate the characteristics and appropriate Remember
levels of IoT for reusing of deployed IoT
resources across application domains.
CO 2 Identify the necessity of communication Apply
models, protocols and API’s for accessing
data from sensors and actuators to overcome
issues like failure of any connected devices
Introduction
IoT comprises things that have unique identities and are connected to internet. By 2020 there
will be a total of 50 billion devices /things connected to internet. IoT is not limited to just
connectingthings to the internet but also allow things to communicate and exchange data.
Definition
A dynamic global n/w infrastructure with self-configuring capabilities based on standard and
in- teroperable communication protocols where physical and virtual things have identities,
physical attributes and virtual personalities and use intelligent interfaces, and are seamlessly
integrated into information n/w, often communicate data associated with users and their
environments.
1
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 2
Characteristics
1) Dynamic and Self Adapting: IoT devices and systems may have the capability to
dynamically adapt with the changing contexts and take actions based on their operating
conditions, users con-text or sensed environment.
Eg: the surveillance system is adapting itself based on context and changing conditions.
2) Self-Configuring: allowing a large number of devices to work together to provide certain
functionality.
3) Inter Operable Communication Protocols: support a number of interoperable
communication protocols and can communicate with other devices and also with
infrastructure.
4) Unique Identity: Each IoT device has a unique identity and a unique identifier (IP address).
5) Integrated into Information Network: that allow them to communicate and exchange data
with other devices and systems.
Applications of IoT
1) Home
2) Cities
3) Environment
4) Energy
5) Retail
6) Logistics
7) Agriculture
8) Industry
9) Health and Life Style
1) Things in IoT:
The things in IoT refers to IoT devices which have unique identities and perform remote
sensing, actuating and monitoring capabilities. IoT devices can exchange data with other connected
devices applications. It collects data from other devices and process data either locally or
remotely. An IoT device may consist of several interfaces for communication to other devices
both wired and wireless.
These includes
(i) I/O interfaces for sensors,
(ii) Interfaces for internet connectivity
(iii) memory and storage interfaces and
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 3
XML data between network entities. Support client-server and server-server communication.
• DDS: Data Distribution Service is data centric middleware standards for device-to-device
or machine-to-machine communication. Uses publish-subscribe model.
• AMQP: Advanced Message Queuing Protocol is open application layer protocol for
business messaging. Supports both point-to-point and publish-subscribe model.
Refers to an abstract represent of entities and processes without going into the low level
specifies of implementation. 1) IoT Functional Blocks
2) IoT Communication Models
3) IoT Comm. APIs
1) IoT Functional Blocks
It Provides the system the capabilities for identification, sensing, actuation, communication and
management.
• Device: An IoT system comprises of devices that provide sensing, actuation, monitoring and
control functions.
• Communication: handles the communication for IoT system. • Services: for device
monitoring, device control services, data publishing services and services for device
discovery.
• Management: Provides various functions to govern the IoT system. • Security: Secures IoT
system and priority functions such as authentication, authorization, message and context
integrity and data security. • Application: IoT application provide an interface that the users
can use to control and monitor various aspects of IoT system. 2) IoT Communication Models
1) Request-Response
2) Publish-Subscibe3) Push-Pull
4) ExclusivePair
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 7
1. Request-Response Model:
In which the client sends request to the server and the server replies to requests. Is a stateless
communication model and each request-response pair is independent of others.
2) Publish-Subscibe Model: Involves publishers, brokers and consumers. Publishers are
sourceof data. Publishers send data to the topics which are managed by the broker. Publishers
are not aware of the consumers. Consumers subscribe to the topics which are managed by the
broker. When the broker receives data for a topic from the publisher, it sends the data to all the
subscribed consumers. 3) Push-Pull Model:
Push-Pull Model in which data producers push data to queues and consumers pull data from
the
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 8
queues. Producers do not need to aware of the consumers. Queues help in decoupling the
message between the producers and consumers.
4) Exclusive Pair:
Exclusive Pair is bi-directional, fully duplex communication model that uses a persistent
connection between the client and server. Once connection is set up it remains open until the
client send a request to close the connection. Is a stateful communication model and server is
aware of all the open connections.
3) IoT Communication APIs:
a) REST based communication APIs (Request-Response Based Model)
b) WebSocket based Communication APIs (Exclusive Pair Based Model)
a) REST based communication APIs:
Representational State Transfer (REST) is a set of architectural principles by which we can
design web services and web APIs that focus on a systems resource and have resource states
are ad- dressed and transferred.
The REST architectural constraints: Fig. shows communication between client server with
REST APIs.
API has a base URI (e.g: http://example.com/api/tasks/). The clients and requests to these URIs
using the methods defined by the HTTP protocol (e.g: GET, PUT, POST or DELETE). A
Restful web service can support various internet media types.
b) WebSocket Based Communication APIs:
WebSocket APIs allow bi-directional, full duplex communication between clients and servers.
WebSocket APIs follow the exclusive pair communication model.
IoT is enabled by several technologies including Wireless Sensor Networks, Cloud Computing,
Big Data Analytics, Embedded Systems, Security Protocols and architectures, Communication
Protocols, Web Services, Mobile internet and semantic search engines.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 10
Wireless Sensor Network Comprises of distributed devices with sensors which are used to
monitor the environmental and physical conditions. Zig Bee is one of the most popular wireless
technologies used by WSNs.
WSNs used in IoT systems are described as follows:
• Weather Monitoring System: in which nodes collect temp, humidity and other data, which
is aggregated and analyzed.
• Indoor air quality monitoring systems: to collect data on the indoor air quality and
concentration of various gases.
• Soil Moisture Monitoring Systems: to monitor soil moisture at various locations.
• Surveillance Systems: use WSNs for collecting surveillance data (motion data detection).
• Smart Grids: use WSNs for monitoring grids at various points.
• Structural Health Monitoring Systems: Use WSNs to monitor the health of
structures (building, bridges) by collecting vibrations from sensor nodes deployed at
variouspoints in the structure.
2) Cloud Computing:
Cloud Computing Services are offered to users in different forms.
• Infrastructure-as-a-service(IaaS):provides users the ability to provision computing and
stor-age resources. These resources are provided to the users as a virtual machine instances and
virtual storage.
• Platform-as-a-Service(PaaS): provides users the ability to develop and deploy application
in cloud using the development tools, APIs, software libraries and services provided by the
cloud service provider.
• Software-as-a-Service(SaaS): provides the user a complete software application or the user
interface to the application itself.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 11
4) Communication Protocols:
Communication Protocols form the back-bone of IoT systems and enable network
connectivity and coupling to applications.
• Allow devices to exchange data over network.
• Define the exchange formats, data encoding addressing schemes for device and routing of
pack-ets from source to destination.
• It includes sequence control, flow control and retransmission of lost packets.
5) Embedded Systems:
Embedded Systems is a computer system that has computer hardware and software embedded
to perform specific tasks. Embedded System range from low cost miniaturized devices such as
digital watches to devices such as digital cameras, POS terminals, vending machines, appliances
etc.,
1) IoT Level1: System has a single node that performs sensing and/or actuation, stores data,
performs analysis and host the application as shown in fig. Suitable for modeling low cost and
low complexity solutions where the data involved is not big and analysis requirement are not
computationally intensive.
An e.g., of IoT Level1 is Home automation. 2) IoT Level2: has a single node that performs
sensing and/or actuating and local analysis as shown in fig. Data is stored in cloud and
application is usually cloud based. Level2 IoT systems are suitable for solutions where data are
involved is big, however, the primary analysis requirement is not computationally intensive
and can be done locally itself.
An e,g., of Level2 IoT system for Smart Irrigation.
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 12
3) IoT Level3: system has a single node. Data is stored and analyzed in the cloud application is
cloud based as shown in fig. Level3 IoT systems are suitable for solutions where the data
involvedis big and analysis requirements are computationally intensive.
An example of IoT level3 system for tracking package handling. 4) IoT Level4: System
has
multiple nodes that perform local analysis. Data is stored in the cloud and application is
cloud
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 13
based as shown in fig. Level4 contains local and cloud-based observer nodes which can
subscribe to and receive information collected in the cloud from IoT devices.
An example of a Level4 IoT system for Noise Monitoring. 5) IoT Level5: System has
multiple
end nodes and one coordinator node as shown in fig. The end nodes that perform sensing
and/or actuation. Coordinator node collects data from the end nodes and sends to the cloud.
Data is stored and analyzed in the cloud and application is cloud based. Level5 IoT systems are
suitable for solution based on wireless sensor network, in which data involved is big and analysis
requirements are computationally intensive.
An example of Level5 system for Forest Fire Detection.
6) IoT Level6: System has multiple independent end nodes that perform sensing and/or
actuation and sensed data to the cloud. Data is stored in the cloud and application is cloud
basedas shown in fig. The analytics component analyses the data and stores the result in the
cloud data base. The
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 14
results are visualized with cloud-based application. The centralized controller is aware of the
statusof all the end nodes and sends control commands to nodes. An example of a Level6 IoT
system for Weather Monitoring System.
1) Home Automation:
a) Smart Lighting: helps in saving energy by adapting the lighting to the ambient conditions
and switching on/off or diming the light when needed.
b) Smart Appliances: make the management easier and also provide status information to the
users remotely.
c) Intrusion Detection: use security cameras and sensors (PIR sensors and door sensors) to
detect intrusion and raise alerts. Alerts can be in the form of SMS or email sent to the user.
d) Smoke/Gas Detectors: Smoke detectors are installed in homes and buildings to detect
smoke that is typically an early sign of fire. Alerts raised by smoke detectors can be in the form
of signals to a fire alarm system. Gas detectors can detect the presence of harmful gases such as
CO, LPG etc.,
2) Cities:
a) Smart Parking: make the search for parking space easier and convenient for drivers. Smart
parking are powered by IoT systems that detect the no. of empty parking slots and send information
over internet to smart application backends.
b) Smart Lighting: for roads, parks and buildings can help in saving energy.
c) Smart Roads: Equipped with sensors can provide information on driving condition, travel
time estimating and alert in case of poor driving conditions, traffic condition and accidents.
d) Structural Health Monitoring: uses a network of sensors to monitor the vibration levels
in the structures such as bridges and buildings.
e) Surveillance: The video feeds from surveillance cameras can be aggregated in cloud based
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 15
3) Environment: a) Weather Monitoring: Systems collect data from a no. of sensors attached
and send the data to cloud-based applications and storage back ends. The data collected in
cloud can then be analyzed and visualized by cloud-based applications.
b) Air Pollution Monitoring: System can monitor emission of harmful gases(CO2, CO, NO,
NO2 etc.,) by factories and automobiles using gaseous and meteorological sensors. The
collected data can be analyzed to make informed decisions on pollutions control approaches.
c) Noise Pollution Monitoring: Due to growing urban development, noise levels in cities have
increased and even become alarmingly high in some cities. IoT based noise pollution
monitoring systems use a no. of noise monitoring systems that are deployed at different
placesin a city. The data on noise levels from the station is collected on servers or in the cloud.
The collected data is then aggregated to generate noise maps.
d) Forest Fire Detection: Forest fire can cause damage to natural resources, property and
human life. Early detection of forest fire can help in minimizing damage.
e) River Flood Detection: River floods can cause damage to natural and human resources and
human life. Early warnings of floods can be given by monitoring the water level and flow rate.
IoT based river flood monitoring system uses a no. of sensor nodes that monitor the water level
and flow rate sensors.
4) Energy:
a) Smart Grids: is a data communication network integrated with the electrical grids that
collects and analyze data captured in near-real-time about power transmission, distribution and
consumption. Smart grid technology provides predictive information and recommendations to
utilities, their suppliers, and their customers on how best to manage power. By using IoT based
sensing and measurement technologies, the health of equipment and integrity of the grid can be
evaluated.
b) Renewable Energy Systems: IoT based systems integrated with the transformers at the
point of interconnection measure the electrical variables and how much power is fed into the
grid. For wind energy systems, closed-loop controls can be used to regulate the voltage at point
of interconnection which coordinate wind turbine outputs and provides power support.
c) Prognostics: In systems such as power grids, real-time information is collected using
specialized electrical sensors called Phasor Measurement Units (PMUs) at the substations. The
information received from PMUs must be monitored in real-time for estimating the state of the
systemand for predicting failures.
5) Retail:
a) Inventory Management: IoT systems enable remote monitoring of inventory using data
collected by RFID readers.
b Solutions such as contact-less payments powered by technologies such as Near Field
Communication (NFC) and Bluetooth. c) Smart Vending Machines: Sensors in a smart
vending machine
Chapter 1. INTRODUCTION TO INTERNET OF THINGS (IoT) 16
monitors its operations and send the data to cloud which can be used for predictive
maintenance.
6) Logistics:
a) Route generation and scheduling: IoT based system backed by cloud can provide first re-
sponse to the route generation queries and can be scaled upto serve a large transportation
network.
b) Fleet Tracking: Use GPS to track locations of vehicles inreal-time.
c) Shipment Monitoring: IoT based shipment monitoring systems use sensors such as temp,
hu-midity, to monitor the conditions and send data to cloud, where it can be analyzed to detect
food spoilage.
d) Remote Vehicle Diagnostics: Systems use on-board IoT devices for collecting data on
Vehicle operations (speed, RPMetc.,) and status of various vehicle subsystems.
7) Agriculture:
a) Smart Irrigation: to determine moisture amount in soil.
b) Green House Control: to improveproductivity.
8) Industry:
a) Machine diagnosis and prognosis
b) Indoor Air Quality Monitoring
9) Health and LifeStyle:
a) Health and Fitness Monitoring
b) Wearable Electronics
Chapter 2
IoT Network and Management
Course Outcomes
After successful completion of this module, students should be able to:
CO3 Compare Machine to Machine with IoT and identifying Understand
the role of SDN,NFV, NETCONFG-YANG for data
exchange between devices and management on network.
Machine-to-Machine (M2M)
Machine-to-Machine (M2M) refers to networking of machines (or devices) for the purpose
ofre-mote monitoring and control and data exchange.
• Term which is often synonymous with IoT is Machine-to-Machine (M2M).
• IoT and M2M are often used interchangeably.
Fig2.1 . Shows the end-to-end architecture of M2M systems comprises of M2M area
networks,communication networks and application domain.
An M2M area network comprises of machines( or M2M nodes) which have embedded network
17
Chapter 2. IoT network and Management 18
modules for sensing, actuation and communicating various communication protocols can be
usedfor M2M LAN such as ZigBee, Bluetooth, M-bus, Wireless M-Bus etc., These protocols
provideconnectivity between M2M nodes within an M2M area network.
• The communication network provides connectivity to remote M2M area networks. The com-
munication network provides connectivity to remote M2M area network. The communication
network can use either wired or wireless network(IP based). While the M2M are networks use
either properietorary or non-IP based communication protocols, the communication network
uses IP-based network. Since non-IP based protocols are used within M2M area network, the
M2M nodes within one network cannot communicate with nodes in an external network.
• To enable the communication between remote M2M are network, M2M gateways are used.
The communication between M2M nodes and the M2M gateway is based on the
communication protocols which are naive to the M2M are network. M2M gateway performs
protocol translations to enable Ip-connectivity for M2M are networks. M2M gateway acts as a
proxy performing translations from/to native protocols to/from Internet Protocol (IP). With an
M2M gateway, each mode in an M2M area network appears as a virtualized node for external
M2M area networks.
1) Communication Protocols:
• Commonly uses M2M protocols include ZigBee, Bluetooth, ModBus, M-Bus, Wireless M-
Busetc.,
• In IoT uses HTTP, CoAP, WebSocket , MQTT ,XMPP ,DDS ,AMQP etc.,
2) Machines in M2M Vs Things in IoT:
• Machines in M2M will be homogenous whereas Things in IoT will be heterogeneous.
3) Hardware Vs Software Emphasis:
• the emphasis of M2M is more on hardware with embedded modules, the emphasis of IoT is
moreon software.
4) Data Collection and Analysis
• M2M data is collected in point solutions and often in on-premises storage infrastructure.
Chapter 2. IoT network and Management 19
• The data in IoT is collected in the cloud (can be public, private orhybrid cloud).
5) Applications
• M2M data is collected in point solutions and can be accessed by on-premises applications such
asdiagnosis applications, service management applications, and on- premisis enterprise
applications.
• IoT data is collected in the cloud and can be accessed by cloud applications such as
analyticsapplications, enterprise applications, remote diagnosis and management applications,
etc.
Software Defined Networking (SDN) and Network Function Vir-tualization (NFV) for
IoT
systemconfiguration.
2) Monitoring Operational and Statistical Data: Management systems can help in
monitoring operational and statistical data of a system. This data can be used for fault diagnosis
or prognosis.
3) Improved Reliability: A management system that allows validating the system
configurations before they are put into effect can help in improving the system reliability.
4) System Wide Configurations: For IoT systems that consists of multiple devices or nodes,
ensuring system wide configuration can be critical for the correct functioning of the system.
5) Multiple System Configurations: For some systems it may be desirable to have multiple valid
configurations which are applied at different times or in certain conditions.
6) Retrieving and Reusing Configurations: Management systems which have the capability
of retrieving configurations from devices can help in reusing the configurations for other
devices ofthe same type.
Chapter 3
IoT ARCHITECTURE AND PYTHON
Course Outcomes
After successful completion of this module, students should be able to:
CO 4 Select an appropriate sensor to make sensitive Understand
measurements of physical parameters.
#define TEMPERATURE A0
#define MOTOR 6
void setup()
Serial.begin(9600);
pinMode(MOTOR, OUTPUT);
}
Chapter 3. IoT ARCHITECTURE AND PYTHON 25
if(temp<35)
return 0;
else if(temp>40)
return 255;
else
void loop()
Serial.println(speed_decider(temperature));
analogWrite(MOTOR, speed_decider(temperature));
}
3.3 Control AC power with relays:
Chapter 3. IoT ARCHITECTURE AND PYTHON 26
Chapter 3. IoT ARCHITECTURE AND PYTHON 27
#define potPin A5
#define led1Pin 6
#define led2Pin 5
#define led3Pin 4
#define led4Pin 3
void setup()
{
pinMode (potPin, INPUT);
pinMode (led1Pin, OUTPUT);
pinMode (led2Pin, OUTPUT);
pinMode (led3Pin, OUTPUT);
pinMode (led4Pin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
int potMeasure = analogRead(A5);
Serial.println(potMeasure);
if (potMeasure < 256)
{
digitalWrite(led1Pin, HIGH);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, LOW);
}
else if (potMeasure < 512)
{
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, HIGH);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, LOW);
}
else if (potMeasure < 768)
{
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, HIGH);
digitalWrite(led4Pin, LOW);
}
else if(potMeasure < 1023)
{
digitalWrite(led1Pin, LOW);
digitalWrite(led2Pin, LOW);
digitalWrite(led3Pin, LOW);
digitalWrite(led4Pin, HIGH);
}
}
Sensors:
• Temperature sensing is one of the most sensitive properties or parameters for industries like
petrochemical, automotive, aerospace and defense, consumer electronics, and so on.
• These sensors are installed into devices with the purpose of measuring the temperature of a
medium accurately and efficiently in a given set of requirements.
Chapter 3. IoT ARCHITECTURE AND PYTHON 31
Thermocouples
• A thermocouple consists of two wires of different metals electrically bonded at two points.
• The varying voltage created between these two dissimilar metals reflects proportional
changes in temperature.
• Thermocouples are nonlinear and require a conversion with a table when used for
temperature control and compensation, typically accomplished using a lookup table.
• Accuracy is low, from 0.5 °C to 5 °C but thermocouples operate across the widest
temperature range, from -200 °C to 1750 °C.
Thermistor:
The word “Thermistor” is a combination of the words “Thermal” and “resistor“.
• A thermistor is a type of resistor whose resistance changes with the change in temperature. It
is a passive component that does not require an extra power source to operate.
• They are inexpensive and accurate in measuring temperature. But they do not operate well in
extreme conditions such as very high or very low temperatures.
• Depending on the material used, the resistance may either increase or decrease.
• This change in resistance can be calibrated and measured to calculate the exact temperature
of the environment in a circuit
Chapter 3. IoT ARCHITECTURE AND PYTHON 32
Types of Thermistor
PTC (Positive Temperature Coefficient) Thermistor
NTC (Negative Temperature Coefficient) Thermistor
PTC Thermistor
• It is a type of thermistor whose resistance is directly proportional to the surrounding
temperature.
• Its resistance increases with an increase in the temperature and decreases with a decrease in
the temperature.
• It is made of polycrystalline ceramic material. Its resistance increases non-linearly in a
curve.
• The increase in resistance is very small at low temperatures which increases rapidly when
the temperature reaches above the switching point (TR).
Chapter 3. IoT ARCHITECTURE AND PYTHON 33
PTC Applications
Over-Current Protection: When the current exceeds a certain limit, it generates heat that can
damage the wiring as well as the components. The resistance of the PTC thermistor increases
with the temperature that can be used to prevent the current from increasing.
Inrush Current Protection: Inrush current is the starting current drawn by a motor during its
startup that is very high and it can damage its windings. A PTC thermistor heats up and its
resistance increases that limits the inrush current.
Motor Starting: Some motors include an auxiliary startup winding that is only used for
starting the motor. Initially, the PTC resistance is very low and it allows the current to pass
through this auxiliary winding. The temperature gradually increases as well as the PTC
resistance. Once the motor attains certain speed, the PTC resistance increases to a point that
blocks the current flow to the startup windings.
Time Delay: The PTC can switch from a low resistance state to a high resistance state after
some time delay. The time can depend on the change in temperature or the voltage in use. It
can be used in circuits to achieve a calculated time delay function such as in circuit breakers,
timers, relays.
Temperature Control: The PTC thermistor can control a heater to maintain a temperature
from raising a certain limit. The PTC breaks the supply when the temperature exceeds certain
limits and switches back on when the temperature falls below a certain limit.
Electrical Fuse: The resistance can also increase with an increase in its internal temperature
due to the current flowing through it. It can act as a fuse to stop the current flow in case
of over current.
NTC Thermistor
• As its name suggests, NTC or Negative temperature coefficient thermistor has a negative
coefficient k. therefore, its resistance varies inversely with the temperature. The resistance
decreases with an increase in temperature and vice versa.
• They are made of oxides of nickel, cobalt, copper, iron and titanium.
Chapter 3. IoT ARCHITECTURE AND PYTHON 34
• They usually operate at a very large range of temperature with very precise temperature
monitoring.
• They are mostly used in temperature sensing devices as opposed to PTC that are mostly used
as current limiters.
Where:
T1 is the first temperature point in Kelvin
T2 is the second temperature point in Kelvin
R1 is the thermistors resistance at temperature T1 in Ohms
R2 is the thermistors resistance at temperature T2 in Ohms
Chapter 3. IoT ARCHITECTURE AND PYTHON 35
NTC Applications
Disc and chip: Due to its larger surface, they have a slower response time and have higher
current handling capabilities than the bead type.
Bead : They offer better stability with a quick response time. Their structure allows it to
operate at very high temperatures. To further protect it from mechanical damage, they are
encapsulated in glass.
Glass encapsulated: The thermistors are sealed in a glass body to improve their operating
temperature range. It is an air-tight glass body that improves its stability and protects it from
mechanical damage. Glass encapsulated thermistors can operate at above 150.
Cylindrical : They have a larger size as compared to other types. They are robust and reliable.
Voltage sensor
• It is used to calculate and monitor the amount of voltage in an object. Voltage sensors can
determine the AC voltage or DC voltage level.
• The input of this sensor is the voltage, whereas the output is the switches, analog voltage
signal, a current signal, or an audible signal.
Two main types of voltage sensors
• Capacitive type voltage sensor and
• Resistive type voltage sensor.
Applications
• Power failure detection
• Load sensing
• Safety switching
• Temperature control
• Power demand control
• Fault detection
ADC-Analog to Digital Converter
• An electronic integrated circuit that transforms a signal from analog(continuous) form to
digital(discrete) form is known as ADC.
• Analog signals are directly measurable quantities while digital signals only have two
states(binary 0 and binary 1).
• The heart of the data acquisition system is ADC.
• Digital systems require discrete digital data.
• Processors perform arithmetic operations on digital signals.
• Signals in digital form are less susceptible to the effects of noise.
• ADC provides a link between the analog world (of transducers) and the digital world (of data
and signal processing).
• Types of ADC
➨Counter type(simplest)
➨Successive Approximation
➨Flash ADC
➨Sigma Delta
1. Digital Voltmeter: measures the voltage in analog and converts to digital form using ADC
for digital representation form.
2. Mobile phone: Analog voice is converted to digital form for further processing(speech
compression, encoding, etc.)
3. Scanner: When we take photos, the scanner uses ADC internally to convert analog
information provided by pictures into digital information.
4. Voice Recorder: It uses ADC to convert analog voice information to digital information. The
Chapter 3. IoT ARCHITECTURE AND PYTHON 38
latest VOIP solutions utilize the same concept.
specifications are considered for the design, development, and selection of DAC(Digital to
Analog Converter).
➨Resolution
➨Reference voltages
➨SettlingTime
➨Linearity
➨Speed
➨Errors
Modems need DAC to convert data to analog form to carry it over telephone wires.
• Video adapters also need DACs known as RAMDACs to convert the digital form of data to
analog form.
• Digital Motor Control
• Printers
• Sound Equipment
• Function Generators or Oscilloscopes
• Digital Audio
DHT11 Sensor
• HT11 is a low-cost digital sensor for sensing temperature and humidity values serially with
the one-wire protocol.
• This sensor can be easily interfaced with any microcontroller such as Arduino, Raspberry Pi,
etc.
• It is available as a sensor and as a module.
• The difference between this sensor and the module is the pull-up resistor and a power-on
LED.
• It provides relative humidity values in percentage (20 to 90% RH) and temperature values in
degrees Celsius (0 to 50 °C).
• It uses a resistive humidity measurement component and NTC temperature measurement
component.
• Working Principle of DHT11 Sensor
• DHT11 sensor consists of a capacitive humidity sensing element and a thermistor for sensing
temperature.
• The humidity sensing capacitor has two electrodes with a moisture-holding substrate as a
dielectric between them. Change in the capacitance value occurs with the change in humidity
Chapter 3. IoT ARCHITECTURE AND PYTHON 39
levels. The IC measure processes these changed resistance values and changes them into digital
form.
• For measuring temperature this sensor uses a Negative Temperature coefficient thermistor,
which causes a decrease in its resistance value with an increase in temperature To get a larger
resistance value even for the smallest change in temperature, this sensor is usually made up of
semiconductor ceramics or polymers.
• The sampling rate of this sensor is 1Hz .
• DHT11 is small in size with operating voltage from 3 to 5 volts.
• The maximum current used while measuring is 2.5 mA.
• A pull-up resistor of 5k to 10k ohms is provided for communication between the sensor and
microcontroller.
Applications
• Measuring humidity and temperature values in heating, ventilation, and air conditioning
systems. Weather stations also use these sensors to predict weather conditions.
• Homes, offices, cars, museums, greenhouses, and industries use this sensor for measuring
humidity values and as a safety measure
Motion Sensor
• A motion sensor is an electronic device that designed to detect and measure movement.
• It is incorporated as a component of a system that routinely performs a task or else alerts a
user of motion in a region.
• These sensors form a very important component of security, home control, energy
efficiency, automated lighting control, and other helpful systems.
• There are two types of motion sensors:
1. Active motion sensors
2. Passive motion sensors.
• Active sensors have both a transmitter and a receiver. This type of sensor detects motion by
measuring changes in the amount of sound or radiation reflecting back into the receiver.
• When an object interrupts or alters the sensor’s field, an electric pulse is sent to the
embedded computer, which in turn interacts with the mechanical component.
• The most widely used type of passive motion sensor in home security systems is the passive
infrared sensor
• The PIR sensor is designed to detect the infrared radiation emitted naturally from the human
body.
• The receiver is contained in a filter that only allows infrared to pass through it.
• When a person walks into the PIR sensor’s field of detection, the difference in radiation
creates a positive charge within the receiver;
• this perceived change causes the sensing unit to send electrical data to the embedded
computer and hardware component.
• Types of Motion Sensors
• All warm-blooded animals produce IR radiation. Passive infrared sensors include a thin
Chapter 3. IoT ARCHITECTURE AND PYTHON 41
Pyroelectric film material, that responds to IR radiation by emitting electricity.
• This sensor will activate a burglar alarm whenever this influx of electricity takes
place. These sensors are economical, don’t use more energy, and last forever. These sensors are
commonly used in indoor alarms.
Ultrasonic Sensor
• It can be active (or) passive, where passive ones pay attention to particular sounds like metal
on metal, or glass breaking.
• These sensors are very sensitive, but they are frequently expensive and prone to fake alarms.
Active ones generate ultrasonic wave (sound wave) pulses and then determine the reflection of
these waves off a moving object.
• Animals like cats, dogs, and fishes can hear these sound waves, so an active ultrasonic alarm
might unsettle them.
Microwave Sensor
• These sensors generate microwave pulses and then calculate their reflection off of objects, in
order to know whether objects are moving or not.
• They are very sensitive, but sometimes these can be seen in nonmetallic objects which can
be detected moving objects on the outside of the target range.
• It consumes a lot of power, so these sensors are frequently designed to cycle ON & OFF.
Electronic guard dogs utilize microwave sensors.
Chapter 3. IoT ARCHITECTURE AND PYTHON 42
Tomographic Sensor
• These sensors generate radio waves and detect when those waves are troubled.
• They can notice through walls and objects and are frequently placed in a way that makes a
radio wave net that covers up large areas.
• These sensors are expensive, so they are normally used in warehouses, storage units, and
also in other situations that need a commercial level of security.
• Some types of motion detectors mix some sensors in order to decrease fake alarms. But,
dual sensors are only activated when both kinds sense motion.
• For instance, a dual microwave or PIR sensor will start out on the passive infrared sensor
setting, because that consumes less energy.
• When the passive infrared sensor is tripped, the microwave division will turn ON; then, if
the remaining sensor is also tripped, the alarm will generate a sound. This combined type is
great for neglecting fake alarms but tuns the possibility of missing real ones.
#include<SoftwareSerial.h>
/* Create object named bt of the class SoftwareSerial */
SoftwareSerial bt(2,3); /* (Rx,Tx) */
voidsetup(){
bt.begin(9600); /* Define baud rate for software serial communication */
Serial.begin(9600); /* Define baud rate for serial communication */
}
voidloop()
{
if (bt.available()) /* If data is available on serial port */ { Serial.write(bt.read()); /* Print
character received on to the serial monitor */ }
} The output is data that is received on the software serial port, and printed on the serial
monitor.
Chapter 3. IoT ARCHITECTURE AND PYTHON 43
Chapter 4
IoT PHYSICAL DEVICES ANDENDPOINTS
Course Outcomes
After successful completion of this module, students should be able to:
CO 5 Choose raspberry Pi device and set up the Apply
environment for connecting other devices/sensors to
communicate with raspberry pi using Python language
IoT Device
A ”Thing” in Internet of Things (IoT) can be any object that has a unique identifier and which
can send/receive data (including user data) over a network (e.g., smart phone, smartTV,
computer,refrigerator, car, etc.).
• IoT devices are connected to the Internet and send information about themselves or about
theirsurroundings (e.g. information sensed by the connected sensors) over a network (to other
de- vices or servers/storage) or allow actuation upon the physical entities/environment around
them remotely.
• A home automation device that allows remotely monitoring the status of appliances and
control-ling the appliances.
• An industrial machine which sends information abouts its operation and health monitoring
datato a server.
44
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53
1. Sensing: Sensors can be either on-board the IoT device or attached to thedevice.
2. Actuation: IoT devices can have various types of actuators attached that allow taking
actionsupon the physical entities in the vicinity of thedevice.
3. Communication: Communication modules are responsible for sending collected data to
other devices or cloud-based servers/storage and receiving data from other devices and
commands fromremote applications.
4. Analysis and Processing: Analysis and processing modules are responsible for making
senseof the collected data.
credit card. Raspberry Pi runs various flavors of Linux and can perform almost all tasks that a
nor- mal desktop computer can do. Raspberry Pi also allows interfacing sensors and actuators
through the general purpose I/O pins. Since Raspberry Pi runs Linux operating system, it
supports Python”out of the box”. Raspberry Pi Linux on Raspberry Pi
1. Raspbian: Raspbian Linux is a Debian Wheezy port optimized for Raspberry Pi.
2. Arch: Arch is an Arch Linux port for AMD devices.
3. Pidora: Pidora Linux is a Fedora Linux optimized for Raspberry Pi.
4. RaspBMC: RaspBMC is an XBMC media-center distribution for Raspberry Pi.
5. OpenELEC: OpenELEC is a fast and user-friendly XBMC media-center distribution.
6. RISC OS: RISC OS is a very fast and compact operating system.
Raspberry Pi GPIO
Raspberry Pi
Interfaces
1. Serial: The serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins for
com-munication with serial peripherals.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53
2. SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communi-cating with one or more peripheral devices.
3. I2C: The I2C interface pins on Raspberry Pi allow you to connect hardware modules. I2C
in-terface allows synchronous data transfer with just two pins - SDA (data line) and SCL
(clockline).
Raspberry Pi Example: Interfacing LED and switch with Raspberry Pi
from time import sleep
Other Devices
1. pcDuino
2. BeagleBoneBlack
3. Cubieboard
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53
SPI is one of the most popular serial communication protocols. SPI – Serial Peripheral
Interface is an interface bus commonly used to transmit and receive the data between
microcontrollers andsmall peripherals such as shift registers, sensors, displays, flash memory,
etc. Since it is syn- chronous communication, it uses a separate clock line and data lines. The
interface was developedby Motorola in the mid-1980s.
An SPI – Serial Peripheral Interface protocol system consists of one master device and one
or more slave devices. But in I2C, we can have one or more master devices and one or more
slave devices. The master is providing the SPI clock and the slave is receiving the SPI clock
from the master.
SPI needs 4 wires at least. But some of the recent day devices support 3 pin mode and 4 pin
modesalso.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53
MOSI – Master Out Slave In is used to send the data from the master to the slave device.
MISO – Master In Slave Out is used to receive the data from the slave to the master device.
SCLK – Serial Clock is the clock that is generated by the master device.
SS/CS/CE – Salve Select/Chip Select/Chip Enable line is used to select the slave device in the
SPIbus interface.
SPI protocol is a Full-duplex as this protocol has separate pins for incoming data and
outgoingdata. So, we can transmit and receive the data at the same time.
4.5.1.1SPI Modes
The SPI interface defines no protocol for data exchange, limiting overhead and allowing for
high- speed data streaming. We saw how the data is being transferred to the slave from the
master. As we have an understanding of data communication, let’s go a little bit deeper. In
addition to settingthe clock frequency, the master must also configure the clock polarity and
phase with respect to the data. Clock polarity (CPOL) and clock phase (CPHA) are the two
parameters that are used to form four unique modes to provide flexibility in communication
between master and slave.
Everything is going well in SPI. But, why did they create these modes? If you see in I2C, whenever
the clock (SCL) is going low, that time data will be changed, and when the clock (SCL) is
high, that time data will be sampled. Right? Not understood? Okay, refer to the below image.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53
I2C-Inter-Integrated Circuit
It is a synchronous, multi controller or multi target (controlle or target), packet switched, single
ended, serial communication bus invented in 1982 by Philips Semiconductors. It is widely used
for attaching lower speed peripheral ICs to processors and microcontrollers in short distance,
intraboard communication.
Several competitors, such as Siemens, NEC, Texas Instruments, STMicroelectronics,
Motorola, Nordic Semiconductor and Intersil, have introduced compatible I2C products to the
market sincethe mid-1990s.
System Management Bus (SMBus), defined by Intel in 1995, is a subset of I2C, defining a
stricterusage. One purpose of SMBus is to promote robustness and interoperability. Accordingly,
modern I2C systems incorporate some policies and rules from SMBus, sometimes supporting
both I2C and SMBus, requiring only minimal reconfiguration either by commanding or output
pin use.
4.5.2.1Applications
I2C is appropriate for peripherals where simplicity and low manufacturing cost are more important
than speed. Common applications of the I2C bus are:
Describing connectable devices via small ROM configuration tables to enable plug and play
op- eration, such as in serial presence detect (SPD) EEPROMs on dual in-line memory
modules (DIMMs), and Extended Display Identification Data (EDID) for monitors via VGA,
DVI and HDMI connectors.
System management for PC systems via SMBus; SMBus pins are allocated in both
conventionalPCI and PCI Express connectors.
Accessing real-time clocks and NVRAM chips that keep user settings.Accessing low-speed
DACs and ADCs.
Changing backlight, contrast, hue, color balance settings etc in monitors (via Display Data
Chan-nel).
Changing sound volume in intelligent speakers.
Controlling small (e.g. feature phone) LCD or OLED displays. Reading hardware monitors and
diagnostic sensors, e.g. a fan’s speed.Turning on and off the power supply of system
components.
Chapter 4. IoT PHYSICAL DEVICES AND ENDPOINTS 53
Approximately there are around 7.62 billion humans on our planet, but to your surprise, by the year
2022 with an increasing graph of IoT devices, there may be around 20 billion IoT smart
devices up and running with an increase in the demand of 5g network. If an average is made
then after
some years each and every individual in America would be having more than 10 IoT devices of
their own. Please refer this post to more about this statistical data.
Nowadays, the production and usage of the Internet of Things devices are increasing very
rapidly. IoT products and devices basically include laptops, smartphones, smart gadgets, smart
watches, smart and digitalized vehicles and almost all of these are used majorly today.
1. IoT encourages the interaction between devices called as a machine to machine interaction.
2. It provides good automation and control.
3. Integrated with more technical information, so it is better to operate.
4. IoT possesses strong monitoring feature.
5. It saves a lot of time.
6. IoT helps to save more money by reducing manual task and time.
7. Automating daily life tasks makes good monitoring of devices.
8. Increased efficiency and time-saving.
9. With good features make a better quality of life.
Disadvantages
1. Internet of Things devices does not have any international compatibility standard.
2. They may become highly complex resulting in failure.
3. Internet of Things devices may get affected by privacy and security breach.
4. Reduced safety for users.
5. Reduction in the employment of manual tasks thus resulting in job reductions.
6. Internet of Things device may take control of life in due course of time with increasing
AItechnology
Chapter 5
IoT PHYSICAL SERVERS ANDCLOUD OFFERINGS
Course Outcomes
After successful completion of this module, students should be able to:
CO 6 Analyze different cloud storage models and Analyze
protocols that are scalable & available on demand
for designing IoT applications
The Internet of Things (IoT) involves the internet-connected devices we use to perform the
pro- cesses and services that support our way of life. Another component set to help IoT
succeed is cloud computing, which acts as a sort of front end. Cloud computing is an
increasingly popular service that offers several advantages to IOT, and is based on the concept
of allowing users to perform normal computing tasks using services delivered entirely over the
internet. A worker mayneed to finish a major project that must be submitted to a manager, but
perhaps they encounter problems with memory or space constraints on their computing device.
Memory and space con- straints can be minimized if an application is instead hosted on the
internet. The worker can usea cloud computing service to finish their work because the data is
managed remotely by a server.Another example: you have a problem with your mobile device
and you need to reformat it or reinstall the operating system. You can use Google Photos to upload
your photos to internet-based storage. After the reformat or reinstall, you can then either move
the photos back to you device oryou can view the photos on your device from the internet when
you want.
54
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 54
Concept
In truth, cloud computing and IoT are tightly coupled. The growth of IoT and the rapid
develop- ment of associated technologiescreate a widespread connection of —things.||This has
lead to the production of large amounts of data, which needs to be stored, processed and
accessed. Cloud computing as a paradigm for big data storage and analytics. While IoT is
exciting on its own, thereal innovation will come from combining it with cloud computing. The
combination of cloud computing and IoT will enable new monitoring services and powerful
processing of sensory datastreams. For example, sensory data can be uploaded and stored with
cloud computing, later to be used intelligently for smart monitoring and actuation with other
smart devices. Ultimately, the goal is to be able to transform data to insight and drive
productive, cost-effective action fromthose insights. The cloud effectively serves as the brain
to improved decision-making and opti- mized internet-based interactions. However, when IoT
meets cloud, new challenges arise. There is an urgent need for novel network architectures that
seamlessly integrate them. The critical con-cerns during integration are quality of service (QoS)
and quality of experience (QoE), as well as data security, privacy and reliability. The virtual
infrastructure for practical mobile computing and interfacing includes integrating applications,
storage devices, monitoring devices, visualiza-tion platforms, analytics tools and client delivery.
Cloud computing offers a practical utility-based
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 55
model that will enable businesses and users to access applications on demand anytime and
fromany where.
Characteristics
1. First, the cloud computing of IoT is an on-demand self service, meaning its there when you
need it. Cloud computing is a web-based service that can be accessed without any special
assistance or permission from other people; however, you need at minimum some sort of
internet access.
2. Second, the cloud computing of IoT involves broad network access, meaning it offers several
connectivity options. Cloud computing resources can be accessed through a wide variety of
internet-connected devices such as tablets, mobile devices and laptops. This level of
convenience means users can access those resources in a wide variety of manners, even from
older devices. Again, though, this emphasizes the need for network access points.
3. Third, cloud computing allows for resource pooling, meaning information can be shared
with those who know where and how (have permission) to access the resource, anytime and
anywhere. This lends to broader collaboration or closer connections with other users. Froman
IoT perspective, just as we can easily assign an IP address to every ”thing” on theplanet,we can
share the ”address” of the cloud-based protected and stored information with others and pool
resources.
4. Fourth, cloud computing features rapid elasticity, meaning users can readily scale the service to
their needs. You can easily and quickly edit your software setup, add or remove users, increase
storage space, etc. This characteristic will further empower IoT by providing elastic computing
power, storage and networking.
5. Finally, the cloud computing of IoT is a measured service, meaning you get what you pay
for. Providers can easily measure usage statistics such as storage, processing, bandwidth and active
user accounts inside your cloud instance. This pay per use (PPU) model means yourcosts scale
with your usage. In IoT terms, it’s comparable to the ever-growing network of physical objects
that feature an IP address for internet connectivity, and the communicationthat occurs between
these objects and other internet-enabled devices and systems; just likeyour cloud service, the
service rates for that IoT infrastructure may also scale with use.
Deployment models
A community cloud is managed and used by a particular group or organizations that have
sharedinterests, such as specific security requirements or a common mission.
Finally, A hybrid cloud combines two or more distinct private, community or public cloud in-
frastructures such that they remain unique entities but are bound together by standardized or
pro- prietary technology that enables data and application portability. Normally, information
thats not critical is outsourced to the public cloud, while business-critical services and data are
kept withinthe control of the organization.
How APIs work APIs are made up of two related elements. The first is a specification that
describes how information is exchanged between programs, done in the form of a request for
processing and a return of the necessary data. The second is a software interface written to that
specification and published in some way for use. The software that wants to access the features
and capabilities of the API is said to call it, and the software that creates the API is said to
publishit.
Why APIs are important for business The web, software designed exchange information via
the internet and cloud computing have all combined to increase the interest in APIs in general
and services in particular. Software that was once custom-developed for a specific purpose is
nowoften written referencing APIs that provide broadly useful features, reducing development
time and cost and mitigating the risk of errors.APIs have steadily improved software quality
over the last decade, and the growing number of web services exposed through APIs by cloud
providers is also encouraging the creation of cloud-specific applications, internet of things (IoT)
efforts andapps to support mobile devices and users.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 58
Three basic types of APIs
APIs take three basic forms: local, web-like and program-like.
1. Local APIs are the original form, from which the name came. They offer OS or
middleware services to application programs. Microsoft’s .NET APIs, the TAPI (Telephony
API) for voice applications, and database access APIs are examples of the local APIform.
2. Web APIs are designed to represent widely used resources like HTML pages and
are ac- cessed using a simple HTTP protocol. Any web URL activates a web API. Web APIs
are often called REST (representational state transfer) or RESTful because the publisher of
REST inter- faces doesn’t save any data internally between requests. As such, requests from
many users can beintermingled as they would be on the internet.
3. Program APIs are based on remote procedure call (RPC) technology that makes a
remote program component appear to be local to the rest of the software. Service oriented
architecture (SOA) APIs, such as Microsoft’s WS-series of APIs, are program APIs.
Internet-of-Things can benefit from the scalability, performance and pay-as-you-go nature of cloud
computing infrastructures. Indeed, as IoT applications produce large volumes of data and comprise
multiple computational components (e.g., data processing and analytics algorithms), their
integra- tion with cloud computing infrastructures could provide them with opportunities for
cost-effectiveon-demand scaling.
A Small Medium Enterprise (SME) developing an energy management IoT product, targeting
smart homes and smart buildings. By streaming the data of the product (e.g., sensors and WSN
data) into the cloud it can accommodate its growth needs in a scalable and cost effective
fashion.As the SMEs acquires more customers and performs more deployments of its product,
it is able to collect and manage growing volumes of data in a scalable way, thus taking
advantage of a pay-as-you-grow model. Moreover,cloud integration allows the SME to store and
process massivedatasets collected from multiple (rather than a single)deployments.
A smart city can benefit from the cloud-based deployment of its IoT systems and applications.
A city is likely to deploy many IoT applications, such as applications for smart energy
management, smart water management, smart transport management, urban mobility of the
citizens and more. These applications comprise multiple sensors and devices, along with
computational components. Furthermore, they are likely to produce very large data volumes.
Cloud integration enables the city to host these data and applications in a cost-effective way.
Furthermore, the elasticity of the cloud can directly support expansions to these applications,
but also the rapid deployment of newones without major concerns about the provisioning of the
required cloud computing resources.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 59
A cloud computing provider offering pubic cloud services can extend them to the IoT area, through
enabling third-parties to access its infrastructure in order to integrate IoT data and/or computational
components operating over IoT devices. The provider can offer IoT data access and services
ina pay-as-you-fashion, through enabling third-parties to access resources of its infrastructure
and accordingly to charge them in a utility-based fashion.
These motivating examples illustrate the merit and need for converging IoT and cloud
computinginfrastructure. Despite these merits, this convergence has always been challenging
mainly due to the conflicting properties of IoT and cloud infrastructures, in particular, IoT
devices tend to be location specific, resource constrained, expensive (in terms of development/
deployment cost)and generally inflexible (in terms of resource access and availability). On the
other hand, cloud computing resources are typically location independent and inexpensive,
while at the same time providing rapid and flexibly elasticity. In order to alleviate these
incompatibilities, sensors and de-vices are virtualized prior to integrating their data and services
in the cloud, in order to enable theirdistribution across any cloud resources. Furthermore, service
and sensor discovery functionalities are implementing on the cloud in order to enable the
discovery of services and sensors that residein different locations.
Based on these principles the IoT/cloud convergence efforts have started since over a decade
i.e. since they very early days of IoT and cloud computing. Early efforts in the research
community (i.e. during 2005-2009) have focused on streaming sensor and WSN data in a cloud
infrastructure. Since 2007 we have also witnessed the emergence of public IoT clouds,
including commercial efforts. One of the earliest efforts has been the famous Pachube.com
infrastructure (used ex- tensively for radiation detection and production of radiation maps
during earthquakes in Japan). Pachube.com has evolved (following several evolutions and
acquisitions of this infrastructure) toXively.com, which is nowadays one of the most prominent
public IoT clouds. Nevertheless, there are tens of other public IoT clouds as well, such as
ThingsWorx, ThingsSpeak, Sensor-Cloud, Realtime.io and more. The list is certainly non-
exhaustive. These public IoT clouds offer com- mercial pay-as-you-go access to end-users
wishing to deploying IoT applications on the cloud. Most of them come with developer
friendly tools, which enable the development of cloud appli- cations, thus acting like a PaaS for
IoT in the cloud. Similarly to cloud computing infrastructures, IoT/cloud infrastructures and
related services can be classified to the following models:
1. Infrastructure-as-a-Service (IaaS) IoT/Clouds: These services provide the means for ac-
cessing sensors and actuator in the cloud. The associated business model involves the
IoT/Cloudprovide to act either as data or sensor provider. IaaS services for IoT provide access
control to resources as a prerequisite for the offering of related pay-as-you-go services.
PaaS IoT services is that they provide access to data, not to hardware. This is a clear
differentiatorcomparing to IaaS.
3. Software-as-a-Service (SaaS) IoT/Clouds: SaaS IoT services are the ones enabling their
usesto access complete IoT-based software applications through the cloud, on-demand and in a
pay- as-you-go fashion. As soon as sensors and IoT devices are not visible, SaaS IoT
applications resemble very much conventional cloud-based SaaS applications. There are
however cases wherethe IoT dimension is strong and evident, such as applications involving
selection of sensors and combination of data from the selected sensors in an integrated
applications. Several of these ap- plications are commonly called Sensing-as-a- Service, given
that they provide on-demand access to the services of multiple sensors. Note that SaaS IoT
applications are typically built over a PaaS infrastructure and enable utility based business
models involving IoT software and services.
These definitions and examples provide an overview of IoT and cloud convergence and why it
is important and useful. More and more IoT applications are nowadays integrated with the
cloud in order to benefit from its performance, business agility and pay-as-you-go
characteristics. In following chapters of the tutorial, we will present how to maximize the
benefits of the cloud for IoT, through ensuring semantic interoperability of IoT data and services in
the cloud, thus enabling advanced data analytics applications, but also integration of a wide
range of vertical (silo) IoT applications that are nowadays available in areas such as smart
energy, smart transport and smart cities. We will also illustrate the benefits of IoT/cloud
integration for specific areas and segmentsof IoT, such as IoT-based wearable computing.
WAMP
1. Transport: Transport is channel that connects two peers.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 61
2. Session: Session is a conversation between two peers that runs over a transport.
3. Client: Clients are peers that can have one or more roles. In publish-subscribe model client
canhave following roles:
a) Publisher: Publisher publishes events (including payload) to the topic maintained by the broker.
b) Subscriber: Subscriber subscribes to the topics and receives the events including the payload.
1. Dealer: Dealer acts a router and routes RPC calls from the Caller to the Callee and
routes re-sults from Callee toCaller. 2. Application Code: Application code runs on the Clients
(Publisher,Subscriber, Callee or Caller).
Amazon EC2 – Python Example Boto is a Python package that provides interfaces to
AmazonWeb Services (AWS). In this example, a connection to EC2 service is fi rst established
by callingboto.ec2.connect to region. The EC2 region, AWS access key and AWS secret key
are passed to this function. After connecting to EC2 , a new instance is launched using the
conn.run instances function. The AMI- ID, instance type, EC2 key handle and security group
are passed to this function.
AutoScaling Policies: 1. After creating an AutoScaling group, the policies for scaling up and
scaling down are defined. 2. In this example, a scale up policy with adjustment type ChangeIn-
Capacity and scaling ad justment = 1 isdefined. 3. Similarly a scale down policy with
adjustmenttype ChangeInCapacity and scaling ad justment = -1 isdefined.
KEY,
aws secret access key=SECRET KEY) alarm dimensions = ”Auto Scaling Group Name”:
’My-Group’ # Creating scale-up alarm scale up alarm = Metric Alarm( name=’scale up on
cpu’, name
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 63
#!/usr/bin/env python import sys for line in sys.stdin: doc id, content = line.split() words = con-
tent.split() for word in words: print %s%s % (word, doc id) The example shows inverted index
mapper program. The map function reads the data from the standard input (stdin) and splits the
tab-limited data into document- ID and contents of the document. The map function emits key-
value pairs where key is each word in the document and value is the document-ID.
#!/usr/bin/env python import sys current word = None current docids = [] word = None for line
insys.stdin: # remove leading and trailing whitespace line = line.strip()
# parse the input we got from mapper.py word, doc id = line.split()if current word== word:
current docids.append(doc id)
else: if current word: print %s %s %s (current word, current docids) current docids = [] current
docids.append(doc id) current word = word
The example shows inverted index reducer program. The key-value pairs emitted by the map phase
are shuffled to the reducers and grouped by the key. The reducer reads the key-value pairs
groupedby the same key from the standard input (stdin) and creates a list of document-IDs in
which the word occurs. The output of reducer contains key value pairs where key is a unique
word and valueis the list of document-IDs in which the word occurs.
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 64
Django is an open source web application framework for developing web applications in
Python.A web application framework in general is a collection of solutions, packages and best
practices that allows development of web applications and dynamic websites. Django is based on
the Model- Template-View architecture and provides a separation of the data model from the
business rules and the user interface. Django provides a unified API to a database backend.
Thus web appli- cations built with Django can work with different databases without requiring
any code changes. With this flexibility in web application design combined with the powerful
capabilities of the Python language and the Python ecosystem,
Django is best suited for cloud applications. Django consists of an object-relational mapper, a
webtemplating system and a regular-expression based URL dispatcher. Django Architecture
Django is Model-Template-View (MTV) framework.
1. Model: The model acts as a definition of some stored data and handles the interactions with
the database. In a web application, the data can be stored in a relational database, non-
relational database, an XML file, etc. A Django model is a Python class that outlines the
variables and methods for a particular type ofdata. 2. Template: In a typical Django web
application, the template is simply an HTML page with a few extra placeholders. Djangos
template language canbe used to create various forms of text files (XML, email, CSS, Javascript,
CSV,etc.) 3. View :Theview ties the model to the template. The view is where you write the
code that actually generates
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 65
the web pages. View determines what data is to be displayed, retrieves the data from the
databaseand passes the data to the template.
1. Xively is a system for deploying IoT applications on the cloud. It is offered as PaaS. Xively
is basically a data collection, management, and distribution infrastructure. It also provides APIs
to connect and develop IoT applications.
2. Xively comes under the category of Connected Product Management (CPM) platform. Xively
also provides tools to model your connected business. This capability is highly beneficial to
build any IoT based product. Other than that Xively also provides Management as well as
operational tools. Xively can be connected to most of the IoT frameworks and microcon-
trollers in the market to create a ‘smart’ project or product.
3. Xively Python Libraries can also be used to embed python code as per the Xively APIs. A
Xively Web interface is provided to be used for easy implementation of front end interface.
Xively also comes with multiple language and platform support. We can implement HTTP
protocols, APIs, MQTT. This makes the device connectivity a lot easier with Xively cloud.
4. All the devices can be connected to Xively Cloud for real-time processing and archiving to
cloud. IOT application developers can write the frontend for IoT applications as per their
requirements. This helps in convenient management of apps with Xively cloud and other APIs.
Xively is very popular with companies which deal with IoT based device manufac- turing and
development. Companies using Xively can rely on the secure connectivity of devices as well as
the seamless data management capability.
1. Programmers or Developers have to register with Xively to use cloud services. After reg-
istration and account creation, developers can create different devices for which he has to
create an IoT app. It can be easily done using the templates provided in the Web Interface of
Xively.
4. Once this is done permissions on the IoT devices are assigned using the available APIs.
6. One or more bidirectional channels are created after we connect a device with Xively.
9. Xively APIs are used by IoT devices to create communication enabled products.
Case studies illustrating IoT design Case Study in IoT: Home Automation
An IoT software-based approach on the field of Home Automation. Common use-cases include
measuring home conditions, controlling home appliances and controlling home access through
RFID cards as an example and windows through servo locks. However, the main focus of this paper
is to maximize the security of homes through IoT. More specifically, monitoring and
controlling servo door locks, door sensors, surveillance cameras, surveillance car and smoke
detectors, whichhelp ensuring and maximizing safety and security of homes.
A user has the following features through a mobile application in which he/she:
1. can turn on or o LED lights and monitor the state of the LED.
2. can lock and unlock doors through servo motors and monitor if the doors are locked or unlocked.
3. can monitor if the doors are closed or opened through IR sensors.
4. is notified through email if the door is left open for too long.
5. is notified of who entered through the door as the camera captures the face image and send it
tohim/her via email.
6. is notified through email if the re detector detect ssmoke.
7. is able to control the surveillance car from anywhere to monitor his/herhome.
As the field of Home Automation through IoT is a wide application in a very wide and
challengingfield due to the reasons mentioned in the previous paragraphs, I chose to work on
that field as partof this thesis, specifically in maintaining and ensuring security and safety inside
home.
IoT aims in creating a network between objects embedded with sensors, that can store, analyze,
communicate and exchange data together over the internet. This leads to efficient industry,
manu- facturing, efficient energy management, resource management, accurate health care,
smarter busi- ness decisions based on analyzed data, safer driving through smart cars that are
able to communi-cate together, smart home automation and countless more applications.
The system designed for the home automation project presented in this paper needs a control
unit,a computer, to be able to control the different electrical devices connected to it. Raspberry
Pi, is
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 67
a credit-card tiny computer, that can be plugged to a monitor, uses standard keyboard and
mouse,that enables people of different ages learn how to program.
To simplify the publish/subscribe model along with the system architecture used in this Home Au-
tomation project, here is the explanation of the steps of constructing it: Different sensors,
cameras and servo motors were connected to the Raspberry Pi. It was programmed to collect
and publish the data, in the form of JSON string, acquired from these devices to PubNub. Data
is published from the Raspberry Pi by providing it with the ”publish key” and the ”channel
name”. The data issent to the channel provided by PubNub servers, and forwarded by PubNub
to the subscribers ofthis channel.
Illustrates the publish/subscribe model provided by PubNub
Illustrates the system architecture used in this home automation project. The subscriber in
this
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 68
FIGURE 5.4: the system architecture used in this home automation project
scenario, of a user acquiring data and readings by the sensors and monitoring devices, is the
we- b/mobile application. The ”subscription key” and ”channel name” is embedded in the
web/mobileapplication’s code. Allowing it to receive messages forwarded by PubNub. On the
other hand, in a scenario where the user wants to send a command to home appliances,
controlling the LED lights for example, the web/mobile application is the publisher provided by
the ”publish key” andthe ”channel name”.The commend is sent in the form of JSON string to
PubNub servers, while the ”subscription key” and ”channel name” is embedded in the
Raspberry Pi code. This allows theRaspberry Pi to receive any published strings on the channel
it is subscribed to. Upon receiving the JSON string, the Raspberry Pi take the action specified
by that string. This allows full controland monitoring of all devices connected to the Raspberry
Pi by theuser.
Case studies illustrating IoT design Case Study in IoT: Smart Cities
The Internet-of-Things (IoT) is the novel cutting-edge technology which proffers to connect
plethoraof digital devices endowed with several sensing, actuation and computing capabilities
with the In-ternet, thus offers manifold new services in the context of a smart city. The
appealing IoT services and big data analytics are enabling smart city initiatives all over the
world. These services are transforming cities by improving infrastructure, transportation
systems, reduced traffic conges- tion, waste management and the quality of human life. In
this paper, we devise a taxonomy to best bring forth a generic overview of IoT paradigm for
smart cities, integrated information and communication technologies (ICT), network types,
possible opportunities and major requirements. Moreover, an overview of the up-to-date efforts
from standard bodies is presented. Later, we givean overview of existing open source IoT
platforms for realizing smart city applications followed by several exemplary case studies. In
addition, we summarize the latest synergies and initiatives
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 69
worldwide taken to promote IoT in the context of smart cities. Finally, we highlight several
chal- lenges in order to give future research directions. IOT BASED SMART CITY
TAXONOMY
FIGURE 5.5: the system architecture used in this smart city project
This section presents a taxonomy of IoT based smart cities which categorizes the literature on
the basis of existing communication protocols, major service providers, network types,
standardiza- tion efforts, offered services, and crucial requirements.
Communication Protocols
IoT based smart city realization significantly relies on numerous short and wide range communica-
tion protocols to transport data between devices and backend servers. Most prominent short
rangewireless technologies include Zig-Bee, Bluetooth, Wi-Fi, Wireless Metropolitan Area
Network
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 70
(WiMAX) and IEEE 802.11p which are primarily used in smart metering, e-healthcare and
vehic- ular communication. Wide range technologies such as Global System for Mobile
communication (GSM) and GPRS, Long-Term Evolution (LTE), LTE- Advanced are
commonly utilized in ITS such as vehicle-to infrastructure (V2I), mobile e- healthcare, smart
grid and infotainment services. Additionally, LTE-M is considered as an evolution for cellular
IoT (C-IoT). In Release 13, 3GPPplans to further improve coverage, battery lifetime as well as
device complexity [7]. Besides well- known existing protocols, LoRa alliance standardizes the
LoRaWAN protocol to support smart city applications to primarily ensure interoperability
between several operators. Moreover, SIGFOX is an ultra narrowband radio technology with
full star-based infrastructure offers a high scalable global network for realizing smart city
applications with extremely low power consumption. A comparative summary2 of the major
communication protocols.
Service Providers
Pike Research on smart cities estimated this market will grow to hundreds of billion dollars by
2020, with an annual growth of nearly 16 billion. IoT is recognized as a potential source to in-
crease revenue of service providers. Thus, well-known worldwide service providers have
already started exploring this novel cutting-edge communication paradigm. Major service
providers in- clude Telefonica, SK telecom, Nokia, Ericsson, Vodafone, NTT Docomo, Orange,
Telenor groupand ATT which offer variety of services and platforms for smart city applications
such as ITS andlogistics, smart metering, home automation and e-healthcare.
Network Types
IoT based smart city applications rely on numerous network topologies to accomplish a fully
autonomous environment. The capillary IoT networks offer services over a short range. Exam-
ples include wireless local area networks (WLANs), BANs and wireless personal area
networks (WPANs). The application areas include indoor e-healthcare services, home
automation, street lighting. On the other hand, applications such as ITS, mobile e-healthcare and
waste managementuse wide area networks (WANs), metropolitan area networks (MANs),and
mobile communica- tion networks. The above networks pose distinct features in terms of data,
size, coverage, latencyrequirements, and capacity.
The rapid advancements in communication technologies and the explosive growth of Internet
of Things (IoT) have enabled the physical world to invisibly interweave with actuators, sensors,
and other computational elements while maintaining continuous network connectivity. The
continu- ously connected physical world with computational elements forms a smart
environment. A smart environment aims to support and enhance the abilities of its dwellers in
executing their tasks, suchas navigating through unfamiliar space and moving heavy objects for
the elderly, to name a few. Researchers have conducted a number of efforts to use IoT to
facilitate our lives and to investigatethe effect of IoTbased smart environments on human life.
This paper surveys the state-of-the-art
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 71
research efforts to enable the IoT-based smart environments. We categorize and classify the lit-
erature by devising a taxonomy based on communication enablers, network types,
technologies, local area wireless standards, objectives, and characteristics. Moreover, the paper
highlights the unprecedented opportunities brought about by IoT-based smart environments
and their effect on human life. Some reported case studies from different enterprises are also
presented. Finally, we discuss open research challenges for enabling IoT-based smart
environments.
environments. The integration of IoT with a smart environment extends the capabilities of
smart objects by enabling the user to monitor the environment from remote sites. IoT can be
integrated with different smart environments based on the application requirements. The work
on IoT-basedsmart environments can generally be classified into the following areas: a) smart
cities, b) smart homes, c) smart grid, d) smart buildings, e) smart transportation, f) smart
health, and g) smart industry.illustrates the IoT-based smartenvironments.
The taxonomy of the IoT based smart environment. The devised taxonomy is based on the
follow- ing parameters: communication enablers, network types, technologies, wireless
standards, objec-tives, and characteristics
Communication Enablers
Communication enablers refer to wireless technologies used to communicate across the Inter-
net. The key wireless Internet technologies are WiFi, 3G, 4G, and satellite. WiFi is mainly used
in smart homes, smart cities, smart transportation, smart industries, and smart building environ-
ments; whereas, 3G and 4G are mainly used in smart cities and smart grid environments.
Satellites are used in smart transportation, smart cities, and smart grid environments. Table
presents the comparative summary of the communication technologies used in IoT based smart
environments.
Network Types
IoT-based smart environments rely on different types of networks to perform the collaborative
tasks for making the lives of inhabitants more comfortable. The main networks are wireless
local area networks (WLANs), wireless personal area networks (WPANs), wide area networks
(WANs), metropolitan area networks (MANs), and wireless regional area networks (WRANs).
These net- works have different characteristics in terms of size, data transfer, and supported
reach ability.
Technologies
IoT-based smart environments leverage various technologies to form a comfortable and
suitable
Chapter 5. IoT PHYSICAL SERVERS AND CLOUD OFFERINGS 73
ecosystem. These technologies are include sensing, communication, data fusion, emerging
com-puting, and information security. Sensing technologies are commonly used to acquire data
from various locations and transmit it using communication technologies to a central location.
The emerging computing technologies, such as cloud computing and fog computing, deployed
in thecentral location, leverage the data fusion technologies for integrating the data coming from
hetero- geneous resources. In addition, smart environments also use information security
technologies toensure data integrity and user privacy.
Local Area Wireless Standards The commonly used local area wireless standards in IoT-
basedsmart environments are IEEE 802.11, IEEE 802.15.1, and IEEE 802.15.4. These standard
tech- nologies are used inside the smart environment to transfer the collected data among
different de-vices. IEEE 802.11 is used in smart homes, smart buildings, and smart cities. IEEE
802.15.1 and IEEE 802.15.4 have relatively shorter coverage than IEEE 802.11 and are used
mainly in sensorsand other objects deployed in the smartenvironments.
Bibliography
[2] Armentrout, D. R. (1981). An analysis of the behavior of steel liner anchorages. PhD thesis,
University of Tennessee.
[4] Brown, R. H. and Whitlock, A. R. (1983). Strength of anchor bolts in grouted concrete ma-
sonry. Journal of Structural Engineering, 109(6):1362–1374.
[5] Celep, Z. (1988). Rectangular plates resting on tensionless elastic foundation. Journal of
Engineering mechanics, 114(12):2083–2092.
[6] Chakraborty, S. (2006). An experimental study on the beehaviour of steel plate-anchor assem-
bly embedded in concrete under biaxial loading. M.tech thesis, Indian Institute of Technology
Kanpur.
[9] Doghri, I. (1993). Fully implicit integration and consistent tangent modulus in elasto-
plasticity. International Journal for Numerical Methods in Engineering, 36(22):3915–3932.
[10] FEMA (June, 2007). Interim testing protocols for determining the seismic performance char-
acteristics of structural and nonstructural components. Report 461, Federal Emergency Man-
agement Agency.
[11] Furche, J. and Elingehausen, R. (1991). Lateral blow-out failure of headed studs near a free
edge. Anchors in Concrete-Design and Behavior, SP-130.
[12] Kallolil, J. J., Chakrabarti, S. K., and Mishra, R. C. (1998). Experimental investigation of
embedded steel plates in reinforced concrete structures. Engineering structures, 20(1):105–112.
74
Bibliography 75
[13] Krawinkler, H., Zohrei, M., Lashkari-Irvani, B., Cofie, N., and Hadidi-Tamjed, H. (1983).
Recommendations for experimental studies on the seismic behavior of steel components and
materials. Report, Department of Civil and Environmental Engineering, Stanford Unniversity.
[14] Lemaitre, J. and Chaboche, J. L. (1994). Mechanics of Solid Materials. Cambridge Univer-
sity Press.
[15] Maya, S. (2008). An experimental study on the effect of anchor diameter on the behavior of
steel plate-anchor assembly embedded in concrete under biaxial loading. M.tech thesis, Indian
Institute of Technology Kanpur.
[16] Sahu, D. K. (2004). Experimental study on the behavior of steel plate-anchor assembly em-
bedded in concrete under cyclic loading. M.tech thesis, Indian Institute of Technology Kanpur.
[17] Sonkar, V. (2007). An experimental study on the behaviour of steel plate-anchor assembly
embedded in concrete under constant compressive axial load and cyclic shear. M.tech thesis,
Indian Institute of Technology Kanpur.
[18] Thambiratnam, D. P. and Paramasivam, P. (1986). Base plates under axial loads and mo-
ments. Journal of Structural Engineering, 112(5):1166–1181.