Sensors in Iot-1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 73

SENSORS IN INTERNET OF THINGS (IoT)

A PROJECT REPORT

Submitted by

AAKASH T 953020114001

SANJIEV PRASATH S 953020114028

SURESH K 953020114032

JOSEPH DANISH D 953020114304

In partial fulfilment for the award of the degree


of
BACHELOR OF ENGINEERING

IN
MECHANICAL ENGINEERING

ST. MOTHER THERESA ENGINEERING COLLEGE


THOOTHUKUDI – 628 102.

ANNA UNIVERSITY: CHENNAI 600 025.

MAY – 2024
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE

Certified that this project report “SENSORS IN INTERNET OF THINGS


(IoT)” is the bonafide work of “T.AAKASH (953020114001), S.SANJIEV
PRASATH(953020114028), K.SURESH(953020114032), D.JOSEPH
DANISH (953020114304)” Who carried out the project work under our
supervision.

SIGNATURE SIGNATURE

Dr.S. JOE PATRICK GNANARAJ, Dr. C. SUBHARAJ,

HEAD OF THE DEPARTMENT SUPERVISOR

Department of Mechanical Engineering, Department of Mechanical Engineering,

St.Mother Theresa Engineering, St.Mother Theresa Engineering


,College, Vagaikulam. College, Vagaikulam.

Submitted for the Project viva-voce examination held on…………………..

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT

Behind every achievement lies an unfathomable sea of gratitude to


those who actuate it, without them it would never have been into
existence. To them we lay the word of gratitude imprinted with in us.

We wish to express our profound gratitude to our beloved


Chairman Dr. S. CLETUS BABU, for his well-wishing thoughts and
good heart for our welfare.

We are very much thankful to our Director Dr. A. GEORGE


KLINGTON, M.E., (Ph. D), for his guidance and his valuable
suggestions throughout this project.

We are very much thankful to our Principal Dr. J. JASPER


GNANA CHANDRAN, utmost support throughout this project.

We are much indebted to our beloved Head of the


Department Dr. S. JOE PATRICK GNANARAJ, for his dynamic
leadership and management.

We would like to place our sincere thanks to our internal


Guide Dr. C. SUBHARAJ for providing us an opportunity to do this project.

Our special thanks to all the faculty members for their guidance
and inspiring us in all our endeavors. Last but not the least we thank our
parents and our friends for their moral support, constant encouragement
and enormous patience for the timely completion of the project.

iii
ABSTRACT

The Internet of Things (IoT) is defined in many different ways, and it


encompasses many aspects of life from connected homes and cities to connected
cars and roads, roads to devices that track an individual's behavior and use the
data collected for push services. Some mention one trillion Internet connected
devices by 2005 and define mobile phones as the eyes and ears of the applications
connecting all of those connected things. By these internet of things billions
objects can communicate over worldwide over a public, private internet protocol
network in 2010, the number of everyday physical objects and devices connected
to the Internet was around 12.5 billion. Smart cities, Smart cars, Public safety,
Smart Industries and Environmental Protection has been given the high intention
for future protection by IoT Ecosystem. This results in the generation of
enormous amounts of data which have to be stored, processed and presented in a
seamless, efficient, and easily interpretable form Internet of Things (IoT) is a new
revolution of the Internet. Thus Internet of Things (IoT) can be said the expansion
of internet services. It provides a platform for communication between objects
where objects can organize and manage themselves. It makes objects themselves
recognizable. The internet of things allows everyone to be connected anytime and
anywhere. Objects can be communicated between each other by using radio
frequency identification (RFID), wireless sensor network (WSN), Zig bee, etc.
Radio Frequency identification assigns a unique identification to the objects.
RFID technology is used as more secure identification and for tracking/locating
objects, things, and vehicle.

iv
TABLE OF CONTENTS
CHAPTER TITLE PAGE NO
ACKNOWLEDGEMENT Ⅲ
ABSTRACT Ⅳ
TABLE OF CONTENTS ⅴ
1 INTRODUCTION
1.1. IOT 1
1.2. DESIGNING THE CONNECTIVITY 4
MODULE
1.3. ESPRESSIF NODE MCU MODULE V1.0 4
1.4. INTRODUCTION TO ARDUINO 5
PLATFORM AND PROGRAMMING
1.5. SOFTWARE DETAILS 6
2 LITERATURE REVIEW
2.1. BASIC OF INTERNET OF THINGS 10
2.2. HISTORY OF IOT 11
2.3. ARCHITECTURE 12
2.3.1. NETWORK LAYER 12
2.3.2. APPLICATION LAYER 12
2.3.3. PERCEPTION LAYER 12
2.3.4. TRANSPORT LAYER 13
2.3.5. PROCESSING LAYER 13
2.3.6. APPLICATION LAYER 13
2.3.7. BUSINESS LAYER 13
2.4. TECHNOLOGIES 13
2.4.1. RADIO FREQUENCY IDENTIFICATION 14
(RFID)
2.4.2. NEAR FIELD COMMUNICATION (NFC) 15
2.4.3. MACHINE TO MACHINE 16

v
COMMUNICATION (MTOM)
2.4.4. VEHICLE TO VEHICLE 17
COMMUNICATION (VTOV)

3 SYSTEM ARCHITECTURE
3.1. ARDUINO ARCHITECTURE 20
3.2. PROGRAMMING 21
3.3. BASIC FUNCTIONS OF ARDUINO 21
TECHNOLOGY
3.4. IOT SYSTEM FUNCTIONAL VIEW 22
3.5. DATA COLLECTION 22
3.6. DATA PROCESSING 22
3.7. ACTING 23
3.8. IOT SYSTEM: INFRASTRUCTURE 24
OVERVIEW
3.9. DATA ACQUISITION AND EDGE 25
COMPONENTS
3.10. COMMUNICATION LAYER 26
3.11. CLOUD 27
3.12. EDGE NODE FUNCTIONALITY 28
3.13. IOT SYSTEM CLOUD COMPONENTS 29
3.14. CONTROL PLANE: SECURITY AND 30
MANAGEMENT
3.15. IOT SYSTEM SECURITY 30
3.16. IOT SYSTEM MANAGEMENT 32
3.17. IMPLEMENTATION CONSIDERATIONS 33
3.18. STRUCTURE OF IOT INFORMATION 34
MODEL

vi
3.19. OBJECT TYPE 35
3.20. PROPERTIES, ATTRIBUTES 35
3.21. INTERACTIONS 36
3.22. LINKS 36
3.23. METADATA HANDLING 37
4 HARDWARE IMPLEMENTATION
4.1. CREATING THE PROJECT IN BLYNK APP 38
4.2. CODE ANALYSIS AND FINAL 39
CONNECTION
4.3. HARDWARE DETAILS 39
4.4. CONTROL WITH BLYNK APP 40
4.5. LED BLINKING 40
4.6. LED PATTERN WITH PUSH BUTTON 41
CONTROL ARDUINO
4.7. DISPLAYING HELLO WORLD MESSAGE 42
IN LCD
4.8. RC SERVO POSITION CONTROL 43
4.9. TEMPERATURE MEASUREMENT USING 44
LM35 THERMISTOR IC
4.10. DISTANCE MEASUREMENT USING 45
ULTRASONIC SENSOR
4.11. IR SENSOR ANALOG INPUT WITH 46
ARDUINO
4.12. EXPLORE DIFFERENT COMMUNICATION 47
METHODS WITH IOT DEVICE

5 MACHINE TO MACHINE COMMUNICATION


5.1. M2M COMMUNICATION 49
5.2. M2M ECOSYSTEM 49

vii
5.3. M2M DEVICE PLATFORM 50
5.4. M2M USER PLATFORM 51
5.5. M2M APPLICATION PLATFORM 51
5.6. M2M ACCESS PLATFORM 52
5.7. INTEROPERABILITY IN INTERNET OF 52
THINGS
5.8. NEED OF INTEROPERABILITY 52
5.9. TYPES OF INTEROPERABILITY 53
5.10. SYNTACTIC INTEROPERABILITY FOR 54
DEVICE INTERACTION
5.11. SEMANTIC INTEROPERABILITY FOR 54
DEVICE INTERACTION
5.12. DEVICE INTEROPERABILITY 54
5.13. APPLICATIONS OF M2M 55
5.14. KEY FEATURES OF M2M 56
COMMUNICATION
5.15. TECHNICAL ASPECTS OF M2M 57
COMMUNICATION
5.16. CASE STUDIES AND REAL-WORLD 58
EXAMPLES

6 CONCLUSION 61

viii
LIST OF FIGURES

FIGURE NO TITLE PAGE NO


1.1 IOT CONNECTION 3
1.2 NODE MCU 4
1.3 NODE MCU CONNECTION 5
1.4 ARDUINO PLATFORM 5
1.5 ARDUINO IDE 6
1.6 PROGRAMMING STRUCTURE 6
1.7 EDIT 7
1.8 SKETCH 7
1.9 TOOLS 8
1.10 HELP 8
1.11 COMPILE 9
1.12 PROGRAM 9
2.1 BASIC OF INTERNET OF THINGS 10
2.2 LAYER ARCHITECHTURE 12
2.3 IOT APPLICATIONS 18

3.1 ARDUINO BOARD 19


3.2 ARDUINO ARCHITECTURE 20
DIAGRAM
3.3 PROGRAMMING 21
3.4 MAJOR IOT SYSTEM COMPONENTS 25
3.5 IOT CLOUD COMPONENTS 29
4.1 ARDUINO PLATFORM 39
4.2 LED SYMBOL 41

ix
4.3 LED PATTERN 41
4.4 PUSH BUTTON 42
4.5 DISPLAY OUTPUT 43
4.6 RC SERVO CONTROL 43
4.7 TEMPERATURE SENSOR 44
4.8 ULTRASONIC SENSOR 45
4.9 INFRARED SENSOR 46
4.10 WI-FI COMMUNICATION 47
4.11 WI-FI WITH BLUETOOTH MODULE 48
5.1 M2M SERVICE PLATFORM 50

x
CHAPTER 1

INTRODUCTION

1.1. IOT
Today the Internet has become ubiquitous, has touched almost every
corner of the globe, and is affecting human life in unimaginable ways.
• We are now entering an era of even more pervasive connectivity where
a very wide variety of appliances will be connected to the web.
• One year after the past edition of the Cluster book 2012 it can be clearly
stated that the Internet of Things (IoT) has reached many different players and
gained further recognition. Out of the potential Internet of Things application
areas, Smart Cities (and regions), Smart Car and mobility, Smart Home and
assisted living, Smart Industries, Public safety, Energy & environmental
protection, Agriculture and Tourism as part of a future IoT Ecosystem have
acquired high attention.

We are entering an era of the “Internet of Things” (abbreviated as IoT).


There are 2 definitions:
First one is defined by Vermesan and second by Pena-Lopez

1. The Internet of Things as simply an interaction between the physical and digital
worlds. The digital world interacts with the physical world using a plethora of
sensors and actuators.

1
2. Another is the Internet of Things is defined as a paradigm in which computing
and networking capabilities are embedded in any kind of conceivable object.

• We use these capabilities to query the state of the object and to change its state
if possible.
• In common parlance, the Internet of Things refers to a new kind of world where
almost all the devices and appliances that we use are connected to a network.
• We can use them collaboratively to achieve complex tasks that require a high
degree of intelligence.
• For this intelligence and interconnection, IoT devices are equipped with
embedded sensors, actuators, processors, and transceivers.
• IoT is not a single technology; rather it is an agglomeration of various
technologies that work together in tandem.
• Sensors and actuators are devices, which help in interacting with the physical
environment.
• The data collected by the sensors has to be stored and processed intelligently in
order to derive useful inferences from it.
• Note that we broadly define the term sensor; a mobile phone or even a
microwave oven can count as a sensor as long as it provides inputs about its
current state (internal state + environment).
• An actuator is a device that is used to effect a change in the environment such
as the temperature controller of an air conditioner.
• The storage and processing capabilities of an IoT object are also restricted by
the resources available, which are often very constrained due to limitations of
size, energy, power, and computational capability.
• As a results the main research challenge is to ensure that we get the right kind
of data at the desired level of accuracy.

2
The Internet of Things (IoT) is no longer a technology of the future.
Smart cities, connected industries and smart households have indeed ushered in
an era where machines can communicate. The beauty of this technology lies in
the fact that the complex backend structure of systems is represented to the end-
user in the simplest possible form. This requires profound design know-how.

The IoT can be designed at different scales for different uses. It can start
from our homes with simple lighting or appliance control, and expand into the
realm of factories and industries with automated machines and central
management systems—called connected factories. It has scaled up to entire cities
with smart parking, smart metering, waste management, fire control, traffic
management and any similar functions involved.

Figure 1.1 IOT Connection


The IoT architecture is multi-layered with delicate components intricately
connected to each other. It starts with sensors, which are the source of data being
collected. Sensors pass data onto an adjacent edge device, which converts data
into readable digital values and stores these temporarily. When the edge senses a
suitable wireless network or the Internet, it pushes the locally stored data to a
cloud server involved in the application.

3
1.2. DESIGNING THE CONNECTIVITY MODULE

The ESP8266 is a system on a chip (SOC) Wi-Fi microchip for Internet


of Things (IoT) applications produced by Express if Systems.

The ESP8266 module enables microcontrollers to connect to 2.4 GHz


Wi-Fi, using IEEE 802.11 bgn. It can be used with ESP-AT firmware to provide
Wi-Fi connectivity to external host MCUs, or it can be used as a self-sufficient
MCU by running an RTOS-based SDK. The module has a full TCP/IP stack and
provides the ability for data processing, reads and controls of GPIOs.

Figure 1.2 Node MCU


1.3. ESPRESSIF NODE MCU MODULE V1.0
This board has the ESP-12E module and comes with 4 Mb bits of flash
and features a row of pins on each side of the breadboard. The board comes with
four communication interfaces: SPI, I2C, UART, and I2S, with 16 GPIO and one
ADC. The RAM is 160KB, divided into 64KB for instruction and 96KB for data.

4
Figure 1.3 Node MCU Connection

1.4. INTRODUCTION TO ARDUINO PLATFORM AND


PROGRAMMING

Figure 1.4 Arduino platform

5
It is cheap
➢ It comes with an open supply hardware feature that permits users to
develop their own kit
➢ The software of the Arduino is well-suited with all kinds of in operation
systems like Linux, Windows, and Macintosh, etc.
➢ For beginners also it is very simple to use.

1.5. SOFTWARE DETAILS


ARDUINO IDE

Figure 1.5 Arduino ide

PROGRAMMING STRUCTURE

Figure 1.6 Programming Structure

6
EDIT

Figure 1.7 Edit

SKETCH

Figure 1.8 Sketch

7
TOOLS

Figure 1.9 Tools

HELP

Figure 1.10 Help

8
COMPILE & UPLOAD PROGRAMS

Figure 1.11 Compile

Figure 1.12 Program

9
CHAPTER 2

2. LITERATURE REVIEW
2.1. BASIC OF INTERNET OF THINGS
Internet of Things can be defined as the collection of two terms: one is
Internet, which is defined as networks of networks which can connect billions
of users with some standard internet protocols. Internet connect several
different sectors and department while using different technologies. Several
devices like mobile, personal systems and business organizations are
connected to Internet. The second term is Thing, this term is basically mean to
these devices or objects which turn into intelligent objects. More over this it is
also a part of all objects of this real world. If we want to define IOT then we
cannot define it precisely and concisely but Vermes an et al. The digital world
interacts with the physical world using a plethora of sensors and actuators.

Figure 2.1 BASIC OF INTERNET OF THINGS

10
IoT can also be defined as “An open and comprehensive network of intelligent
objects that have the capacity to auto-organize, share information, data and
resources, reacting and acting in face of situations and changes in the
environment.
2.2. HISTORY OF IOT

The IoT domain leads to world of technology and communication to a


new era where objects can communicate, compute and transform the information
as per the requirements. This scenario of communication has already been started
but didn’t get recognition. The term Internet of Things was coined by Kevin
Auston, the Executive Director of Auto-ID Labs in MIT in 1999.
The concept of IoT first became very popular through the Auto-ID centre
in 2003 and in related market analytics and its publications.

YEAR INDUCTRIAL PARTICIPATION & INVOLVEMENT

2000 LG announced its first Internet of refrigerator plans

2003 RFID is deployed in US Dept of Defence


2005 UN’s International Telecommunications Union (ITU) published
its first report on the Internet of Things
2008 Recognition by the EU and the First European IoT conference is held.
A group of companies launched the IPSO Alliance to promote the use
of IP in networks of “Smart Objects” and to enable the Internet of
Things. The FCC voted 5-0 to approve opening the use of the ‘white
space’ spectrum
2009 The IoT was born according to Cisco’s
Business Solutions Group
2010 Chinese Premier Wen Jiabao calls the IoT a key industry for China
and has plans to make major investments in Internet of Things

HISTORY OF INTERNET OF THINGS

11
2.3. ARCHITECTURE
Implementation of IoT concept is basically depends on its architecture.
In the initial phase of research 3 layers architecture was introduced, which have
three layers the perception, network and application layers.

Figure 2.2 LAYER ARCHITECHTURE

2.3.1. NETWORK LAYER

Network layer is the middle one, it establishes an interface link between


application layer and perceptual layer. It is responsible for the initial processing
of data, broadcasting of data and connecting devices.

2.3.2. APPLICATION LAYER

Application layer is the implementation of IoT. The working of sensors


and actuators is achieved by application layer. We can understand it as software
which works on and for the sensors other virtually intelligent objects.

2.3.3. PERCEPTION LAYER


Works in a similar manner as previously described in the 3 layers
architecture. It is used to take information from the sensors and implement it.

12
2.3.4. TRANSPORT LAYER
Takes the data from the perception layer and pass this data to the next
layer which is processing layer and vice versa. This will done with the help of
networks like LAN, wireless technology, 3G, 4G, LTE, RFID etc.

2.3.5. PROCESSING LAYER


Which is third layer has to perform the major task because it will
process all the information gathered by the perception layer. There is a huge
amount of data which will be stored with the help of some techniques like
cloud computing or any DBMS. Then it will analyse how to fetch data
whenever required in order to complete the desired task.

2.3.6. APPLICATION LAYER


The next layer which implements the working of IoT. For this an
application is required with the corresponding device in order to complete the
desired task.

2.3.7. BUSINESS LAYER


The last layer of this architecture which manages the working of entire
system along with many other features, one of them is privacy.
Both the architectures are defining the working of IoT system of
different types but they all are following the same sort of working in order to
achieve its goal.

2.4. TECHNOLOGIES

There are various technologies which are used to define IOT, but the four main
technologies are as follows:

13
1. Radio Frequency Identification (RFID)
2. Near Field Communication (NFC)
3. Machine to Machine Communication (MtoM)
4. Vehicle to Vehicle Communication (VtoV)

2.4.1. RADIO FREQUENCY IDENTIFICATION (RFID)


RFID is a system in which there is a reader to read many tags. It uses the
technology of radio waves to send the information of an object in the form of
serial number which is attached to the tag. It uses the electromagnetic fields to
transfer the data on the tags so that it can automatically identify and track the
objects, corresponding to a particular tag. As we already mention that RFID
technology is based on reader and tags, so in the initial phase of research RFID
defines in three configurations.
• Active RFID
• Passive RFID
• Active Reader Active Tag

APPLICATION

RFID has a very limited use only for identification and tracking. As
we know that it works on frequency and within a limited range. So it can work
for such applications like smart grocery, smart cabinet, smart fridge, smart
appliances, smart currency etc. In these scenarios there is a tag on product and
a reader to scan the tag. In a grocery shop we put tags on the products and
when the product passes through that reader, the reader will catch it.

ISSUES
There are several issues with RFID. It works on specific range of
frequencies; if these frequencies differ at different places then it will create a

14
problem in reading a tag at different locations. It is also difficult to read more
than one tag simultaneously. There are methods to overcome this problem but
very costly. Tags have to be implemented on the product and all the tags are
different and unique, which includes some cost. The inclusion of cost is not
comfortable all the time when comparing and concerning with the cost of
product.

2.4.2. NEAR FIELD COMMUNICATION (NFC)


Near Field Communication is somehow little bit similar to RFID, it
combines a RFID reader in a mobile phone, which makes it better, reliable
and efficient for the users. Near Field Communication is a short-range
wireless technology with the frequency of 13.56 MHz, typically work for very
small distance up to 4 cm. Allows intuitive initialization of wireless networks
and NFC is complementary to Bluetooth and 802.11 with their long-distance
capabilities at a distance circa up to 10 cm. It is first developed by Philips and
Sony companies. Data exchange was approximately 424 kbps. Power
consumption during data reading in NFC is under 15m. There are two modes
in NFC technology:
• Active
• Passive
APPLICATION
NFC works in a very short range so the devices must be kept nearby.
It has several applications, the most important one is Payment App. Today,
we have several applications (apps) by which one can pay without using a
card, in this scenario the device works as a virtual card and the transaction will
take place. One can exchange their business card with the help of their devices.
They just touch their devices and their business cards will be exchanged.

15
ISSUES
These devices will work on a very small range, so this is one of the major
issues. Two devices of two different manufacturers can create some
compatibility issue in their communication. Due to this reason a monopoly may
exist in market.

2.4.3. MACHINE TO MACHINE COMMUNICATION (MTOM)


Machine-to-Machine (M2M) refers to the communications between
computers, embedded processors, smart sensors, actuators and mobile devices
(DYE, 2008). The use of M2M communication is increasing in the scenario at a
fast pace. For instance, researchers predicted that, by 2014, there will be 1.5
billion wirelessly connected devices excluding mobile phones. Now a days, there
are approx 2 billion wirelessly connected devices which can gather information
from the sensors, analyse this data and send the information to other devices to
perform some tasks. Machine receives the information and perform the operation
with the help of actuators, sensors, embedded processors and application
software.
APPLICATION
In industrial work, a machine can sense the work efficiency of the
machine and work accordingly for maximum output. Smart homes where objects
can communicate with each other like when there is no one in the home and
unfortunately the owner forgot to lock the home then smart home will sense that
there is no motion in the home and it will lock the home and send the unlock
key to the owner. The same application is smart water supply, if there is a leakage
then the machine sensor will sense this and send the information to the server. It
will help to stop the wastage of water.

16
2.4.4. VEHICLE TO VEHICLE COMMUNICATION (VTOV)

In this technology the objects are vehicles, which can communicate with
another vehicle or the sensors around them. the main aspect of concern here is,
there is no proper method to define the protocols because the object is moving
and communicating with another moving object or with the sensors on the
roadside. so we are not able to define any routing protocol. this communication
can work for a long distance and make an efficient communication among
objects. this technology was designed primarily with the aims of traffic control,
safety and accident avoidance.

APPLICATION
Smart cars are the application of m2m, a car which is driverless or a car
which have sensors and sense the speed of the nearby car who is getting slow
uncertainly. so the car can also be slow down to avoid accident.

ISSUES
The main concern of v2v is the loss of connectivity when any other object
comes in between the communicating devices. if they are not in a proper distance
and proper line of sight then they will not be able to continue in connected state.

17
Figure 2.3 IOT Applications

Internet of Things depends on Internet, sensors technology which makes


the communication possible among devices by implementing different
protocols.

After doing the literature survey some major issues are observed, like
the interrupted connectivity among devices effecting the communication. Also
there is compatibility issue in devices.

18
CHAPTER 3

3. SYSTEM ARCHITECTURE

Figure 3.1 ARDUINO BOARD


It is cheap
➢ It comes with an open supply hardware feature that permits users to
develop their own kit
➢ The software of the Arduino is well-suited with all kinds of in operation
systems like Linux, Windows, and Macintosh, etc.

19
Arduino board is a one type of micro controller based kit. The first Arduino
technology was developed in the year 2005 by David and Massimo Banzi. The
designers thought to provide easy and low cost board for students, hobbyists and
professionals to build devices. But, 7lakhs boards were in user’s hands in the year
2013. Arduino technology is used in many operating devices like communication
or controlling.
The pin configuration of the Arduino Uno board is shown in the above.
It consists of 14-digital pins. Wherein 6 pins are used as pulse width modulation
and 6, a USB connection, a power jack, a 16MHz crystal oscillator, a reset button,
and an ICSP header. Arduino board can be powered either from the personal
computer through a USB or external source like a battery or an adaptor.
3.1. ARDUINO ARCHITECTURE

Figure 3.2 Arduino Architecture Diagram


Basically, the processor of the Arduino board uses the Harvard
architecture where the program code and program data have separate memory. It
consists of two memories such as program memory and data memory. Wherein
the data is stored in data memory and the code is stored in the flash program
memory. The Atmega328 microcontroller has 32kb of flash memory, 2kb of
SRAM 1kb of EPROM and operates with a 16MHz clock speed.

20
3.2. PROGRAMMING

Figure 3.3 Programming


The main advantage of the Arduino technology is, you can directly load
the programs into the device without the need of a hardware programmer to burn
the program. This is done because of the presence of the 0.5KB of boot loader,
that allows the program to be dumped into the circuit. And additionally it
comprises of a text editor (employed to write the code), a message space (displays
the feedback) like showing the errors, the text console, that displays the o/p & a
series of menus just like the file, tool menu & edit.
3.3. BASIC FUNCTIONS OF ARDUINO TECHNOLOGY

➢ Digital read pin reads the digital value of the given pin.
➢ Digital write pin is used to write the digital value of the given pin.
➢ Pin mode pin is used to set the pin to I/O mode.
➢ Analog read pin reads and returns the value.
➢ Analog write pin writes the value of the pin.
➢ Serial. Begins pin sets the beginning of serial communication by
setting the rate of bit.

21
3.4. IOT SYSTEM FUNCTIONAL VIEW
The primary purpose of an IoT system is to collect real-world status data
and make them available to services and applications that create insights and act
upon them by affecting the physical system under observation in some way.
Implementation of those functions requires an infrastructure to run them and
control functions to keep the IoT system secure and operational.
It highlights three key steps in IoT data and control flows (1) data
collection, (2) processing, and (3) acting upon the world based on the outcomes.
Collected data quantify the state of the physical world and various types of
processing provide insights and determine the nature of actions to be undertaken
when appropriate.
This general description is applicable to almost any automated control
system. Some of the differences made possible by IoT systems include the broad
scope and variety of potential data sources, global reach by virtue of Internet
connectivity.

3.5. DATA COLLECTION


Data collection starts at the edge, with a sensor acting as a physical-cyber
interface that monitors and reports states of some physical entity or device. This
implies the existence of real-world instrumentation via sensors and an
implementation of appropriate control points via actuators. This process may
involve many implementation details, such as signal conditioning, analog-to-
digital conversion, scaling and conversion to engineering units.
From the IoT system functional point of view, data collection produces
digitized state samples of the physical world suitable for processing by the
applications and services in the cyber domain.
3.6. DATA PROCESSING
Collected data may be processed as they arrive, stored for subsequent
reference and analysis, or both. Depending on the age (time stamp) of data

22
retrieved by an application, they are often referred to as data in motion and data
at rest. Data-acquisition modules usually perform the preliminary analysis and
filtering to determine what to do with each particular data item or stream. Based
on data values, source and system processing rules in effect, data may be routed
directly to applications, stored, or discarded.

Common data pre-processing steps may include filtering such as


comparison against configured thresholds to detect if the sampled data is in a
special condition that warrants additional action, such as creation of an event or
notification.

Various forms of data processing may be implemented in increments or in


entirety in different components of IoT systems. In general, their scope and
complexity tend to increase in higher levels of system hierarchy, where more
processing, power, storage and larger aggregations of data are available. Types
of processing range from simple control-loop algorithms performed on incoming
streaming data as they arrive, to sophisticated forms of analytics and machine-
learning algorithms that operate on combinations of streaming and archived data,
events, and records of past behaviors and observations of the system.

3.7. ACTING
Acting upon insights and predictions is the output and the ultimate
purpose of deploying IoT systems. Actions can take different forms, from the
simple remote actuation operator commands in response to status indications on
the system dashboard, to automated guidance of control points that proactively
manages conditions in a smart building in a manner that maximizes user comfort
and optimizes energy efficiency. Actions can be implemented as direct actuation
or indirectly, in the form of advice to system operators or optimizations resulting
in adjustments to operational settings of the system, such as a building or a

23
manufacturing process. They can also include identification of causes of failures
and anomalous conditions followed by direct or indirect execution of the
appropriate remediation actions. Insights and resulting actions can operate in
rather complex systems and domains such as smart buildings that can have tens
of thousands of sensor and actuation points. With the addition of interoperable
data formats and Internet connectivity, the scope of data aggregation in IoT
systems can grow to potentially any level - from a single-building domain to
multi-domain systems such as smart cities and regions. In theory, one could
aggregate behavioral and energy efficiency data from all IoT managed buildings
in a large region and use it to improve AI and train ML algorithms for their
optimization. In turn, those results could be applied to a vast range of buildings or
even globally, and continuously improved with influx of new data and analysis
of the results of previous actions.

3.8. IOT SYSTEM: INFRASTRUCTURE OVERVIEW


This section provides an overview of IoT system infrastructure - data
processing, storage, and communication components that host and execute its
functions outlined in the previous section – data collection, processing, and
action. This document focuses on the core IoT system components involved in
gathering, pre-processing and storing of data for use by applications and services
that generate insights. Their simplified view is presented. Core IoT functions at
the edge and in the cloud are described in detail in later sections. They interface
to and feed the (usually cloud based) IoT applications and services that generate
insights,They can be combined with other business systems to provide holistic
insights and generate actions that optimize business objectives or whatever the
intended purpose of the IoT system may be.

24
Figure 3.4 Major IoT System Components
Large IoT installations can be complex distributed systems with a variety of
components and multiple levels of hierarchy.
A more detailed structural and hierarchical view of an IoT system and
some of its key components is depicted in Figure. Edge components are depicted
towards the bottom, communications layer mostly in the middle, and upper levels
of system hierarchy ending with the cloud are shown on top.
Three major activities that need to be mapped to the infrastructure of an IoT
system may be summarized as:
➢ Data acquisition: conversion to digital and pre-processing
➢ Communication: data and metadata serialization and transport
➢ Data processing, storage, and aggregation: repeated at multiple stages in the
system hierarchy, progressively increasing scale
Edge components include sensors, smart things, gateways and fog nodes. The
communication layer provides connectivity among system components that they
can use for horizontal peer-to-peer interactions within a level of system hierarchy
or for cross-level communication towards the Internet and the cloud.

3.9. DATA ACQUISITION AND EDGE COMPONENTS


Depiction of the edge layer in Figure includes several types of nodes,
such as smart things and gateways, in some typical configurations. It shows a
smart thing with a sensor and actuator that connects directly to the cloud via
Internet, and several other nodes attached to the communications layer.
Gateways are edge devices in IoT systems to which one or more basic

25
sensors are connected and dependent upon for wide-area connectivity and
optional additional services. Their basic role, as the name implies, is to provide
connectivity between locally connected sensors and the Internet.

Gateways can reside in physical structures, such as a building, where an


Internet access point may be available and the gateway can be connected simply
via a LAN connection. If a gateway is not near a usable existing Internet access
point, depending on the distance to such a point, it may provide a medium-range
link, such as LoRa, or a wide-area link to the Internet, via a private wide-area
network or a telephone company link such as LTE or NB-IoT.

3.10. COMMUNICATION LAYER


In IoT systems, the communications layer may include a variety of
wireless and wired links, spanning local areas and including long-haul
connections, such as wide-area networks and telco IoT variants. It may represent
a complex infrastructure of links, bridges and routers that can transport payloads
from local point-to-point segments all the way to any endpoint and application on
the Internet. In addition to hardware, this requires implementation of a number of
network layers and protocols which in IoT systems are commonly based on the
Internet layered network design blueprint.

The communications layer enables a vast array of edge devices and


things to exchange messages with each other, the rest of the IoT system, and
ultimately the Internet. At the edge and in specific domains, such as the industrial
control, some proprietary and non-Internet compatible protocols may be used to
connect nodes. However, to qualify as IoT, at some point in the system a
transition to Internet compatible connectivity and protocols needs to be made in
both directions, so that functional exchange of messages can take place with the
authorized endpoints anywhere on the Internet.

26
In practice, communication is carried at the behest of software agents
that implement the relevant functions and services at the sending and the receiving
party. If both parties reside on the same network or are at the comparable levels
in system hierarchy, this communication is referred to as peer-to-peer (P2P). P2P
communications are sometimes also referred to as machine-to-machine (M2M)
communications. In general, all communications between IoT devices themselves
as well as with the applications and services are of the M2M type, so we use the
term P2P to depict peer level communications, which are shown as horizontal
paths in Figure 3, as opposed to the edge to cloud which would follow the more
vertical paths.

3.11. CLOUD
IoT data from multiple end points, gateways, and even domains are
aggregated in the cloud and funneled to the system-wide applications and
services. Streaming and archived data are made available to authorized
applications and services via APIs and queries. Cloud implementations generally
provide the top-end data aggregations, and the server, storage and connectivity
infrastructure to execute services and applications that use them.
IoT data coming to the cloud may be processed in-flight as they arrive, stored for
subsequent processing, or both. System-level rules and policies in effect
determine how individual data should be processed.
The cloud portion of an IoT system also provides integration and
interfacing opportunity with other enterprise systems, such as Online Transaction
Processing (OLTP) systems for commerce and billing, Enterprise Resource
Planning (ERP) systems for holistic business insights and management, and
Customer Relationship Management (CRM) systems for customer support.
Highlights two important interface layers in an IoT system, notably the
data and metadata APIs between the edge components and the cloud, and the
data-retrieval APIs for live streams and stored data used by the applications and

27
services executing in the cloud. In general, APIs should enable applications to
query, search, and access data and metadata of interest, as well as issue actuation
commands. Formalizing the types of interactions and data formats that they
support is not only a good design practice, it also provides the foundation for
modularity and interoperability in the implementation of IoT systems.
3.12. EDGE NODE FUNCTIONALITY
IoT edge node and thing implementations provide a wide spectrum of
functionality, from the minimalistic data acquisition and transfer in integrated
sensors, to sophisticated data processing, storage and analytics in high-end
gateways and fog nodes. To simplify the exposition, we describe edge functions
using IoT gateway as the representative node and description vehicle given that
it can embody all of those functions and perform them on behalf of multiple
endpoints in its care.
An IoT gateway links sensors and things at the edge with higher levels of
system processing hierarchy and the cloud. It is commonly a point where Internet
connectivity is achieved. The gateway is also a security boundary between things
with varying levels of security and the secured IoT processing IT infrastructure.
By virtue of its placement and function, an IoT gateway can also be an interface
and a boundary between production- and process-level Operational Technology
(OT), such as PLCs, and the IoT Information Technology (IT) part where most of
the advanced data processing and storage takes place.
As its name implies, the basic and traditional function of an IoT gateway
is to act as a communications bridge between sensors and actuators at one end
and the Internet and cloud on the other. This requires incorporation of appropriate
hardware interfaces and processing logic for sensor data acquisition and actuation
as well as protocol-converter engines for “south” side wired or wireless
communication links that it may support. On the “north” side, it means hardware
interfaces for the types of uplinks that are supported, ranging from Wi-Fi and
Ethernet to long-haul communications such as telco lines with the appropriate

28
modem circuitry. Uplink communication is usually Internet compatible at some
point, so gateways and smart things need to include the appropriate protocol
stacks for TCP/IP and HTTP often with support for transport-layer security, TLS.

Common data-plane functions of a complete functional edge node, such as a


gateway or a smart thing, may be categorized as:
➢ Core functions: data acquisition, transmission and actuation
➢ Optional functions: data storage, event & alert processing, control (automation)
➢ Advanced functions: analytics
In addition, the gateways often host local agents to support a system wide
implementation of control-plane functions, including security.
In the sections that follow we describe major data-plane functions of edge IoT
components.

3.13. IOT SYSTEM CLOUD COMPONENTS

Figure 3.5 IoT Cloud Components

29
This section describes cloud components that provide the IoT system
functionality. They can operate in public or private clouds as an overlay over
the “standard” cloud services such as virtualized compute and storage. This
section covers core IoT functions involved in managing and processing data
and control flows between the edge on one end and their delivery to cloud
services and applications on the other end. Operational details of cloud
applications and services - such as analytics, AI, and visualization – are not
covered as they are beyond the scope of this document.

IoT-specific core cloud components include:

➢ Edge Interface and Data Ingestion


➢ Time-Series Stream Processing
➢ Data Aggregation and Storage
➢ Security and Management

3.14. CONTROL PLANE: SECURITY AND MANAGEMENT


The control plane in IoT systems consists mainly of security and
management components and functions. It is in charge of keeping the data-
plane part up and running securely to fulfil the overall system mission.

3.15. IOT SYSTEM SECURITY

IoT systems have some unique characteristics and security


requirements that influence the selection of appropriate techniques and
policies to deal with them. In terms of exposure, unlike most traditional IT
systems, When compromised, IoT systems can endanger the safety of
people, environment, and production equipment. In terms of topology,
portions of IoT systems can reside in physically unprotected environments
where they may be subject to tampering, eavesdropping, and spoofing.

30
Otherwise, like in any other complex IT system, security needs to
be designed to maintain system confidentiality, integrity, and availability [9].
An IoT system security design usually starts with risk assessment and threat
analysis that determine the levels and influence the type of techniques and
methods to be implemented for its defense. Security design and
implementation includes both static (built in) and dynamic (operational at
runtime) components and activities.

A useful design technique in IoT systems is to deploy network


segmentation. In this way, different protection levels can be implemented at
different parts of the network, added security checks can be deployed when
crossing segment boundaries – such as between the edge and the cloud – and
parts of the network can be disconnected to isolate compromised nodes when
the system is under attack. While more of an operational than an
architectural concern, it is generally a good practice to deploy defensive
postures commensurate with the essentially closed nature of IoT systems to
reduce their attack surfaces. These can include preference for certificate-based
node authentication, coupled with disabling or disallowing password logins.
Points of vulnerability, such as remote access, unsafe protocols like ftp, and
even local shell should be blocked or removed. Communication should be
directed only to a limited and well-known set of authorized system nodes and
services and unsolicited connection requests should be blocked.

The security management console combines the information


obtained from nodes and their network neighbors and model predictions, and
optionally global Internet monitoring sources, to detect breaches in real time
and take the appropriate remedial actions when they occur. These actions
need to be previously defined and designed as incident handling procedures
that the operators can refer to when incidents are detected.

31
3.16. IOT SYSTEM MANAGEMENT
The management portion of the control plane is basically in charge of
shepherding an IoT system by keeping its components functional and their
software and firmware up to date. The management system is typically
implemented as a collection of individual management agents installed on
system nodes that communicate with the central management console. Its
primary functions are: (1) provisioning of nodes, (2) registration and
discovery, (3) firmware and software updates, (4) monitoring and
management.
One of the key management system functions is to maintain a registry of
system nodes. A registry can be a form of database that identifies the known and
therefore authorized nodes. It can also perform additional services, such as act as
a directory for node discovery, and to provide storage of node access and security
credentials. Nodes not recorded in the registry should not be allowed to
participate in IoT system operation. Nodes removed from the system should be
deleted or marked as such in the registry.
The process of adding new nodes to the system is often referred to as
commissioning and one of its key functions is the node provisioning necessary to
complete the task. A new node needs to be assigned a unique system identifier
and/or a name by which it can be referred to, addressed, and its reports tagged.
Before a node becomes active and during its operation, the management
system is in charge of updating its firmware and software. During normal
operation, the management system continually monitors nodes for operational and
configuration errors in order to take appropriate remedial actions when necessary.
These may be affected through agent-supported administration and
policy-based mechanisms via tools such as remote access and configuration.

32
3.17. IMPLEMENTATION CONSIDERATIONS
System designers and developers have to make a number of technical
decisions when implementing IoT solutions for specific applications. This
process starts with a definition of the purpose and intended benefit of the IoT
system which in turn dictates choices of what to measure and the number and
types of sensors to be installed for the purpose. Location and properties of the
target installation area influence decisions on the type and topology of networks
needed to connect them. End node design involves decisions such as the
placement and capacity of hardware and functionality of software. Hardware
spectrum of options covers a wide range from embedded microcontrollers to fully
functional desktop or server CPUs with memory management and hardware
support for virtualization, coupled with optional hardware assists for security, such
as TPM and TEE, and performance accelerators such as GPUs, FPGAs and
ASICs. The software spectrum of applications and runtime support can range
from embedded firmware, all the way to hypervisors running multiple virtual
machines with multiple containers. Special design provisions may need to be
made in quite common cases where the equipment needs to be able to operate in
harsh environments and in unattended modes with no human operators.
In the cloud, design choices include the ingestion capacity and
corresponding tools, message routing rules and processing or a pub/sub system
such as MQTT, event processing and stream analytics subsystems, sensor
database for archival storage, such as one of NoSQL types, visualization
dashboard and command/control console, ML and AI tools and whatever
application choices may be relevant for the vertical application domain that the
IoT system is supposed to serve. JSON and XML are commonly used for the data
serialization of payloads. A data or information model needs to be adopted or
defined for semantic annotation and machine-level interoperability between
senders and receivers.

33
3.18. STRUCTURE OF IOT INFORMATION MODEL
Software objects that represent and model IoT things are often structured
in ways that follow the common practices and terminology in object-oriented
(OO) programming. They are also referred to by other names, such as thing
descriptions and smart objects. Since objects are modeling real-world things,
there are some implied semantics defined by the intrinsic physical nature of the
thing that is being modeled. For example, a temperature sensor is commonly
understood to measure temperature of something based on its characteristics and
placement, such as the ambient air temperature or water temperature in a
heating/cooling pipe.

Element Description
Object Type Physical thing being modeled (device)
Properties, Object attributes, data, metadata
Attributes
Interactions Ways to interact with object, actions, events
Links To other objects, compositions, and collections

IoT data models may specify only object types and properties of modeled things
and leave out the definition of interactions and links.
3.19. OBJECT TYPE
Within each specification, names of thing abstractions indicate the type
of the physical thing or the phenomenon that is being modeled. This field is
labeled as Object Type in Table 1 and is often modeled in object-oriented systems
as a class. Object and class types directly correspond to the specific real-world
things that are modeled by the specification. They can include a variety of sensors
and devices, such as temperature, humidity, thermostat, refrigerator, security
camera, current drawn, metered units (kwh, gals or liters) and many others. It is
customary to use a single object-class definition representing a category of

34
physical devices or things, such as a temperature sensor, and to create specific
object instances of that class for each individual physical instantiation of a thing
in a particular IOT system.

Information-model specifications and standards explicitly name and


define each type of the physical entity that they model. Those names, in effect,
constitute a vocabulary of types with their related definitions. A vocabulary may
be a simple list of defined names resembling a dictionary. In some specifications,
the naming tree may be structured as a as a hierarchy to form a taxonomy to
indicate possible classification relationships among the objects, and to guide the
proper placement of future objects as they are defined.
To facilitate unambiguous machine parsing, the vocabulary provides a
precise definition of how terms are to be named and used when referring to a
specific object class, such as temp or temperature. By using the type names exactly
as defined in the vocabulary, communicating parties can establish an accurate
correlation of references at both sending and receiving ends. This is a simple
practical way of establishing semantic interoperability at the model level.
3.20. PROPERTIES, ATTRIBUTES
Attributes generally say something about the object and its state, for
example for a temperature sensor its current reading in the applicable units of
measure, e.g. degrees C or F. IoT standards usually specify the exact format of
the name fields and their meaning in the vocabulary. They also specify the data
types for the values associated with the particular property and attribute name
fields- such as numbers, integers, or strings. Values or attributes in thing
abstraction representations can be read-only, such as temperature reading, or
writeable for actuation, or both. They can also include metadata, such as what the
sensor is measuring, e. g. air or water temperature, minimum and maximum
possible values of reading, and the like.

35
3.21. INTERACTIONS
Some information models define the types of interactions that a modeled
object supports. These can include interfaces and methods that implementations
may support, such as the types of requests and responses for reading data and for
issuing actuation commands. They can also include designations of protocols and
formalisms, usually is, to interact with the thing. Device supported is usually
include retrieval of attributes and values, such as sensor readings and metadata.
They may also include ways to request machine-readable descriptions of the
thing, its object type and characteristics, or to activate the built-in methods that
operate on the object's internal structures and outputs, including actuations. Many
specifications also define events, which are generally asynchronous signals
emitted by the device to indicate some change of state under observation.
3.22. LINKS
Some sort of linking mechanism or representation is often included in IoT
information models, primarily as a mechanism to point to items of interest or to
form groupings of related objects. Groupings of interest may be formed to
facilitate coordinated behaviors of multiple devices, such as home-automation
things. They may also be used to reflect structural properties of the physical
connections between devices as installed and configured in the field that may be
of interest to applications, such as indicating which HVAC zone a temperature
sensor and an air-handling unit belong to.Composition via linking may also be
used to describe composite objects that include some more primitive basic types
already defined in the specification. For example, a smart thermostat object type
may be constructed as a composition of a temperature sensor, set point for
temperature regulation and scheduling, and actuators of the heating and cooling
systems.

36
3.23. METADATA HANDLING

Metadata, also called tags, are used in IoT systems to provide contextual
semantics of where and how data are gathered. They can annotate data to make it
more useful for a variety of post-processing services and applications, such as
analytics and device/asset management. Metadata annotations can provide
enriched contextual information in the form of additional attributes of a thing's
functionality, geographic location, manufacturer, serial number, and the like.
Standardized information and data models often specify some metadata as object
properties or attributes. These are typically inherent properties of the things being
modeled, such as the units of measure used by a temperature sensor when
reporting its readings. Some IoT applications may benefit from or even require
additional metadata, such as on the structural relationships among things that are
determined later in the system lifecycle, e.g. at installation time. Those can be
provided as carefully defined and consistently named additional attributes and
tags.
For example, additional metadata may indicate that an air temperature
sensor in a specific room is part of an HVAC zone whose ambient conditions are
regulated by a named air-handling unit. This kind of information can be consumed
by an application to programmatically determine which HVAC components to
actuate in order to reduce or increase ambient temperature as dictated by the
associated thermostat schedule or a user request.

37
CHAPTER 4

4. HARDWARE IMPLEMENTATION

4.1. CREATING THE PROJECT IN BLYNK APP:

Download the blynk app from google play store (link has been already
given). Open it and you have to make an account there. After that click on "new
project". Now you have to click "choose device" and you will be asked to select
required hardware, you will choose "arduino uno" and in "connection type" you have
to select "usb". You have to give a project name also. Then you click on "create"
your project is now created and blynk will send an authorization token to your mail
which you have to put in the arduino code. Then you will get a free space where you
have to add buttons, graphs etc. You will get all these from the widget box. In this
project as we are operating only one appliance so we will add only one button. After
clicking on "button" the icon will be added in the free space. You can place the
button anywhere on the screen. Then you have to click on the button to customize it.
You have to give a name there and you have to select whether you are using digital
or analog a virtual pin. You also have to mention the pin no. As in this project we
are using d13 i.e. Digital pin 13.
38
4.2. CODE ANALYSIS AND FINAL CONNECTION:

After downloading the zip files you have to unzip it and copy the contents
of the files (libraries and folders) to the sketchbook-folder of the Arduino IDE. To
check whether the blynk library has been added or not restart the Arduino IDE and
check in the library section, if you see "Blynk" it means that blynk library has been
successfully added.

Just copy the code (already provided) or you can get the code
from Examples-->Blynk-->Boards_USB_Serials-->Arduino_Serial_USB. In
both cases the only change you have to make is that copy the authorization code sent
to your mail to Arduino code. A black screen will appear on the screen. Then you
have to copy the path of "scripts" folder. In my case it is "My
Documents\Arduino\libraries\Blynk\scripts" and paste it on the black screen and
place enter. The file is "blynk-ser.bat -c COM4".. Now come back to the command
prompt part and press "enter" thrice. This will connect you to Blynk Server.

4.3. HARDWARE DETAILS

Figure 4.1 Arduino platform

39
➢ It is cheap
➢ It comes with an open supply hardware feature that permits users to develop
their own kit
➢ The software of the Arduino is well-suited with all kinds of in operation
systems like Linux, Windows, and Macintosh, etc.
➢ It also comes with open supply software system feature that permits tough
software system developers to use the Arduino code to merge with the
prevailing programing language libraries and may be extended and changed.
➢ For beginners also it is very simple to use.

4.4. CONTROL WITH BLYNK APP :

Now open blynk app from your mobile and open the project you have
created. If your system is connected to Blynk server then you will see 'Online' in
your mobile otherwise you will see 'Offline'. Now click on the button to On or Off
the appliance. If it is not working then check whether the system is connected to the
blynk server.

4.5. LED BLINKING


LEDs are the most efficient way to turn an electric current into illumination.
When a current flows through a diode in the forward direction, it consists of surplus
electrons moving in one direction in the lattice and “holes” (voids in the lattice)
moving in the other. Occasionally, electrons can recombine with holes. When they
do, the process releases energy in the form of photons. This is true of all
semiconductor junctions, but LEDs use materials that maximize the effect. The color
of the light emitted (corresponding to the energy of the photon) is determined by the
semiconductor materials that form the diode junction. The latest high-brightness
(HB) white LEDs are made possible by the discovery of semiconductor materials
40
that produce blue or ultraviolet photons. In addition to the diode, an HB package
contains “yellow” phosphors on the inside of its lens. Some “blue” photons escape,
but others excite the phosphors, which then give off “yellow” photons. The result
can be tuned in manufacturing to produce “white” light.

Figure 4.2 LED symbol


A great deal of LED engineering relates to controlling the quality of this light. From
a circuit standpoint, there are a number of ways to interconnect multiple LEDs to
increase and manage light output. The general approach is to drive series strings with
a constant current.

4.6. LED PATTERN WITH PUSH BUTTON CONTROL ARDUINO

Figure 4.3 Led Pattern

41
Figure 4.4 Push Button
Usually each push button switch has two pairs of contacts. Each pair of
contacts consists of a NO contact and a NC contact. When the button is pressed, the
two pairs of contacts act simultaneously, the NC contact is disconnected, and the NO
contact is closed.
A 'push to make' switch allows electricity to flow between its two contacts
when held in. When the button is released, the circuit is broken. This type of switch
is also known as a normally open no switches. (Examples doorbell, computer case
power switch, calculator buttons, individual keys on a keyboard)
A 'push to break' switch does the opposite, i.e. when the button is not
pressed, electricity can flow, but when it is pressed the circuit is broken. This type
of switch is also known as a normally closed nc switches. (Examples: Fridge Light
Switch, Alarm Switches in Fail-Safe circuits)

4.7. DISPLAYING HELLO WORLD MESSAGE IN LCD


In this experiment, 16 characters (columns) and 2 lines (rows) LCD is used.
In the internal library of Sketch software, there is a library called Liquid Crystal. It
is defined as Liquid Crystal.
This header file has to be used in the beginning of the program. This
library has got many functions that can be used in the program. We are going to
see only a few functions of the Liquid Crystal in this program.

42
Figure 4.5 Display Output

4.8. RC SERVO POSITION CONTROL

Figure 4.6 RC Servo control

RC servo motor can be used to set the position of the shaft of the servo
motor to 0 to 180 degrees. 50 Hz frequency pulses (Period 20msec) with pulse width
(0.5 to 2.5msec) positions the servo between 0 degrees and 180 degrees. There is a
built-in servo library in sketch software. It is used by writing #include Servo. Has
the first line in the Arduino program. In this experiment, potentiometer is used to
output 0-5V analog voltage.

43
The analog voltage is read in A0 pin using analog Read function. It converts
the 0-5V analog voltage to 10bit digital outputs (10bit resolution) and digital output
with decimal value 0-1023. This read value is sent out from the Arduino as pwm
signal in pin D9. The 0-1023 value is changed to the output of 0-255. If the analog
converted value is 1023, then the output will have full on time pulse width 255. If
the analog converted value is 500, then the output will have on time pulse width of
(1023/255) x 500. Since the pulses are continuous, the average output will be dc
voltage depending upon the analog voltage input.

However, a map function to convert 0-1023 to 0-180 is used in the program.


Servo write () function is used to give control input to the servo motor 0-180 degrees.

4.9. TEMPERATURE MEASUREMENT USING LM35 THERMISTOR IC

Temperature is the most-measured process variable in industrial automation.


Most commonly, a temperature sensor is used to convert temperature value to an
electrical value. Temperature Sensors are the key to read temperatures correctly and
to control temperature in industrials applications.

Figure 4.7 Temperature Sensor

44
In the temperature functional module we developed, we use the LM34 series of
temperature sensors. The LM34 series are precision integrated-circuit temperature
sensors, whose output voltage is linearly proportional to the Fahrenheit temperature.
The LM34 thus has an advantage over linear temperature sensors calibrated in
degrees Kelvin, as the user is not required to subtract a large constant voltage from
its output to obtain convenient Fahrenheit scaling.

The LM34 does not require any external calibration or trimming to provide
typical accuracies of ±1.2°F at room temperature and ±11.2°F over a full -50 to
+300°F temperature range. The LM34 is rated to operate over a -50° to +300°F
temperature range.

4.10. DISTANCE MEASUREMENT USING ULTRASONIC SENSOR

An ultrasonic sensor is an electronic device that measures the distance of a


target object by emitting ultrasonic sound waves, and converts the reflected sound
into an electrical signal. Ultrasonic waves travel faster than the speed of audible
sound (i.e. the sound that humans can hear).

Figure 4.8 Ultrasonic Sensor

45
Ultrasonic sensor HC-SR04 sensor is used. A burst of ultrasonic waves is
transmitted. It hits the object and return back in the form of echo. Time difference
of outgoing waves and returning echo is proportional to twice the distance travelled.
HC – SR04 has 4 pins. 2 pins are +5V and Gnd. There are Triggering and Echo
signal pins. Connect trigger signal pin to A4 analog pin and echo signal pin to A5
analog pin of Arduino

4.11. IR SENSOR ANALOG INPUT WITH ARDUINO

An infrared sensor (IR sensor) is a radiation-sensitive optoelectronic


component with a spectral sensitivity in the infrared wavelength range 780 nm …
50 µm. IR sensors are now widely used in motion detectors, which are used in
building services to switch on lamps or in alarm systems to detect unwelcome guests.

Figure 4.9 Infrared Sensor

46
4.12. EXPLORE DIFFERENT COMMUNICATION METHODS WITH IOT
DEVICE
Node MCU is a low-cost open source IOT platform. And it’s used to
communicate sensors data with the cloud platform. It initially
included fireware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems,
and hardware which was based on the ESP-12 module. Later support for
the ESP32 32-bit MCU was added. Both the firmware and prototyping board designs
are open source.

Figure 4.10 Wi-Fi Communication

The firmware uses the Lua scripting language. The firmware is based on
the eLua project, and built on the Espressif Non-OS SDK for ESP8266. It uses many
open source projects, such as lua-cjson[9] and SPIFFS. Due to resource constraints,
users need to select the modules relevant for their project and build a firmware
tailored to their needs. Support for the 32-bit ESP32 has also been implemented.

47
/O index ESP8266 pin

0 [*] GPIO16

1 GPIO5

2 GPIO4

3 GPIO0

4 GPIO2

5 GPIO14

6 GPIO12

7 GPIO13

8 GPIO15

9 GPIO3

10 GPIO1

11 GPIO9

12 GPIO10

Figure 4.11 Wi-Fi with Bluetooth Module

48
CHAPTER 5

MACHINE TO MACHINE COMMUNICATION

5.1. M2M COMMUNICATION


M2M, is the Communication between machines or devices with computing
and communication facilities, without any human intervention.
Features of M2M:
➢ Large number of nodes or devices.
➢ Low cost.
➢ Energy efficient.
➢ Small traffic per machine/device.
➢ Large quantity of collective data.
➢ M2M communication free from human intervention.
➢ Human intervention required for operational stability and sustainability

5.2. M2M ECOSYSTEM:


It comprises of Device Providers, Internet Service Providers (ISPs), Platform
Providers, Service Providers and Service Users.

The device provider is basically the owner of these devices. M2M area

49
network sends the data from M2M devices, through gateway to the internet which is
handled by the internet service provider. Restfully architecture acts as an interface
between the device provider and the internet service provider. Restfully architecture
is used in low resource environment. From the ISP the reaches the platform provider.
The platform provider takes care of device management, user management, data
analytics and user access is the data is then through a RESTful architecture which
takes care of the business model to the service providers and users.

Figure 5.1 M2M Service Platform (M2SP)


5.3. M2M DEVICE PLATFORM:

➢ Enables access to objects or devices connected to the Internet anywhere and


at any time.
➢ Registered devices create a database of objects from which managers, users
and services can easily access information.

50
➢ Manages device profiles, such as location, device type, address, and
description.
➢ Provides authentication and authorization key management functionalities.
➢ Monitors the status of devices and M2M area networks, and controls them
based on their status.

5.4. M2M USER PLATFORM


➢ Manages M2M service user profiles and provides functionalities such as,
• User registration
• Modification
• Charging
• Inquiry
➢ Interoperates with the Device‐platform, and manages user access restrictions
to devices, object networks, or services.
➢ Service providers and device managers have administrative privileges on
their devices or networks.
➢ Administrators can manage the devices through device monitoring and
control.

5.5. M2M APPLICATION PLATFORM

➢ Provides integrated services based on device collected data‐ sets.


➢ Heterogeneous data merging from various devices used for creating new
services.
➢ Collects control processing log data for the management of the devices by
working with the Device‐platform.
➢ Connection management with the appropriate network is provided for
seamless services.

51
5.6. M2M ACCESS PLATFORM

➢ Provides app or web access environment to users.


➢ Apps and links redirect to service providers.
➢ Services actually provided through this platform to M2M devices.
➢ Provides App management for smart device apps.
➢ Mapping function provides an app list for appropriate devices.

5.7. INTEROPERABILITY IN INTERNET OF THINGS


Interoperability is a characteristic of a product or system, whose interfaces are
completely understood, to work with other products or systems, present or future, in
either implementation or access, without any restrictions.
5.8. NEED OF INTEROPERABILITY:
➢ IoT objectives
• Physical objects can interact with any other physical objects and
can share their information
• Any device can communicate with other devices anytime from
anywhere
• Machine to Machine communication(M2M), Device to Device
Communication (D2D), Device to Machine Communication
(D2M)
• Seamless device integration with IoT network
• Different wireless communication protocols such as ZigBee
(IEEE 802.15.4), Bluetooth (IEEE 802.15.1), GPRS, 6LowPAN,
and Wi-Fi (IEEE 802.11)
• Different wired communication protocols like Ethernet (IEEE
802.3) and Higher Layer LAN Protocols (IEEE 802.1)

52
• Different programming languages used in computing systems and
websites such as JavaScript, JAVA, C, C++, Visual Basic, PHP,
and Python
• Different hardware platforms such as Crossbow, NI, etc.
• Different operating systems
• As an example, for sensor node: TinyOS, SOS, Mantis OS,
RETOS, and mostly vendor specific OS
• As an example, for personal computer: Windows, Mac, Unix, and
Ubuntu
• Different databases: DB2, MySQL, Oracle, PostgreSQL, SQLite,
SQL Server, and Sybase
• Different data representations
• Different control models
• Syntactic or semantic interpretations

5.9. TYPES OF INTEROPERABILITY


User Interoperability: Interoperability problem between a user and a device
The following problems need to be solved
➢ Device identification and categorization for discovery:
➢ Syntactic interoperability for device interaction
➢ Semantic interoperability for device interaction

Device identification and categorization for discovery: There are different


solutions for generating unique address like Electronic Product Codes (EPC),
Universal Product Code (UPC), Uniform Resource Identifier (URI), IP Addresses
(IPv6)

53
5.10. SYNTACTIC INTEROPERABILITY FOR DEVICE INTERACTION:
➢ The interoperability between devices and device user in term of message
formats
➢ The message format from a device to a user is understandable for the user’s
computer
➢ On the other hand, the message format from the user to the device is
executable by the device

5.11. SEMANTIC INTEROPERABILITY FOR DEVICE INTERACTION:


➢ The interoperability between devices and device user in term of message’s
meaning
➢ The device can understand the meaning of user’s instruction that is sent from
the user to the device.
➢ Similarly, the user can understand the meaning of device’s response sent
from the device

5.12 .DEVICE INTEROPERABILITY:


Interoperability problem between two different devices Solution approach
for device interoperability
➢ ‣ Universal Middleware Bridge (UMB)
• Solves seamless interoperability problems caused by the heterogeneity
of several kinds of home network middleware
• UMB creates virtual maps among the physical devices of all
middleware home networks, such as HAVI, Jini, LonWorks, and UPnP
• Creates a compatibility among these middleware home networks
• UMB consists of UMB Core (UMB-C) and UMB Adaptor (UMB-A)

54
• UMB-A converts physical devices into virtually abstracted one, as
described by Universal Device Template (UDT)
• UDT consists of a Global Device ID, Global Function ID, Global
Action ID, Global Event ID, and Global Parameters
• UMB Adaptors translate the local middleware’s message into global
metadata’s message
• The major role of the UMB Core is routing the universal metadata
message to the destination or any other UMB Adaptors by the
Middleware Routing Table (MRT)

5.13. APPLICATIONS OF M2M:

A. SECURITY

• M2M enables surveillance systems, alarm monitoring, and access control.


• Examples: CCTV cameras communicating with central servers, smart door
locks, and vehicle tracking systems.

B. TRACKING & TRACING

• M2M is used for fleet management, order tracking, and asset monitoring.
• Examples: GPS trackers in delivery trucks, real-time package tracking, and
supply chain optimization.

C. PAYMENT

• M2M facilitates payment processing in vending machines, parking meters,


and point-of-sale systems.
• Examples: Contactless payment terminals, mobile wallets, and automated
toll collection.
55
D. HEALTH

• M2M devices monitor vital signs, support the elderly, and enable
telemedicine.
• Examples: Wearable health trackers, remote patient monitoring, and
emergency alerts.

E. REMOTE MAINTENANCE/CONTROL

• M2M allows remote monitoring and control of devices.


• Examples: Industrial sensors, smart home automation, and predictive
maintenance.

5.14. KEY FEATURES OF M2M COMMUNICATION

A. LOW MOBILITY

• M2M devices are stationary or move infrequently (e.g., fixed sensors).


• Unlike mobile phones, they don’t change locations frequently.

B. TIME-CONTROLLED

• Data transmission occurs at predefined intervals.


• M2M devices send data periodically (e.g., every hour).

C. TIME TOLERANT

• M2M communication can tolerate delays.


• Real-time constraints are less critical (unlike voice calls).

D. PACKET SWITCHED

• M2M uses packet-switched services (IP-based).


• Efficient data transfer over cellular networks.

56
E. ONLINE SMALL DATA TRANSMISSIONS

• M2M devices exchange small amounts of data.


• Examples: Temperature readings, status updates.

F. MONITORING

• M2M systems detect events (e.g., unauthorized access).


• Alerts trigger actions (e.g., security alarms).

G. LOW POWER CONSUMPTION

• M2M devices are energy-efficient.

H. LOCATION-SPECIFIC TRIGGER

• M2M devices activate based on specific areas.


• Geo fencing and context-aware actions.

5.15. TECHNICAL ASPECTS OF M2M COMMUNICATION:

PROTOCOLS AND STANDARDS

➢ MQTT (Message Queuing Telemetry Transport): A lightweight publish-


subscribe protocol for efficient data exchange between devices. It minimizes
overhead and is widely used in M2M scenarios.
➢ CoAP (Constrained Application Protocol): Designed for resource-constrained
devices, CoAP enables communication over UDP (User Datagram Protocol)
with low overhead.
➢ HTTP/HTTPS: Traditional web protocols are also used for M2M
communication, especially when security (HTTPS) and RESTful APIs are
required.

57
SECURITY CHALLENGES

➢ Authentication and Authorization: Ensuring that only authorized devices can


communicate.
➢ Data Encryption: Protecting data in transit to prevent eavesdropping.
➢ Device Identity Management: Managing unique identities for each device.
➢ Secure Bootstrapping: Securely provisioning devices with initial credentials.
➢ Over-the-Air (OTA) Updates: Ensuring secure firmware updates for M2M
devices.

SCALABILITY AND NETWORK TOPOLOGIES

➢ Star Topology: Centralized communication through a gateway.


➢ Mesh Topology: Devices communicate directly with each other, forming a
self-healing network.

5.16. CASE STUDIES AND REAL-WORLD EXAMPLES:

SMART GRIDS

➢ M2M enables real-time monitoring of power distribution, load balancing, and


fault detection.
➢ Smart meters communicate usage data to central systems for billing and grid
management.

FLEET MANAGEMENT

➢ GPS trackers in vehicles communicate location, fuel levels, and maintenance


needs.
➢ Fleet managers optimize routes, reduce fuel consumption, and improve safety.

58
HEALTHCARE

➢ Wearable health devices (e.g., heart rate monitors) transmit data to healthcare
providers.
➢ Remote patient monitoring improves patient outcomes and reduces hospital
visits.

INDUSTRIAL AUTOMATION

➢ M2M communication in factories automates production lines, monitors


equipment health, and predicts maintenance needs.
➢ Predictive maintenance reduces downtime and increases efficiency.

ENCRYPTION:

➢ Data encryption plays a vital role in safeguarding M2M communication. It


ensures that data transmitted across networks remains confidential and cannot
be intercepted by unauthorized parties..

AUTHENTICATION:

➢ User or device authentication verifies the identity of the connected object


before granting access to data or functionality.
➢ Robust authentication mechanisms prevent unauthorized devices from
participating in M2M communication.

ACCESS CONTROL:

➢ Implementing access control policies ensures that only authorized devices


or users can interact with M2M systems.

59
➢ Fine-grained access permissions restrict specific actions (read, write,
execute) based on roles or device identities.
➢ Access control lists (ACLs) help manage permissions effectively.

SECURE BOOTSTRAPPING:

➢ During device initialization, secure bootstrapping ensures that devices


receive valid configuration parameters and credentials.
➢ Securely provisioning initial keys, certificates, and network settings prevents
unauthorized access during startup.

REGULAR SECURITY UPDATES:

➢ M2M devices should receive timely security updates to address


vulnerabilities.
➢ Manufacturers and developers must actively monitor security patches and
release updates to protect against emerging threats.

PHYSICAL SECURITY:

➢ Protect physical access to M2M devices (e.g., sensors, gateways).


➢ Tamper-resistant enclosures and secure installation prevent unauthorized
tampering.

PRIVACY CONSIDERATIONS:

➢ M2M systems often handle personal or sensitive data.


➢ Ensure compliance with privacy regulations (e.g., GDPR) by anonymizing
data and limiting data retention.

60
CHAPTER 6
CONCLUSION

In this project, we explored the exciting realm of embedded IoT (Internet of


Things) devices. Let’s summarize our journey:

UNDERSTANDING EMBEDDED IOT:


Embedded systems, equipped with sensors and actuators, form the backbone
of IoT applications. These devices seamlessly collect data, communicate, and
interact with the physical world.

KEY COMPONENTS:
MICROCONTROLLERS:
Heart of embedded systems, handling computation and I/O.
SENSORS:
Gather environmental data (temperature, humidity, light, etc.).
ACTUATORS:
Perform actions based on sensor inputs (e.g., turning on a fan).

61
COMMUNICATION PROTOCOLS:
MQTT, CoAP, and HTTP/HTTPS
It enable M2M communication.
Choosing the right protocol depends on factors like power consumption, data size,
and security.
SECURITY MEASURES:
Encryption, authentication, and access control protect data integrity.
Regular security updates are crucial to stay ahead of vulnerabilities.

REAL-WORLD APPLICATIONS:
SMART HOMES:
Embedded IoT devices control lighting, heating, and security.
INDUSTRIAL AUTOMATION:
Predictive maintenance, process control, and energy efficiency.
HEALTHCARE:
Wearable health trackers, remote patient monitoring.

CHALLENGES AHEAD:
SCALABILITY:
Handling millions of connected devices efficiently.
INTEROPERABILITY:
Ensuring devices from different manufacturers can communicate seamlessly.
In conclusion, embedded IoT empowers us to create smarter, more connected
environments. As technology evolves, let’s continue innovating and building a
better-connected world!

62
63

You might also like