0% found this document useful (0 votes)
13 views254 pages

Iot PG

Uploaded by

maha sri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views254 pages

Iot PG

Uploaded by

maha sri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 254

UNIT-I

INTRODUCTION OF IoT:

IoT stands for Internet of Things, which means accessing and controlling
daily usable equipments and devices using Internet.
Our IoT tutorial includes all topics of IoT such as introduction, features,
advantage and disadvantage, ecosystem, decision framework, architecture and
domains, biometric, security camera and door unlock system, devices, etc.
What is an Internet of Things (IoT)
Let's us look closely at our mobile device which contains GPS Tracking,
Mobile Gyroscope, Adaptive brightness, Voice detection, Face detection etc. These
components have their own individual features, but what about if these all
communicate with each other to provide a better environment? For example, the
phone brightness is adjusted based on my GPS location or my direction.
Connecting everyday things embedded with electronics, software, and
sensors to internet enabling to collect and exchange data without human interaction
called as the Internet of Things (IoT).
The term "Things" in the Internet of Things refers to anything and
everything in day to day life which is accessed or connected through the internet.
IoT is an advanced automation and analytics system which deals with
artificial intelligence, sensor, networking, electronic, cloud messaging etc. to
deliver complete systems for the product or services. The system created by IoT
has greater transparency, control, and performance.
As we have a platform such as a cloud that contains all the data through
which we connect all the things around us. For example, a house, where we can
connect our home appliances such as air conditioner, light, etc.
Through each other and all these things are managed at the same platform.
Since we have a platform, we can connect our car, track its fuel meter, speed level,
and also track the location of the car.

If there is a common platform where all these things can connect to each
other would be great because based on my preference, I can set the room
temperature.
For example, if I love the room temperature to to be set at 25 or 26-
degree Celsius when I reach back home from my office, then according to my car
location, my AC would start before 10 minutes I arrive at home. This can be done
through the Internet of Things (IoT).

How does Internet of Thing (IoT) Work?


The working of IoT is different for different IoT echo system
(architecture). However, the key concept of there working are similar. The entire
working process of IoT starts with the device themselves, such as smartphones,
digital watches, electronic appliances, which securely communicate with the IoT
platform. The platforms collect and analyze the data from all multiple devices and
platforms and transfer the most valuable data with applications to devices.

Features of IOT:
The most important features of IoT on which it works are connectivity,
analyzing, integrating, active engagement, and many more. Some of them are listed
below:
Connectivity:
Connectivity refers to establish a proper connection between all the
things of IoT to IoT platform it may be server or cloud. After connecting the IoT
devices, it needs a high speed messaging between the devices and cloud to enable
reliable, secure and bi-directional communication.
Analyzing:
After connecting all the relevant things, it comes to real-time analyzing
the data collected and use them to build effective business intelligence. If we have
a good insight into data gathered from all these things, then we call our system has
a smart system.
Integrating:
IoT integrating the various models to improve the user experience as
well.
Artificial Intelligence:
IoT makes things smart and enhances life through the use of data. For
example, if we have a coffee machine whose beans have going to end, then the
coffee machine itself order the coffee beans of your choice from the retailer.
Sensing:
The sensor devices used in IoT technologies detect and measure any
change in the environment and report on their status. IoT technology brings passive
networks to active networks. Without sensors, there could not hold an effective or
true IoT environment.
Active Engagement:
IoT makes the connected technology, product, or services to active
engagement between each other.

Evolution of Internet of Things (IoT):

Have you ever considered how your life has become a symphony of smart
devices? Your coffee machine wakes up before you do, the thermostat tunes itself,
and even your car suggests alternate routes in traffic. Welcome to the age of
the Internet of Things (IoT).
We've seen technology evolve from room-sized computers to pocket-
friendly mobile devices. Now, it's stepping out again - infusing intelligence into
everyday objects around us.
In this whirlwind tour through the evolution of IoT, we'll uncover its humble
beginnings, present reality, and exciting future possibilities. You'll see why
businesses are embracing IoT for enhanced efficiency while grappling with new
security challenges that come along for the ride.
This isn't just another tech trend – it's a revolution transforming our lives
from how we switch off lights at night. Ready to explore? Connecting everyday
objects to the internet, IoT is a giant invisible web enabling us to start our coffee
makers from bed with smartphones.
The Internet of Things, or IoT, is like a giant invisible web that connects
everyday objects to the internet. Imagine starting your coffee maker from bed using
your smartphone—that's the magic of IoT.
But what makes it special? This tech has immense potential to make our
lives more convenient. By 2025, there will be over 75 billion connected devices
worldwide. That’s about ten devices for every person on Earth.
The Magic Behind All Connected Devices
For example, consider a smart thermostat in our home that is part of the
IoT system; it collects temperature and humidity readings, which are then sent via
Wi-Fi to other connected systems for automatic adjustment. This device collects
data about temperature and humidity levels throughout the day.
This information then gets sent via Wi-Fi to other linked systems—like your
AC unit—which automatically adjusts based on these readings. So, even before you
get home after a long hot day outside—the house is cool and comfy.
IoT Devices Present A New Level Of Connectivity And Efficiency
IoT lets us interact with objects around us in ways never possible before.
But beyond just making life easier—it also brings incredible efficiency gains across
industries.
In agriculture, for example—IoT sensors can monitor soil moisture levels
and relay that info so farmers know precisely when their crops need watering. This
increases yields and conserves water—two birds with one stone.
So, IoT is not just a tech buzzword—it’s an exciting shift towards a more
connected and efficient world.
Understanding the Evolution of IoT: A Brief History
The Internet of Things has developed quickly since its emergence, from
linking individual items to the web to comprehensive systems that are changing
whole sectors. It’s an exciting journey from simple, connected devices to complex
systems transforming entire industries.
Early Beginnings: Connecting Physical Objects to the Internet
IoT was born when we connected everyday objects like fridges and
thermostats to the internet. This lets us control them remotely and monitor their
status – giving birth to smart homes. The first IoT device was a toaster invented
by John Romkey in 1990.
Moving Towards Industrial Applications
IoT took a giant leap forward with industrial applications. Manufacturers
began using sensors and connectivity in machinery to predict maintenance needs
before they became critical issues. This led to improved efficiency and saved costs
on unplanned downtime.
Growth Driven by Advances in Technology And Wireless Networks
Advancements in technologies such as 5G networks, edge computing, and
machine learning have fueled further growth of IoT. The advent of these
technologies allowed for real-time data analysis and decision-making at the device
level, improving reliability while reducing latency significantly.
 Faster Connectivity: With the 5G rollout happening worldwide, faster data
transmission is now possible, enabling better responsiveness from our IoT
devices.
 Data Processing at Edge: By moving some processing tasks closer to where
data is generated (edge), we’ve reduced response times drastically – making
autonomous vehicles a reality.
 AI-Powered Decision Making: Machine Learning algorithms can now
analyze massive amounts of data produced by IoT devices, enabling
automatic adjustments based on learned behavior patterns.
Exploring the Benefits of IoT
The Internet of Things (IoT) isn’t just a fancy tech term. It’s a
groundbreaking technology that is beginning to transform our reality. But what are
its benefits? IoT devices give businesses new ways to monitor operations and
improve efficiency. For instance, manufacturing companies use IoT sensors for
real-time equipment monitoring, which helps predict maintenance needs before
breakdowns occur.
Enhanced Customer Experiences
According to Forbes, another significant benefit is improved customer
experience. With smart home devices like Alexa or Google Home, we can control
almost everything at home by voice command – an experience that was once
science fiction.
Saving Resources with Smart Cities
Cities around the globe are getting smarter thanks to IoT technologies, too.
From efficient waste management systems using connected bins to smart street
lights reducing energy consumption, these small steps make a big difference in
resource conservation.
Data-Driven Decision Making
IoT’s data collection and analysis capabilities enable us to make decisions
based on real-world evidence, leading to success. These capabilities enable
businesses to make informed decisions based on real-world insights, ultimately
leading them toward success.
Remember:
while it’s exciting to see how much potential IoT technologies have, always
keep security front and center. More on that in the next section.
IoT Architecture Explained
The architecture of IoT is a layered structure designed to turn raw data into
valuable information. It’s like peeling an onion; each layer reveals something more.
Definition & Characteristics of IoT :

Introduction to Characteristics of IoT


In this blog, we will discuss the Characteristics of IoT (Internet of
Things) and other features; however, before getting into the let us know some
interesting facts about the Internet of Things.
Kevin Ashton of MIT introduced the Internet of Things term in 1999. And
then, LG introduced the first-ever smart fridge to the world in 2000, and 7 years
later, the first iPhone was released. We all know that the internet of things is on the
rise, and it is predicted that by 2030 there might be 29 billion devices connected to
the internet.
What is IoT?
The term Internet Of Things has different definitions at different
places. Some say it uses Data from machine to machine or human to machine
to automate things and reduce human work. In a few other places, you will
find that IoT is a technology that helps devices to build a global
communication network by exchanging data through the internet and
performing human work using that same data.

You can also watch a video on Characteristics of IoT on our Youtube


page by Clicking Here

In my opinion, IoT is a way to connect multiple smart devices that use


embedded technology to gather, store and send data from their surroundings. And
through all these things, we can make machines work more smartly and efficiently.
There are many characteristics of IoT that make it unique and very easy to use for
users. Let us understand these characteristics of IoT below:

Characteristics of IoT (Internet of Things)


As discussed above, the Internet Of Things refers to the idea that
different devices or items connected using the internet can communicate and share
information. And with the help of this shared information, it can create new
experiences for its users.
So, with the help of the below features, IoT creates unique experiences for its
users:
1. Connectivity
As the name suggests, it’s all about the connectivity of 2 or more
devices. This characteristics of IoT help to communicate with and share
information between two or more devices. The IoT has created a world where
everything is connected to communicate well and share user data. This
connectivity also enables objects to be controlled remotely.
2. Identity of Things
As we all know, Identity is the unique characteristic of anyone. If we
take the example of mobile, every mobile phone has a unique IMEI number, and
the same goes for other devices in this world. Due to this unique number, we
identify people and things on the Internet. So, we can say that the Identity of
Things is one of the unique characteristics of IoT.
The concept of Identity is found in many aspects of IoT. Device Identity
is the one thing that makes an IoT device unique and identifiable. Identity can be
used to distinguish between different devices, give them a name, and allow them to
be controlled.
3. Scalability
Scalability is nothing but the ability of a system to grow without
affecting its performance of the system. We can quickly achieve that by adding
more hardware resources or software layers to an existing system. IoT is increasing
daily, and it is essential to consider scalability in your system, which makes it
essential characteristics of IoT.
4. Dynamic or Self-Adapting
Being dynamic is one of the main characteristics of IoT because it
needs to be self-adaptive to understand the changes around it and act accordingly.
If we take an example of a camera, it was initially created just to take a
photograph; however, later, it has got the feature of adjusting the quality of a
photograph according to the light. So, being dynamic is very important to grow a
system. Self-adaptability is a very important characteristics of IoT.
5. Architecture
Architecture is one of the critical characteristics of IoT, as with the
increasing number of IoT devices, it is very important to keep it heterogenetic not
homogenetic. IoT is only possible when multiple domains come together and work
to build a system that can minimize human work. So, it is essential for the devices
to support diverse technologies and protocols and communicate with each other.
6. Safety
The basic idea of IoT is to connect everything to the internet and make the
system easier for the users. However, when things are connected to the internet in
such a way there is always a danger of the sensitive personal details of the users
getting compromised. So safety is undoubtedly a crucial characteristic of IoT.

7. Intelligence
The evolution of digital personal assistants like Alexa, Cortana, and Siri is
an example of the intelligence of electronic devices. The intelligence of IoT
devices is the intelligence of smart sensors and devices to sense data, interact with
each other and collect a massive amount of data for analysis. It is very crucial for
your IoT device to be smart and for that, you need to make sure that it is always
up-to-date with the latest software and firmware. So, we can say that Intelligence is
one of the essential Characteristics of IoT.
What are examples of IoT devices?
We all interact with IoT devices daily, even if we do not realize it. Let me
help you with some examples of IoT devices used by us.
1. Sensors
Optical sensors for automatic street lights, sensors embedded in industrial
machinery, sensors in office lights etc are a few of the best examples of sensors.
Sensing things is one of the important Characteristics of IoT, as without sensing
any problem statement, you can not fix it.
2. Security Devices
IoT-based security devices make it easy to monitor your home and business from
anywhere. Intelligent home security cameras, audio recording devices, and sensor-
based alarms are a few examples of IoT-based security devices.
3. Smart Home Devices
We all have smart home devices, which make our life easier. Examples of smart
home devices are intelligent refrigerators, smart thermostats, Televisions, etc.
Advantages and Disadvantages of Internet of Things

Advantages Disadvantages

Can lead to network attacks


It minimizes the human efforts
as multiple devices are
interconnected

As personal data are shared so it has


It saves the time
privacy concerns

As most of the work is


It enhances the data collection performed by machine so it
can lead to unemployment

The security is improved with the help


The complexity of the system is high
of IoT

There are high chances of the


It is very efficient in resource utilization entire system to get corrupted
easily

It reduces the usage of multiple


There is a lack of international standardizations
electronic equipment.

As most of the work is


performed using the data in
It uses in traffic system very efficiently
cloud so it has high
dependency on internet

We can also use IoT in healthcare


It reduces mental and physical activity
Industry

Level 5 IoT minimizes the error and


Lack of Security
save lot of time

Usage of sensors and other smart


High dependency on internet so risk of malware
electronics devices save electricity
attacks
consumption.
Components of IoT

Below are few of the components of Internet Of Things:


 Device
 Resource
 Controller Service
 Database
 Web service
 Analysis Component and Application.

Level of IoT

The architectural elements of the Internet of Things vary based on


applications of use. Depending upon this fact, different levels are defined for the
Internet of things system from Level 1 to 5, which also helps explain the different
characteristics of IoT.
Let’s discuss these levels with their elements, and I will also use
examples of their usage. I am taking an example of an air conditioner and will
monitor its temperature to understand the IoT levels.

IoT Level 1

 Level 1 is the simplest of all Levels.


 This level consists of a sensor/device to sense(Could be a Temperature
sensor/Pressure sensor), the Data to be stored Locally, Data Analysis to
be done, Monitoring and Control can be done through the mobile app.
 It is used for simple applications with limited complexity or no
complexity.
 Data is not that huge, so there is no big data here.
 All the controls happen through the Internet.
 In this level, we use physical devices for connections, so we can consider
this level as part of Characteristics of IoT
IoT Level 2

 The data is comparatively huge in level 2.


 As the Data is enormous, it means that the frequency of sensing done by
the sensor is Faster.
 Because of the voluminous data, cloud storage is preferred.
 The analysis part is done locally; the cloud is only meant for storage
 Based on the Data Analysis, the control can be triggered through the web
app or mobile application.
IoT Level 3

 As the Data is voluminous, the frequency of the sensing done by the


sensor is faster
 Like level 2, cloud storage is preferred as the date is huge
 Most of the functionalities are the same except the data analysis; in this
level, the data analysis is done in the cloud
 Based on the data analysis done in the cloud, a control action can be
triggered through the mobile app
 A few examples of this level are Agriculture applications, room
freshening solutions based on odor sensors etc.
 As Data analysis is done on vast data at this level, so we can consider
this level an example of Charateristics of IoT which is Dynamic or Self-
Adaptive.
IoT Level 4

 The most important difference of this level is the usage of multiple


sensors, which are independent of the others.
 All the data collected with these sensors’ help are uploaded to the cloud
separately. Like levels 2 and 3, cloud storage is used in this level as well
due to the requirement of massive data storage
 The data analysis is performed on the cloud based on which control
action is triggered using the web or mobile app.
 Like level 3, this level can also be considered as an example of one of the
Characteristics of IoT which is Dynamic or Self-Adaptive
IoT Level 5

 This is the most important level: multiple sensors, coordinator nodes,


data collection, analysis, control & monitoring app make this a little
smart so this level can be an example of one of the Characteristics of the
IoT named Intelligence
 Level 5 is more or less similar to level 4, which also has a large amount
of data; hence, they are sensed using multiple sensors at a much faster
rate.
 The data collection and data analysis are performed at the cloud level.
 Based on the analysis, control action is performed using mobile or web
apps.
Architecture of IOT:

There is not such a unique or standard consensus on the Internet of


Things (IoT) architecture which is universally defined. The IoT architecture differs
from their functional area and their solutions. However, the IoT architecture
technology mainly consists of four major components:

Components of IoT Architecture


o Sensors/Devices
o Gateways and Networks
o Cloud/Management Service Layer
o Application Layer
Stages of IoT Solutions Architecture
There are several layers of IoT built upon the capability and performance
of IoT elements that provides the optimal solution to the business enterprises and
end-users. The IoT architecture is a fundamental way to design the various
elements of IoT, so that it can deliver services over the networks and serve the
needs for the future.
Following are the primary stages (layers) of IoT that provides the solution for IoT
architecture.

1. Sensors/Actuators:
Sensors or Actuators are the devices that are able to emit, accept
and process data over the network. These sensors or actuators may be connected
either through wired or wireless. This contains GPS, Electrochemical,
Gyroscope, RFID, etc. Most of the sensors need connectivity through sensors
gateways. The connection of sensors or actuators can be through a Local Area
Network (LAN) or Personal Area Network.
2. Gateways and Data Acquisition:
As the large numbers of data are produced by this sensors and
actuators need the high-speed Gateways and Networks to transfer the data. This
network can be of type Local Area Network (LAN such as WiFi, Ethernet, etc.),
Wide Area Network (WAN such as GSM, 5G, etc.).

3. Edge IT:
Edge in the IoT Architecture is the hardware and software
gateways that analyze and pre-process the data before transferring it to the
cloud. If the data read from the sensors and gateways are not changed from
its previous reading value then it does not transfer over the cloud, this saves
the data used.
4. Data center/ Cloud:
The Data Center or Cloud comes under the Management Services
which process the information through analytics, management of device and
security controls. Beside this security controls and device management the
cloud transfer the data to the end users application such as Retail,
Healthcare, Emergency, Environment, and Energy, etc.
Technologies for IOT:

The Internet of Things keeps promising us a smarter future: fridges


able to replenish themselves by automatically ordering food at a local grocery
store (in-fridge delivery included!), bridges warning the oncoming cars about a
frozen surface, or smart gear that monitors your health and delivers real-time
data straight to your doctor’s iPhone.
While all of this may soon be within the reach of our hands, we still
have to be aware of the massive machinery behind the scenes that makes dreams
become reality. Without myriads of IoT technologies that surround us, these
dreams would never come true.
What is the IoT technology hype all about?
Computer technology has been with us since the middle of the 20th
century. Yet, the technology behind the Internet of Things had already been in
the making long before the PCs became available to every Tom, Dick and Harry.
The science of telemetry (Greek tele = remote, and metron
= measure), the earliest forerunner to the IoT, has been used to measure and
collect weather data or track wildlife over wire phone lines, radio waves and
satellite communications already since the second half of the 19th century.
Despite all its technical limitations, it laid ground to the concept of machine-to-
machine communication (M2M), which, evolving gradually together with the
advancements in connectivity solutions, gave birth to the idea of the Internet of
Things as we know it today.
The future ahead of us will involve millions and millions of managed and
monitored assets [...]. Now it is up to us, the entire IT/Telecom industry, to help
everyone benefit from the Internet of Things by providing secure and reliable
solutions, Sławomir Wolf, CEO at AVSystem
The Internet of Things (IoT) is a system of interconnected digital
devices, machines, objects, animals or people provided with unique identifiers
and the ability to transmit and share data over the network without the need of
human-to-human or human-to-computer interaction. Bridging the gap between
the physical and virtual worlds, IoT aims at creating smart environments in
which individuals as well as whole societies will be able to live in a smarter and
more comfortable way. Pompous as it may sound, the IoT has already become
part of our daily life and no doubt it will settle there for good. With all this in
mind, let us now have a brief look over the machinery behind the IoT world that
makes it go round.

What is IoT technology made of? The IoT technology stack


It can prove a hard task if you’d like to find your way through the IoT
technological maze given the diversity and sheer numerousness of the
technology solutions that surround it.
However, for matters of simplicity, we could break down the IoT
technology stack into four basic technology layers involved in making the
Internet of Things work. These are the following:

Devices are objects which actually constitute the ‘things’ within the
Internet of Things. Acting as an interface between the real and the digital worlds,
they may take different sizes, shapes and levels of technological complexity
depending on the task they are required to perform within the specific IoT
deployment.
Whether pinhead sized microphones or heavy construction machines,
practically every material object (even the animate ones, like animals or humans)
can be turned into a connected device by the addition of necessary
instrumentation (by adding sensors or actuators along with the appropriate
software) to measure and collect the necessary data. Obviously, sensors,
actuators or other telemetry gear can also constitute standalone smart devices by
themselves. The only limitation to be encountered here is the actual IoT use case
and its hardware requirements (size, ease of deployment and management,
reliability, useful lifetime, cost-effectiveness).

This is what actually makes the connected devices ‘smart’. Software


is responsible for implementing the communication with the Cloud, collecting
data, integrating devices as well as performing real-time data analysis within the
IoT network. What is more, it is device software that also caters for application
level capabilities for users to visualize data and interact with the IoT system.
Having the device hardware and software in place, there must be
another layer which will provide the smart objects with ways and means of
exchanging information with the rest of the IoT world. While it is true that
communications mechanisms are strongly tied to device hardware and software,
it is vital to consider them as a separate layer. Communication layer includes
both physical connectivity solutions (cellular, satellite, LAN) and specific
protocols used in varying IoT environments (ZigBee, Thread, Z-Wave,
MQTT, LwM2M).
Choosing the relevant communications solution is one of the vital parts in
constructing every IoT technology stack. The technology chosen will determine
not only the ways in which data is sent to/received from the Cloud, but also how
the devices are managed and how they communicate with third party devices.
For the purpose of the present article, we will go into the details of some of the
present-day communications solutions later in the text.

As mentioned earlier, thanks to the ‘smart’ hardware and the


software installed the device is able to ‘sense’ what is going on around it and
communicate that to the user via a specific communications channel. An IoT
platform is the place where all of these data is gathered, managed, processed,
analysed and presented in a user-friendly way. Thus, what makes such a solution
especially valuable is not merely its data collection and IoT device
management capabilities, but rather its ability to analyse and find useful insights
from the portions of data provided by the devices via the communications layer.
Again, there is quite a number of IoT platforms on the market, with
choice depending on the requirements of the specific IoT project and such
factors as architecture and IoT technology stack, reliability, customization
properties, protocols used, hardware agnosticism, security and cost-
effectiveness.
It is also worth mentioning that platforms can be either installed on-
premise or cloud-based. Coiote IoT Device Management platform is a good
example of such a platform as it can be deployed on-site as well as in the cloud.
The same applies to another IoT platform by AVSystem — Coiote IoT Data
Orchestration.

Connectivity solutions within the IoT technology stack


As many as there are possible real-life applications of the IoT
technologies, there is no shortage of connectivity solutions behind them.
Depending on the specifications of a given IoT use case, each communications
option may offer different service enablement scenarios while having tradeoffs
between power consumption, range and bandwidth. For instance, if you’re
building a smart home, you may want to have your indoor temperature sensors
and heating controller integrated with your smartphone so that you can remotely
monitor the temperatures in each room and adjust it in real-time according to the
current needs.
In such case, the IP-based IPv6 networking protocol called Thread,
especially designed for home automation environment, would be the
recommended solution.
Short range IoT network solutions:

As a well-established short-range connectivity technology,


Bluetooth is considered to be the key solution particularly for the future of the
wearable electronics market such as wireless headphones or geolocation sensors,
especially given its widespread integration with smartphones.
Designed with cost-effectiveness and reduced power consumption
in mind, the Bluetooth Low-Energy (BLE) protocol requires very little power
from the device. Yet, this comes with a compromise: when transferring
frequently higher amounts of data, BLE may not be the most effective solution.

Being among the first IoT applications ever implemented, Radio-


frequency identification (RFID) offers positioning solutions for IoT applications,
especially in supply chain management and logistics, which require the ability of
determining the object position inside buildings.
The future of RFID technology clearly goes far beyond the simple
localisation services, with possible applications ranging from tracking hospital
patients to improving efficiency in healthcare to providing real-time merchandise
location data to minimize out-of-stock situations for retail stores.
Medium range solutions:

Developed based on IEEE 802.11, it remains the most widespread and


generally known wireless communications protocol. Its broad usage across the
IoT world is mainly limited by higher-than-average power consumption resulting
from the need of retaining high signal strength and fast data transfer for better
connectivity and reliability. As a key technology in the development of IoT,
WiFi provides a wide-ranging ground to staggering number of IoT solutions, yet
it also needs to be managed and used in terms of marketing to yield profits to
service providers and users alike.
A fine example of a WiFi management platform that offers a value-added
service empowering public WiFi access points is Linkify. As one of AVSystem’s
cutting-edge solutions, Linkify allows for practically limitless guest WiFi
customization and marketing options.

This popular wireless mesh networking standard finds its most frequent
applications in traffic management systems, household electronics, and machine
industry. Built on top of the IEEE 802.15.4 standard, Zigbee supports low data
exchange rates, low power operation, security, and reliability.
Designed specifically for smart home products, Thread employs IPv6
connectivity to enable connected devices to communicate between one another,
access services in the cloud, or interact with the user via Thread mobile
applications. The critics of Thread have pointed out that given the market
saturation, yet another wireless communication protocol leads to further
fragmentation within the IoT technology stack.

Long Range Wide Area Networks (WAN) solutions:

A product of existing 3GPP technologies, Narrowband IoT is a brand-


new radio technology standard that ensures extremely low power consumption
(10 years of battery power operation) and provides connectivity with signal
strength approx. 23 dB lower than in the case of 2G.
What is more, it uses existing network infrastructure, which ensures not
only global coverage in LTE networks, but also guaranteed signal quality. In
many cases, this fact allows for implementing NB-IoT instead of solutions that
required the construction of local networks, such as LoRa or Sigfox.
LTE-Cat M1 is a low-power wide-area (LPWA) connectivity
standard that connects IoT and M2M devices with medium data rate
requirements. It supports longer battery lifecycles and offers enhanced
in-building range as compared to cellular technologies such as 2G, 3G, or LTE-
Cat 1.

Being compatible with the existing LTE network, CAT M1 doesn’t require
the carriers to build new infrastructure to implement it. As compared to NB-IoT,
LTE Cat M1 proves to be perfect for mobile use cases, as its handling of hand-
over between cell sites is significantly better and is very similar to high speed
LTE.

LoRaWAN is a low-power Long Range Wide-Area Networking


protocol optimized for low-power consumption and supporting large networks
with millions of devices. Aiming at wide-area network (WAN) applications,
LoRaWAN is designed to furnish low-power WANs with features required to
support low-cost, mobile and secure bi-directional communication within IoT,
M2M, smart city, and industrial applications.
The concept behind Sigfox is to provide an effective connectivity
solution for low-power M2M applications requiring low levels of data transfer
for which the WiFi range is too short, and cellular range is too expensive and too
power-hungry. Sigfox employs UNB, a technology that enables it to handle low
data-transfer speeds of 10 to 1,000 bits per second. Consuming up to 100 times
less energy compared to cellular communication solutions, it delivers a typical
stand-by time of 20 years for a 2.5Ah battery.

Developing IOT Applications:

The Internet of Things (IoT) provides the ability to interconnect


computing devices, mechanical machines, objects, animals or unique identifiers
and people to transfer data across a network without the need for human-to-human
or human-to-computer is a system of conversation.
IoT applications bring a lot of value in our lives. The Internet of Things
provides objects, computing devices, or unique identifiers and people's ability to
transfer data across a network without the human-to-human or human-to-
computer interaction.
A traffic camera is an intelligent device. The camera monitors traffic
congestion, accidents and weather conditions and can access it to a common
entrance.
This gateway receives data from such cameras and transmits information to the
city's traffic monitoring system.
For example, the municipal corporation has decided to repair a road that is
connected to the national highway. It may cause traffic congestion to the national
highway. The insight is sent to the traffic monitoring system.
The intelligent system analyzes the situation, estimate their impact, and
relay information to other cities connected to the same highway. It generates live
instructions to drivers by smart devices and radio channels.
It creates a network of self-dependent systems that take advantage of real-
time control.

What is IoT?
IoT is a platform where embedded devices are connected to the Internet
to collect and exchange data. It enables machines to interact,
collaborate and learn from experiences like humans. IoT applications equipped
billions of objects with connectivity and intelligence.
Applications of IoT:

1. Wearables:
Wearable technology is the hallmark of IoT applications and one of the
earliest industries to deploy IoT. We have fit bits, heart rate monitors and
smartwatches these days.
Guardian glucose monitoring device has been developed to help people with
diabetes. It detects glucose levels in our body, uses a small electrode called the
glucose sensor under the skin, and relates it to a radiofrequency monitoring device.
2. Smart Home Applications
The smart home is probably the first thing when we talk about the IoT
application. The example we see the AI home automation is employed by Mark
Zuckerberg. Alan Pan's home automation system, where a string of musical notes
uses in-house functions.
3. Health care
IoT applications can transform reactive medical-based systems into
active wellness-based systems. Resources that are used in current medical research
lack important real-world information. It uses controlled environments, leftover
data, and volunteers for clinical trials.
The Internet of Things improves the device's power,
precision and availability. IoT focuses on building systems rather than just tools.
Here's how the IoT-enabled care device works.
4. Smart Cities
Most of you have heard about the term smart city. Smart city uses
technology to provide services. The smart city includes improving transportation
and social services, promoting stability and giving voice to their citizens.
The problems faced by Mumbai are very different from Delhi. Even global
issues, such as clean drinking water, declining air quality, and increasing urban
density, occur in varying intensity cities. Therefore, they affect every city.
Governments and engineers use the Internet of Things to analyze the
complex factors of town and each city. IoT applications help in the area of water
management, waste control and emergencies.
Example of a smart city - Palo Alto.

Palo Alto, San Francisco, is the first city to acquire the traffic approach.
He realized that most cars roam around the same block on the streets in search of
parking spots. It is the primary cause of traffic congestion in the city. Thus, the
sensors were installed at all parking areas in the city. These sensors pass
occupancy status to the cloud of each spot.
This solution involves the use of sensor arrays that collects data and uses it
for many purposes.
AD
5. Agriculture
By the year 2050, the world's growing population is estimated to have
reached about 10 billion. To feed such a large population, agriculture needs to
marry technology and get the best results. There are many possibilities in this area.
One of them is Smart Greenhouse.
Farming techniques grow crops by environmental parameters. However,
manual handling results in production losses, energy losses and labor costs, making
it less effective.
The greenhouse makes it easy to monitor and enables to control the climate
inside it.
6. Industrial Automation
It is one of the areas where the quality of products is an essential factor for
a more significant investment return. Anyone can re-engineer products and their
packaging to provide superior performance in cost and customer experience with
IoT applications. IoT will prove as a game-changer. In industrial automation, IoT
is used in the following areas:
o Product flow monitoring
o Factory digitization
o Inventory management
o Safety and security
o Logistics and Supply Chain Optimization
o Quality control
o Packaging customization
7. Hacked Car
A connected car is a technology-driven car with Internet access and a
WAN network. The technology offers the user some benefits such as in-car
infotainment, advanced navigation and fuel efficiency.
AD
8. Healthcare
Healthcare do real-time monitoring with the help of smart devices. It gathers and
transfers health data such as blood pressure, blood sugar levels, weight, oxygen,
and ECG. The patient can contact the doctor by the smart mobile application in
case of any emergency.
9. Smart Retail
IoT applications in retail give shoppers a new experience. Customers do
not have to stand in long queues as the checkout system can read the tags of the
products and deduct the total amount from the customer's payment app with IoT
applications' help.

10. Smart Supply Chain


Customers automate the delivery and shipping with a smart supply chain.
It also provides details of real-time conditions and supply networks.
11. Smart Farming
Farmers can minimize waste and increase productivity. The system allows
the monitoring of fields with the help of sensors. Farmers can monitor the status of
the area.
Internet-connected devices go from 5 million to billions in just one year.
Business Insider Intelligence estimates 24 billion IoT devices will install and
generate more than 300 billion in revenue in the future.

What Are the Internet of Things Applications?


The Internet of Things can be used in many different aspects of life, in
both the private and public sectors. Thanks to IoT, people can track things like lost
pets, their house’s security systems, or appliance maintenance schedule.
Consumers can use the IoT to help them make restaurant reservations,
monitor their exercise progress and overall health, and receive coupons for a store
only by virtue of walking by the business in question.
Businesses can use IoT to monitor supply chains, track customers’ spending
habits as well collect their feedback, monitor and maintain inventory levels, and
engage in predictive maintenance of their machines and devices.
The IoT also proves helpful in ITIL, which is a set of IT service
management, an important detail, since IT departments are called on to do more
and more in a world that’s getting increasingly digital, with more reliance on
wireless networks.
Blockchain, which is being increasingly used as a more efficient and
secure method of transaction and data processing, is a natural beneficiary of IoT
technology. We can expect to see IoT and Blockchain coming together more often
in the future.
The ubiquity of the Internet of Things is a fact of life thanks to its adoption
by a wide range of industries. IoT’s versatility makes it an attractive option for so
many businesses, organizations, and government branches, that it doesn’t make
sense to ignore it. Let us learn about IoT applications across industries below:

1. IoT Applications in Agriculture


For indoor planting, IoT makes monitoring and management of micro-
climate conditions a reality, which in turn increases production. For outside
planting, devices using IoT technology can sense soil moisture and nutrients, in
conjunction with weather data, better control smart irrigation and fertilizer
systems.
If the sprinkler systems dispense water only when needed, for example,
this prevents wasting a precious resource.

2. IoT Applications in Consumer Use


For the private citizen, IoT devices in the form of wearables and smart
homes make life easier. Wearables cover accessories such as Fitbit, smartphones,
Apple watches, health monitors, to name a few. These devices improve
entertainment, network connectivity, health, and fitness.
Smart homes take care of things like activating environmental controls so
that your house is at peak comfort when you come home. Dinner that requires
either an oven or a crockpot can be started remotely, so the food is ready when you
arrive.
Security is made more accessible as well, with the consumer having the
ability to control appliances and lights remotely, as well as activating a smart lock
to allow the appropriate people to enter the house even if they don’t have a key.
3. IoT Applications in Healthcare
First and foremost, wearable IoT devices let hospitals monitor their
patients’ health at home, thereby reducing hospital stays while still providing up to
the minute real-time information that could save lives. In hospitals, smart beds
keep the staff informed as to the availability, thereby cutting wait time for free
space.
Putting IoT sensors on critical equipment means fewer breakdowns and
increased reliability, which can mean the difference between life and death.
Elderly care becomes significantly more comfortable with IoT. In addition to the
above-mentioned real-time home monitoring, sensors can also determine if a
patient has fallen or is suffering a heart attack.

4. IoT Applications in Insurance


Even the insurance industry can benefit from the IoT revolution.
Insurance companies can offer their policyholders discounts for IoT wearables
such as Fitbit. By employing fitness tracking, the insurer can offer customized
policies and encourage healthier habits, which in the long run, benefits everyone,
insurer, and customer alike.

5. IoT Applications in Manufacturing


The world of manufacturing and industrial automation is another big
winner in the IoT sweepstakes. RFID and GPS technology can help a manufacturer
track a product from its start on the factory floor to its placement in the destination
store, the whole supply chain from start to finish. These sensors can gather
information on travel time, product condition, and environmental conditions that
the product was subjected to.
Sensors attached to factory equipment can help identify bottlenecks in the
production line, thereby reducing lost time and waste. Other sensors mounted on
those same machines can also track the performance of the machine, predicting
when the unit will require maintenance, thereby preventing costly breakdowns.
6. IoT Applications in Transportation
By this time, most people have heard about the progress being made with
self-driving cars. But that’s just one bit of the vast potential in the field of
transportation. The GPS, which, if you think of it, is another example of IoT, is
being utilized to help transportation companies plot faster and more efficient routes
for trucks hauling freight, thereby speeding up delivery times.
There’s already significant progress made in navigation, once again alluding to
a phone or car’s GPS. But city planners can also use that data to help determine
traffic patterns, parking space demand, and road construction and maintenance.
There’s even a possibility that apps can be made that can prevent a car from
starting if the driver is inebriated!

7. IoT Applications in Utilities/Energy


IoT sensors can be employed to monitor environmental conditions such as
humidity, temperature, and lighting. The information provided by IoT sensors can
aid in the creation of algorithms that regulate energy usage and make the
appropriate adjustments, eliminating the human equation (and let’s face it, who of
us hasn’t forgotten to switch off lights in a room or turn down the thermostat?).
With IoT-driven environmental control, businesses and private residences
can experience significant energy savings, which in the long run, benefits
everyone, including the environment!

8. IoT Applications in Wearables


From medical to fitness to GPS tracking, wearables serve a wide range of
purposes. These IoT have more than doubled in the last three years.
The fitness bands monitor calorie expenditure, meters of distance covered,
heartbeats per minute, blood oxygen level, and more. These IoT mostly come in
the form of wristbands/watches. However, they can also appear as earbuds, clip-on
devices, or smart fabric.
9. IoT Applications in Traffic Monitoring
A major contributor to the concept of smart cities, the Internet of Things is
beneficial in vehicular traffic management in large cities. Using mobile phones as
sensors to collect and share data from our vehicles via applications like Google
Maps or Waze is an example of using IoT. It informs about the traffic conditions of
the different routes, estimated arrival time, and the distance from the destination
while contributing to traffic monitoring.
Traffic pattern analysis gives commuters a perfect idea of what might
happen during peak hours. Thus, they will be better prepared to avoid traffic by
being aware of possible alternatives.

10. IoT Applications in Fleet Management


The installation of IoT sensors in fleet vehicles has been a boon for
geolocation, performance analysis, fuel savings, telemetry control, pollution
reduction, and information to improve the driving of vehicles.
They help establish effective interconnectivity between the vehicles,
managers, and drivers. They assure that both drivers and owners know all details
about vehicle status, operation, and requirements. The introduction of maintenance
alarms in real-time help skip the dependence on the drivers for their detection.

11. IoT Applications in Hospitality


Interesting improvements to the service quality have found their way
with the application of the IoT to the hotel industry. The hassle-free automation of
various interactions, such as electronic keys sent directly to each guest's mobile
devices, has brought about a transformation. It provides easy check-out processes,
immediate information on the availability of rooms, and quicker assignment of
housekeeping tasks while disabling the operation of doors.
The guests' location, sending offers on activities of interest, the realization of
orders to the room, the automatic charge of accounts to the room, and more can
easily be handled via integrated applications using IoT technology.
12. IoT Applications in Smart Grid and Energy Saving
From intelligent energy meters to the installation of sensors at strategic
places from the production plants to the distribution points, IoT technology is
behind better monitoring and effective control of the electrical network.
A smart grid is a holistic solution employing Information Technology to
reduce electricity waste and cost, improving electricity efficiency, economics, and
reliability.
The establishment of bidirectional communication between the end user
and the service provider allows substantial value to fault detection, decision
making, and repair thereof. It also helps users monitor their consumption patterns
and adopt the best ways to reduce energy expenditure

Industrial Internet of Things (IIoT)


1 How does Industrial IoT works?
2 Applications of Industrial Internet of Things
2.1 1. Industrial Automation
2.1.1 Connected Factories
2.2 2. Smart Robotics
2.3 3. Predictive Maintenance
2.4 4. Integration of Smart Tools / Wearables
2.5 5. Smart Logistics Management
2.6 6. Software integration for product optimization
2.7 7. Smart Package Management
2.8 8. Enhanced Quality and Security
2.9 9. Autonomous vehicles
2.10 10. Power Management
2.10.1 Advantages of Industrial Internet of Things
2.11 Conclusion
How does Industrial IoT works?
Industrial IoT is a system includes smart sensors, machines, tools,
software platforms, cloud servers and applications. Smart sensors are deployed at
every stages of manufacturing floor for specific applications.
These sensor networks continuously send data to the IoT gateway (act as a
hub between IoT devices and cloud) which receive and transmit the data to the
cloud application server for processing and analysis. Sophisticated application
programs are developed to handle large amount data within secure network and it
is accessible using Smartphone applications.

Find What are the major components of Internet of Things


Applications of Industrial Internet of Things
1. Industrial Automation

Image source: sptechnolab.com


Industrial automation is one of most significant and common application
of Internet of Things. Automation of machines and tools enables companies to
operate in an efficient way with sophisticated software tools to monitor and make
improvements for next process iterations.
Accuracy of process stages can be improved to a greater level using
machine automation. Automation tools like PLC (Programmable Logic Control)
and PAC (Programmable Automation Control) are used with smart sensor
networks connected to a central cloud system which collect huge amount of data.
Specially designed software and applications are used to analyze the data and its
behavior for improvements.
Industrial automation improves accuracy, efficiency; reduces errors, easy to
control and remotely accessible via applications. Machines can operate at harsh
environments than humans; automation of machines and tools reduces man power
requirements for specific tasks.
Connected Factories
Connected Factory concept is an effective solution for improvements in
all areas of operation. Major components such as machines, tools and sensors will
be connected to a network for easier management and access. Overview of process
flow, monitor down time, status checking of inventory, shipment, schedule
maintenance and stop/pause a particular process for further analysis etc… can be
done remotely using industrial IoT solutions.

2. Smart Robotics

Image source: ABB


Many companies are developing intelligent robotics system for IoT-
enabled factories. Smart robotics ensures smooth handling of tools and materials in
the manufacturing line with precise accuracy and efficiency. Predefined
specifications can be set for maximum precision (up to few nanometers scale for
some applications) using intelligent robotic arms.
Man machine interface design concept will reduce the complexity of
operation and it will reflect in future IoT enabled manufacturing as improved
productivity.
Robots can be programmed to perform complex tasks with high end
embedded sensors for real-time analysis. These robotics networks are connected to
a secure cloud for monitoring and controlling. Engineering team can access and
analyze this data to take quick actions for product improvements or preventing an
unexpected failure due to machine fault.

3. Predictive Maintenance
Modern industrial machines equipped with smart sensors continuously
monitoring the status of each major components and it can detect any critical issues
before the system is completely down. Smart sensors will trigger maintenance
warning to the centralized system and the alert messages will be delivered to
responsible persons/groups.
Maintenance engineers can analyze the data and plan for schedules
maintenance effectively without affecting routine task.
Predictive maintenance is an effective solution to avoid unnecessary
downtime in the production line. Unexpected failure of machines could cause
damage to products, delay in delivery and business loss for manufacturers.
Status of each machines are stored to a cloud system in a real-time basis.
History of each machines, performance, and next scheduled maintenance are easily
accessible remotely (on PCs, via web interface or via smartphone applications).
Performance improvements can be calculated and implemented for each machines
and process stages of products using collected data analysis.

4. Integration of Smart Tools / Wearables


Integration of smart sensors to tools and machines enables the workforce to
perform the task with improved accuracy and efficiency. Specially designed
wearables and smart glass helps employees to reduce error and improve safety at
the working environments.
Smart wearables can trigger instant warning messages to employees during
emergency situations like gas leak or fire. Wearables can monitor health condition
of individuals continuously and feedback if not fit for particular task.
5. Smart Logistics Management

Image source: techminds.info


Logistics is one of the important areas in many industries, which needs
continuous improvements to support increasing demands. Smart sensor technology
is a perfect fit to solve many of the complex logistics operations and manage goods
efficiently.
Retail giants like Amazon using drones to deliver goods to their customers.
Advanced technologies like drones offer better efficiency; accessibility, speed and
it require less manpower. However, initials investments are huge compared to
conventional methods and implementation has limitations.
6. Software integration for product optimization
Smart analytics solution is one of most important component of any IoT
system which further enhances the possibilities of the system for improvement and
optimization.
Major companies are implementing customized software for deep analysis of
huge amount of data collected from large sensor networks and machines. Detailed
analysis of data and understanding the behavior over time gives much better
overview of process improvement strategies for product optimization.
Improvement ideas could be directly related to product recipe or
optimization of particular machinery for better performance and output. Cost
effective solutions can be achieved using analysis of data and its behavior patterns
over a period of time. Analysis of huge amount of data was a hard, inaccurate and
time consuming task before introduction of these software tools.
7. Smart Package Management
Package management using IoT technology gives lot of convenience and
efficiency for manufacturing units. Smart sensors can monitor each stages of
packing and update status in real-time manner. Embedded sensors can detect
vibrations, atmospheric conditions like temperature and humidity etc… and
feedback if something goes wrong during transit or storage.
8. Enhanced Quality and Security
Introduction of IoT technology in to manufacturing offers enhanced
product quality. Continuous monitoring and analysis of each stages ensure better
quality by improving process steps for optimum quality.
Integration of smart tools and software assisted procedures offer higher level of
security. Software controlled automation and data collection from huge sensor
network is connected to a highly secure gateway and cloud server platform.
Complex encryption techniques are used in IIoT platform for enhanced security.
9. Autonomous vehicles

Image source: newequipment.com


Automotive industries are using IoT enables self driving vehicles to
supply goods and logistics management within their company premises. Smart
vehicles can detect traffic congestions along its path and make deviation to reach
its destination is shortest time. These vehicles are equipped with many smart
sensors continuously detect location data using GPS and wireless technologies for
communication with the control station.
10. Power Management
IoT can offer better solutions for power management in industries.
Specific sensors can detect environment and trigger to turn on/off control of lights,
air conditioners, humidity controls, liquid flow etc… for efficient power
management.
Advantages of Industrial Internet of Things
 Improved accuracy
 Product and process optimization
 Predictive maintenance and analysis
 Higher efficiency
 Remote accessibility and monitoring
 Enhanced security
 Scalability of network
 Reduced down time for machines and process
 Power savings
 Cost effectiveness

Security IN Internet of Things (IOT)

The Internet of Things (IoT) is a network of connected devices, each with


a unique identifier that automatically collects and exchanges data over a network.
IoT devices are used in multiple sectors and industries, including:
 Consumer applications – IoT consumer products include smartphones,
smart watches and smart homes, which control everything from air conditioning to
door locks, all from a single device.
 Business applications – Businesses use a wide range of IoT devices,
including smart security cameras, trackers for vehicles, ships and goods, as well as
sensors that capture data about industrial machinery.
 Governmental applications – Governmental IoT applications include
devices used to track wildlife, monitor traffic congestion and issue natural disaster
alerts.
The number of IoT devices worldwide now numbers in the billions. Their
increased presence in our daily lives has led to increased scrutiny of their inherent
security issues, which we will be exploring here.
How Internet of Things devices are managed
To function as intended, IoT devices need to be managed both internally,
(e.g., software maintenance) and externally (i.e., their communication with other
devices).

This is accomplished by connecting every IoT device to a management unit,


known as a command and control (C&C) center. Centers are responsible for
software maintenance, configurations, firmware updates to patch bugs and
vulnerabilities, as well as the provisioning and authentication of tasks, such as
device enrollment.
Communication between devices is enabled via application program
interface (API). Once a device’s manufacturer exposes its API, other devices
or applications can use it to gather data and communicate. Some APIs even allow
control over devices. For example, a building manager can use an API to remotely
lock doors inside a specific office.
IOT vulnerabilities and security issues
C&C centers and APIs effectively manage day-to-day IoT operations. That
said, their centralized nature creates a number of exploitable weak spots, including:
Unpatched vulnerabilities:
Connectivity issues or the need for end-users to manually download
updates directly from a C&C center often result in devices running on outdated
software, leaving them open to newly discovered security vulnerabilities.
Weak authentication :
Manufacturers often release IoT devices (e.g., home routers) containing
easily decipherable passwords, which might be left in place by vendors and end-
users. When left open to remote access, these devices become easy prey for
attackers running automated scripts for bulk exploitation.
Vulnerable APIs :
As a gateway to a C&C center, APIs are commonly targeted by a variety of
threats, including Man in the Middle (MITM), code injections (e.g., SQLI), and
distributed denial of service (DDoS) assaults. More information about the
implications of API-targeting attacks can be found here.
The dangers posed by exploitable devices can be broken into two categories:
threats that they pose to their users and threats that they pose to others.
Threats to users
A compromised IoT device places its users at risk in a number of ways, such
as:
Data Theft
An IoT device contains vast amounts of data, much of which is unique to its
individual users, including online browsing/purchase records, credit card details
and personal health information.
An improperly secured device leaves this data vulnerable to theft. What’s
more, vulnerable devices can be used as gateways to other areas of the network
they are deployed on, allowing for more sensitive data to be extracted.
Physical Harm
IoT devices are now commonplace in the medical industry, with
examples including pacemakers, heart monitors and defibrillators. While
convenient (e.g., a doctor can fine-tune a patient’s pacemaker remotely), these
devices are also vulnerable to security threats.
An improperly secured device can be exploited to interfere with a
patient’s medical care. It’s an exceedingly rare occurrence, albeit one to be
considered when developing a strategy for securing IoT devices.
Threats to others
Insecure IoT devices are vulnerable to being hijacked and used in
a botnet — a collection of malware-infected internet connected devices, possibly
numbering in the millions, controlled from a remote location.
For perpetrators, discovering unprotected devices is not difficult and can be
easily achieved by running widely available scripts or tools. This is best
exemplified by the existence of Shodan, a publically available search engine made
for the discovery of such devices.
As IoT devices have become more sophisticated, so have the threats that
they pose. This has manifested itself in all manner of cyberattacks, including
widespread spam and phishing campaigns, as well as DDoS attacks. The latter
have been growing in size in recent years, mostly due to the increased availability
of under protected IoT devices.

See how Imperva Web Application Firewall can help you with IoT security.
Internet of Things security management
The sheer volume of Internet of Things devices makes their security a high
priority and is crucial for the future wellbeing of the internet ecosystem.
For device users, this means abiding by basic security best practices, such
as changing default security passwords and blocking unnecessary remote access
(e.g., when not required for a device’s functionality).
Vendors and device manufacturers, on the other hand, should take a
broader approach and invest heavily in securing IoT management tools. Steps that
should be taken include:
1. Proactively notifying users about devices running outdated software/OS
versions.
2. Enforcing smart password management (e.g., mandatory default password
changes).
3. Disabling remote access to a device, unless it’s necessary for core functions.
4. Introducing a strict access control policy for APIs.
5. Protecting C&C centers from compromise attempts and DDoS attacks.
Imperva cloud WAF helps IoT manufacturers protect their C&C centers by
providing on-edge traffic filtering services that ensure only authorized and
authenticated client requests are allowed to reach their APIs.
Combining industry-leading WAF services and DDoS mitigation solutions,
Imperva cloud WAF is able to secure its users against all online threats and
efficiently handle multi-versioning from different devices.
For added reliability, the service is also equipped with load balancing and
failover features that help operators handle organic traffic spikes, such as the kind
that can occur upon the release of a new firmware patch.\

5MARKS:
1. Definition & characteristics of IOT?
2 .Explain about the introduction to IOT?
3 .Short note Security in IOT?
4. what is a Technologies for IOT Application?
5.Explain about the Application of IOT?

10 MARKS:
1.Explain about the Industrial IOT?
2.Discuss on the Application of IOT?
3.Explain about the Architecture of IOT?
UNIT-I
MCQ QUESTIONS:
1) How many numbers of the element in the open IoT architecture?
a) Four element b)Five elements c)Six elements
d)Seven elements
Answer: (d) Seven elements
2) Which of the following is the way in which an IoT device is associated with
data?
a)Internet b)Cloud c)Automata d)Network
Answer: (b) Cloud
3) Which of the following IoT networks has a very short range?
a)Short Network b)LPWAN c)SigFox d)Short-range Wireless Network
Answer: (d) Short Range Wireless Network
4) What is the full form of the LPWAN?
a)Low Protocol Wide Area Network b)Low Power Wide Area Network
c)Long Protocol Wide Area Network d)Long Power Wide Area Network
Answer: (b) Low Power Wide Area Network
5) An IoT network is a collection of _ _ devices.
a)Signal b)Machine to Machine c)Interconnected d)Network to Network
Answer: (c) Interconnected
6) Which one of the following is not an IoT device?
a)Amazon echo voice controller b)Google Home c)Nest Smoke Alarm
d)None of these
Answer: (d) None of the these
7) What is the main purpose of WoT (Web of Things) in the IoT?
a)Improve the usability and interoperability b)Reduce the security
c)Complex the development d)Increase the cost
Answer: (a) Improve the usability and interoperability
8) What is the Arduino UNO?
a)Software b)Hardware device c)Network d)Protocol
Answer: (b) Hardware device
9) allows the user to control electronic components.
a)Android API b)RETful API c)MQTT API d)CoAP API
Answer: (b) RETful API
10) Which of the following is not an application of IoT?
a)Wearables b)Smart Grid c)Arduino d)Smart City
Answer: (c) Arduino
11) Which one of the following protocols is lightweight?
a)IP b)HTTP c)MQTT d)CoAP
Answer: (c) MQTT
12) What is the role of Big Data in IoT's Smart Grid architecture?
a)Filter the data b)Locked the data c)Store data d)None of the these
Answer: (c) Store data
13) What is the real example of a smart grid device in IoT?
a)Mobile phone b)Television c)Smart Speaker d)Smart Meters
Answer: (d) Smart Meters
14) What is the full form of the MQTT?
a)Multi-Queue Telemetry Things b)Multiple Queue Telemetry Things
c)Message Queue Telemetry Things d)Message Queue Telemetry Transport
Answer: (d) Message Queue Telemetry Transport
15) What is the full form of ICT?
a)InterConnect Technology b)Internet Connection Topology
c)Information and Communication Technology
d)Infer Communication Topology
Answer: (c) Information and Communication Technology
16) Which of the following frequencies is correct for the Galileo gen 2 board?
a)250 MHz b)400 MHz c)450 MHz d)300 MHz
Answer: (b) 400 MHz
17) What is the full form of IANA?
A)Inter-Assessment-Number-Access
B)Internet-Association-Numbers-Authority
c)International-Aid-for-Network-Authority
d)Internet-Assigned-Numbers-Authority
Hide Answer Workspace
Answer: (d) Internet-Assigned-Numbers-Authority
18) What is the standard port number of secure MQTT?
a)1883 b)8000 c)8883 d)8888
Answer: (c) 8883
19) Which of the following layers provides end-to-end communication in IoT?
a)Logical layer b)Data link layer c)Transport layer d)Session layer
Answer: (c) Transport layer
20) Which of the following devices is used to measure the gases or liquid?
a)Optical Sensor b)Gas Sensor c)Smoke Sensor d)Pressure sensor
Answer: (d) Pressure sensor
21) Which interface does the fingerprint sensor use?
a)UART interface b)CoAP interface c)SPI interface d)I2P interface
Answer: (a) UART interface
22) Which of the following protocols is used by USART?
a) ARS32 b)RS232C c)4RS85 d)All of the these
Answer: (b) RS232C
23) What is the full form of HDLC?
A)Higher Data Level Communication b)Higher Data Link Communication
c)High-level Data Link Control d)High Data Level Control
Answer: (c) High-level Data Link Control
24) Which of the following "bit" defines the address bit in the control register?
a)ML b)MM c)RXWake d)None of the these
Answer: (b) MM
25) What is another name for I2C?
a) Signal wire interface b)Two wire interfaces c)UART d)USART
Answer: (b) Two wire interface

26) When the clock line SCL is high, the SDA is transitioned.
a)Low b)High c)Medium d)All of the these
Answer: (a) Low
27) Which of the following protocols does the secure digital card application use?
a)XMPP b) SPI c)MQTT d)HTTPS
Answer: (b) SPI
28) How many logic signals are there in the SPI protocol?
a)Five signals b)Six signals c)Nine signals d)Zero signals
Answer: (a) Five signals
29) What does MOSI mean?
a)MOSI is a network line.
b) MOSI is a clock signal that sends the clock signals from master to slave.
c) MOSI is a data line that sends the data from master to slave.
d) None of the these
Answer: (c) MOSI is a data line that sends the data from master to slave.
30) What is the full form of HART?
a)Highway Application Remote Transport
b) Highway Addressable Remote Transducer
c) High Address Reduce Transport
d) High Application Remote Transport
Answer: (b) Highway Addressable Remote Transducer
31) What is the range of z-wave?
a)30 to 100 m b)300 to 1000 m c)100 to 1000 m d)Only 10 m
Answer: (a) 30 to 100 m
32) Which of the following topology is used for ZigBee Smart Energy?
a)Bus Topology b)Ring Topology c)Star Topology d)Any Topology
33) Which of the following protocols does not exist at the data link layer?
a)ZigBee Smart Energy b)LoRaWAN c)WirelessHART d)Secure MQTT
Answer: (d) Secure MQTT
34) Which of the following is the type of SPI controller?
a)Micro-wire or plus b)Microwire c)Data SPI d)Queued SPI
Answer: (d) Queued SPI
35) What is MQTT primarily used for?
a)User communication b)System transfer c)Machine to Machine
Communication d)Create connection
Answer: (c) Machine-to-Machine Communication
36) What is the frequency rate of z-wave?
a)908.42 GHz b)928.49 GHz c)888.42 GHz d)708.49 GHz
Answer: (a) 908.42 GHz
37) What is another name of the tactile sensor?
a)Weight sensor b)Imaging sensor c)Proximity sensor d)Touch sensor
Answer: (d) Touch sensor
38) How many types of capacitive touch sensors in IoT?
a)Two types b)Five types c)Seven types d)Nine types
Answer: (a) Two types
39) Which of the following touch sensors is used in a cell phone?
a)Resistive touch sensors b)Human sensor
c)Capacitive touch sensor d)Follow sensor
Answer: (c) Capacitive touch sensor
40) Which of the following languages does GSN work on?
a)Python b)JAVA c)Android d)C++
Answer: (b) JAVA
41) Which of the following is the example of a short-range wireless network?
a)VPN b)Wi-Fi c)Internet d)WWW
Answer: (b) Wi-Fi
42) Which is not an IoT platform?
a)Xiaomi Cloud b)GoogleCloud c)Myntra
d)AWS(Amazon Web Services)
Answer:- C
43) Which of the following can not be considered an IoT device?
a)Smartwatch b)Andriod Phone c)Laptop d)Tubelight
Answer:- D
44) IoT is based on technology.
a)Hardware b)Software c)None d)Both of these
Answer:- D
45. What is the standard form of RFID?
a)Radio Frequency Identification b)Radio Waves Frequency IdentificationRadio
c)Frequency InterDependent d)Radio Wave Frequency Independent
Answer:- A
46) What is considered the standard length for a MAC Address?
a)8 bits b)32 bits c)48 bits d)None of these
Answer:- C
47) What “bit” represents the address bit in the control register?
a)MML b)ML c)MX d)MM
Answer:- C
48) What is mandatory for an IP Packet to contain?
a)Destination IP Address b)Source IP Address
c)Both of these d)None of these
Answer:- C
49) At which level does the router operate in the OSI reference model?
a)Data Link b)Network c)Physica d)None of these
Answer:- B
50) What is an IoT network?
a)a collection of networked devices b)a collection of Interconnected devices
c)a collection of signalled devices d)None of the above
Answer:- B
UNIT-II

Basic Electronic for IOT:

How current flows


Current is flow of electrons, but current and electron flow in the opposite
direction. Current flows from positive to negative and electron flows from negative to
positive. Current is determined by the number of electrons passing through a cross-section
of a conductor in one second.
Voltage, Current and Resistance
 Voltage, ( V ) is the potential energy of an electrical supply stored in the form of an
electrical charge. Voltage can be thought of as the force that pushes electrons through
a conductor and the greater the voltage the greater is its ability to “push” the electrons
through a given circuit.
As energy has the ability to do work this potential energy can be described as
the work required in joules to move electrons in the form of an electrical current
around a circuit from one point or node to another.
 Then the difference in voltage between any two points, connections or junctions
(called nodes) in a circuit is known as the Potential Difference, ( p.d. ) commonly
called the Voltage Drop.
 The Potential difference between two points is measured in Volts with the circuit
symbol V, or lowercase “v“, although Energy, E lowercase “e” is sometimes used to
indicate a generated emf (electromotive force). Then the greater the voltage, the
greater is the pressure (or pushing force) and the greater is the capacity to do work.
 A constant voltage source is called a DC Voltage with a voltage that varies
periodically with time is called an AC voltage. Voltage is measured in volts, with one
volt being defined as the electrical pressure required to force an electrical current of
one ampere through a resistance of one Ohm.
 Voltages are generally expressed in Volts with prefixes used to denote sub-multiples
of the voltage such as microvolts ( μV = 10–6 V ), millivolts ( mV = 10–3 V )
or kilovolts ( kV = 103 V ). Voltage can be either positive or negative.

Voltage Symbols:

 A simple relationship can be made between a tank of water and a voltage supply. The
higher the water tank above the outlet the greater the pressure of the water as more
energy is released, the higher the voltage the greater the potential energy as more
electrons are released.
 Voltage is always measured as the difference between any two points in a circuit and
the voltage between these two points is generally referred to as the “Voltage drop“.
Note that voltage can exist across a circuit without current, but current cannot exist
without voltage and as such any voltage source whether DC or AC likes an open or
semi-open circuit condition but hates any short circuit condition as this can destroy it.

 Electrical Current, ( I ) is the movement or flow of electrical charge and is measured


in Amperes, symbol i, for intensity). It is the continuous and uniform flow (called a
drift) of electrons (the negative particles of an atom) around a circuit that are being
“pushed” by the voltage source.
 In reality, electrons flow from the negative (–ve) terminal to the positive (+ve)
terminal of the supply and for ease of circuit understanding conventional current flow
assumes that the current flows from the positive to the negative terminal.
Conventional Current Flow

 Conventionally this is the flow of positive charge around a circuit, being positive to
negative. The diagram at the left shows the movement of the positive charge (holes)
around a closed circuit flowing from the positive terminal of the battery, through the
circuit and returns to the negative terminal of the battery. This flow of current from
positive to negative is generally known as conventional current flow.
 This was the convention chosen during the discovery of electricity in which the
direction of electric current was thought to flow in a circuit. To continue with this line
of thought, in all circuit diagrams and schematics, the arrows shown on symbols for
components such as diodes and transistors point in the direction of conventional
current flow.
 Then Conventional Current Flow gives the flow of electrical current from positive to
negative and which is the opposite in direction to the actual flow of electrons.
Resistance
 Resistance, ( R ) is the capacity of a material to resist or prevent the flow of current
or, more specifically, the flow of electric charge within a circuit. The circuit element
which does this perfectly is called the “Resistor”.
 Resistance is a circuit element measured in Ohms, Greek symbol ( Ω, Omega ) with
prefixes used to denote Kilo-ohms ( kΩ = 103Ω ) and Mega-ohms ( MΩ = 106Ω ).
Note that resistance cannot be negative in value only positive.
Resistor Symbols
 The amount of resistance a resistor has is determined by the relationship of the current
through it to the voltage across it which determines whether the circuit element is a
“good conductor” — low resistance, or a “bad conductor” — high resistance. Low
resistance, for example 1Ω or less implies that the circuit is a good conductor made
from materials such as copper, aluminium or carbon while a high resistance, 1MΩ or
more implies the circuit is a bad conductor made from insulating materials such as
glass, porcelain or plastic.
 A “semiconductor” on the other hand such as silicon or germanium, is a material
whose resistance is half way between that of a good conductor and a good insulator.
Hence the name “semi-conductor”. Semiconductors are used to make Diodes and
Transistors etc.
 For very low values of resistance, for example milli-ohms, ( mΩ ) it is sometimes
much easier to use the reciprocal of resistance ( 1/R ) rather than resistance ( R ) itself.
The reciprocal of resistance is called Conductance, symbol ( G ) and represents the
ability of a conductor or device to conduct electricity.
 In other words the ease by which current flows. High values of conductance implies a
good conductor such as copper while low values of conductance implies a bad
conductor such as wood. The standard unit of measurement given for conductance is
the Siemen, symbol (S).
 The unit used for conductance is mho (ohm spelt backward), which is symbolized by
an inverted Ohm sign ℧. Power can also be expressed using conductance as: p = i2/G
= v2G.
 The relationship between Voltage, ( v ) and Current, ( i ) in a circuit of constant
Resistance, ( R ) would produce a straight line i-v relationship with slope equal to the
value of the resistance as shown.
Ohm’s Law
 Most basic components of electricity are voltage, current, and resistance. Ohm’s law
shows a simple relation between these three quantities. Ohm’s law states that the
current through a conductor between two points is directly proportional to the voltage
across the two points.

Ohm’s Law Formula


 Voltage= Current× Resistance
 V= I×R
 V= voltage, I= current and R= resistance
 The SI unit of resistance is ohms and is denoted by Ω
 This law is one of the most basic laws of electricity. It helps to calculate the power,
efficiency, current, voltage, and resistance of an element of an electrical circuit.
Definition of Semiconductor
 The materials that are neither conductor nor insulator with energy gap of about 1 eV
(electron volt) are called semiconductors.
 Most common materials commercially used as semiconductors are germanium (Ge)
and silicon (Si) because of their property to withstand high temperature. That means
there will be no significant change in energy gap with changing temperature.
 The relation between energy gap and absolute temperature for Si and Ge are given as
 Where, T = absolute temperature in oK
 Assuming room temperature to be 300oK,

 At room temperature resistivity of semiconductor is in between insulators and


conductors. Semiconductors show negative temperature coefficient of resistivity that
means its resistance decreases with increase in temperature.
 Both Si and Ge are elements of IV group, i.e. both elements have four valence
electrons. Both form the covalent bond with the neighboring atom.
 At absolute zero temperature both behave like an insulator, i.e. the valence band is full
while conduction band is empty but as the temperature is raised more and more
covalent bonds break and electrons are set free and jump to the conduction band.

 In the above energy band diagrams of a semiconductor. CB is the conduction band,


and VB is the valence band. At 0oK, the VB is full with all the valence electrons.
Transistor
 The transistor is a semiconductor device which transfers a weak signal from low
resistance circuit to high resistance circuit. The words trans mean transfer
property and istor mean resistance property offered to the junctions. In other
words, it is a switching device which regulates and amplify the electrical signal likes
voltage or current.
 The transistor consists two PN diode connected back to back. It has three terminals
namely emitter, base and collector. The base is the middle section which is made up of
thin layers. The right part of the diode is called emitter diode and the left part is called
collector-base diode. These names are given as per the common terminal of the
transistor. The emitter based junction of the transistor is connected to forward biased
and the collector-base junction is connected in reverse bias which offers a high
resistance.
Transistor Symbols
 There are two types of transistor, namely NPN transistor and PNP transistor. The
transistor which has two blocks of n-type semiconductor material and one block of P-
type semiconductor material is known as NPN transistor.
 Similarly, if the material has one layer of N-type material and two layers of P-type
material then it is called PNP transistor. The symbol of NPN and PNP is shown in the
figure below.

 The arrow in the symbol indicates the direction of flow of conventional current in the
emitter with forward biasing applied to the emitter-base junction. The only difference
between the NPN and PNP transistor is in the direction of the current.
Photoresistor

 A photoresistor (also known as a light-dependent resistor, LDR, or photo-


conductive cell) is a passive component that decreases resistance with respect to
receiving luminosity (light) on the component’s sensitive surface.
 The resistance of a photoresistor decreases with increase in incident light intensity; in
other words, it exhibits photoconductivity. A photoresistor can be applied in light-
sensitive detector circuits and light-activated and dark-activated switching circuits
acting as a resistance semiconductor. In the dark, a photoresistor can have a resistance
as high as several megaohms (MΩ), while in the light, a photoresistor can have a
resistance as low as a few hundred ohms. If incident light on a photoresistor exceeds a
certain frequency, photons absorbed by the semiconductor give bound electrons
enough energy to jump into the conduction band.
 The resulting free electrons (and their hole partners) conduct electricity, thereby
lowering resistance. The resistance range and sensitivity of a photoresistor can
substantially differ among dissimilar devices. Moreover, unique photoresistors may
react substantially differently to photons within certain wavelength bands.
 A photoelectric device can be either intrinsic or extrinsic. An intrinsic semiconductor
has its own charge carriers and is not an efficient semiconductor, for example, silicon.
In intrinsic devices, the only available electrons are in the valence band, and hence the
photon must have enough energy to excite the electron across the entire bandgap.
Extrinsic devices have impurities, also called dopants, added whose ground state
energy is closer to the conduction band; since the electrons do not have as far to jump,
lower energy photons (that is, longer wavelengths and lower frequencies) are
sufficient to trigger the device. If a sample of silicon has some of its atoms replaced
by phosphorus atoms (impurities), there will be extra electrons available for
conduction. This is an example of an extrinsic semiconductor.
Photodiode
 A special type of PN junction device that generates current when exposed to light is
known as Photodiode. It is also known as photodetector or photosensor. It operates in
reverse biased mode and converts light energy into electrical energy.
 The figure below shows the symbolic representation of a photodiode:
Principle of Photodiode
 It works on the principle of Photoelectric effect.
 The operating principle of the photodiode is such that when the junction of this two-
terminal semiconductor device is illuminated then the electric current starts flowing
through it. Only minority current flows through the device when the certain reverse
potential is applied to it.
Construction of Photodiode
The figure below shows the constructional detail of a photodiode:

 The PN junction of the device placed inside a glass material. This is done to order to
allow the light energy to pass through it. As only the junction is exposed to radiation,
thus, the other portion of the glass material is painted black or is metallised.
 The overall unit is of very small dimension nearly about 2.5 mm.
 It is noteworthy that the current flowing through the device is in micro-ampere and is
measured through an ammeter.
Application of photodiode
 The photodiode is used in optical communication system.
 The photodiode is used in automotive devices.
 The photodiode is used in medical devices.
 It is used in solar cell panels.
 The Photodiode are used in consumer electronics devices like smoke detectors,
compact disc players, and televisions and remote controls in VCRs.
 It is used for exact measurement of the intensity of light in science & industry.
 It is used in character recognition circuit.
 It is used in camera light meters, and street lights.
 It is used in demodulation.
 The photodiode is used in logic circuit.
 It is used in photo detection circuits.

Binary Calculation:

Binary Calculation—Add, Subtract, Multiply, or Divide

10101010 + 11001100
=?

Calculate

Convert Binary Value to Decimal Value

Result

Decimal value: 170

10101010
Binary Value: =?
Calculate

Convert Decimal Value to Binary Value

170
Decimal Value: =?

Calculate

The binary system is a numerical system that functions virtually identically to


the decimal number system that people are likely more familiar with. While the decimal
number system uses the number 10 as its base, the binary system uses 2.
Furthermore, although the decimal system uses the digits 0 through 9, the
binary system uses only 0 and 1, and each digit is referred to as a bit. Apart from these
differences, operations such as addition, subtraction, multiplication, and division are all
computed following the same rules as the decimal system.
Almost all modern technology and computers use the binary system due to its
ease of implementation in digital circuitry using logic gates. It is much simpler to design
hardware that only needs to detect two states, on and off (or true/false, present/absent,
etc.).
Using a decimal system would require hardware that can detect 10 states for the
digits 0 through 9, and is more complicated.
Below are some typical conversions between binary and decimal values:

Binary/Decimal Conversion

Decimal Binary

0 0

1 1

2 10
3 11

4 100

7 111

8 1000

10 1010

16 10000

20 10100

While working with binary may initially seem confusing, understanding that
each binary place value represents 2n, just as each decimal place represents 10n, should
help clarify. Take the number 8 for example. In the decimal number system, 8 is
positioned in the first decimal place left of the decimal point, signifying the 10 0 place.
Essentially this means:
8 × 100 = 8 × 1 = 8
Using the number 18 for comparison:
(1 × 101) + (8 × 100) = 10 + 8 = 18
In binary, 8 is represented as 1000. Reading from right to left, the first 0
represents 20, the second 21, the third 22, and the fourth 23; just like the decimal system,
except with a base of 2 rather than 10. Since 23 = 8, a 1 is entered in its position yielding
1000. Using 18, or 10010 as an example:
18 = 16 + 2 = 24 + 21
10010 = (1 × 24) + (0 × 23) + (0 × 22) + (1 × 21) + (0 × 20) = 18
The step by step process to convert from the decimal to the binary system is:
1. Find the largest power of 2 that lies within the given number
2. Subtract that value from the given number
3. Find the largest power of 2 within the remainder found in step 2
4. Repeat until there is no remainder
5. Enter a 1 for each binary place value that was found, and a 0 for the rest
Using the target of 18 again as an example, below is another way to visualize this:

2n 24 23 22 21 20

Instances within 18 1 0 0 1 0

Target: 18 18 - 16 = 2 → 2-2=0

Converting from the binary to the decimal system is simpler. Determine all of the place
values where 1 occurs, and find the sum of the values.
EX: 10111 = (1 × 24) + (0 × 23) + (1 × 22) + (1 × 21) + (1 × 20) = 23

24 23 22 21 20

1 0 1 1 1

16 0 4 2 1

Hence: 16 + 4 + 2 + 1 = 23.
Binary Addition:
Binary addition follows the same rules as addition in the decimal system except
that rather than carrying a 1 over when the values added equal 10, carry over occurs when
the result of addition equals 2. Refer to the example below for clarification.
Note that in the binary system:
0+0=0
0+1=1
1+0=1
1 + 1 = 0, carry over the 1, i.e. 10
EX:

1
0 11 11 10 1
+ 1 0 1 1 1

= 1 0 0 1 0 0

The only real difference between binary and decimal addition is that the value 2 in
the binary system is the equivalent of 10 in the decimal system. Note that the
superscripted 1's represent digits that are carried over.
A common mistake to watch out for when conducting binary addition is in the case
where 1 + 1 = 0 also has a 1 carried over from the previous column to its right. The value
at the bottom should then be 1 from the carried over 1 rather than 0. This can be observed
in the third column from the right in the above example.
Binary Subtraction
Similar to binary addition, there is little difference between binary and decimal
subtraction except those that arise from using only the digits 0 and 1. Borrowing occurs
in any instance where the number that is subtracted is larger than the number it is being
subtracted from. In binary subtraction,
The only case where borrowing is necessary is when 1 is subtracted from 0.
When this occurs, the 0 in the borrowing column essentially becomes "2" (changing
the 0-1 into 2-1 = 1) while reducing the 1 in the column being borrowed from by 1.
If the following column is also 0, borrowing will have to occur from each
subsequent column until a column with a value of 1 can be reduced to 0. Refer to the
example below for clarification.
Note that in the binary system:
0-0=0
0 - 1 = 1, borrow 1, resulting in -1 carried over
1-0=1
1-1=0
EX1:

-1
1 20 1 1 1

– 0 1 1 0 1

= 0 1 0 1 0

EX2:
-1
1 2-10 0

– 0 1 1

= 0 0 1

Note that the superscripts displayed are the changes that occur to each bit when
borrowing. The borrowing column essentially obtains 2 from borrowing, and the column
that is borrowed from is reduced by 1.
Binary Multiplication:
Binary multiplication is arguably simpler than its decimal counterpart. Since the
only values used are 0 and 1, the results that must be added are either the same as the first
term, or 0.
Note that in each subsequent row, placeholder 0's need to be added, and the value
shifted to the left, just like in decimal multiplication. The complexity in binary
multiplication arises from tedious binary addition dependent on how many bits are in
each term. Refer to the example below for clarification.
Note that in the binary system:
0×0=0
0×1=0
1×0=0
1×1=1
EX:

10111

× 11

10111

+ 101110

= 1000101

EX:
10101100
=0010101100
≠1010110000
Binary Division:
The process of binary division is similar to long division in the decimal system.
The dividend is still divided by the divisor in the same manner, with the only significant
difference being the use of binary rather than decimal subtraction. Note that a
good understanding of binary subtraction is important for conducting binary division.
Refer to the example below, as well as to the binary subtraction section for clarification.

IoT chips vary from traditional chips in that they utilize less power to do more
targeted processing, whereas conventional chips are more frequently employed in
general-purpose applications that need for computational processing.
A reader once came to the following conclusion in an essay by Ed S.
Perling to support this claim: IoT devices have to off-load communication,
forget computing, to internet through an external device (‘IoT hub’) and continue to do
what they had been doing. Adding an IP address to a ‘IoT hub’ looks more practical than
connecting all devices to internet. Dusun IoT utilizes advanced IoT chip technologies
from manufacturers like Rockchip, MTK, NXP, ESP32, Nordic, and Silicon Labs.
Logic Chips:
IoT enables communication between billions of linked smart devices over the
nearly ubiquitous communication protocols.
Any system may utilize the Internet to innovate and make a variety of devices
smarter and more conscious thanks to the widespread availability of dependable
wireless IoT connectivity and affordable, low-power embedded components.
The rising demand for IoT devices is the main driver of the IoT chips industry’s
expansion. The adoption of IoT chips used in various IoT devices is further fueled by the
growing popularity of automation across a variety of end-user verticals, including
healthcare, consumer electronics, industrial, automotive, BFSI, and retail.
These devices necessitate the integration of connectivity expertise as well as the
development of various networking protocols.
In addition, increasing inclination towards artificial intelligence (AI) will
accelerate the IoT chips across the end-user verticals. The term “AIoT” stands for
“AI+IoT,” It is the fusion of Internet of Things (IoT) with artificial intelligence (AI)
technology.
Underlying data is gathered via the IoT devices, and artificial intelligence
analyses, analyzes, and executes associated operations. The two technologies
complement each other.
Artificial intelligence (AI) enables devices to become programmable systems
that can learn, reason, and process information like humans. As a result, IoT devices need
AIoT chips with low power consumption, small size, and great performance for the
operation of AI algorithms, data processing, and application-driven/triggered decision-
making.
Is the Single IoT Chip Enough for IoT Solutions?
IoT applications ideally require a single chip with reducing energy consumption
combined with the miniaturization of form factor. These requirements have led to the
development of various IoT SoCs (System on Chips).
The IoT SoCs uses a more sophisticated technique to primarily improve the three
key metrics that make up the chip’s “PPA” (power consumption,performance and area).
However, a single-chip solution is not always feasible or favored by all IoT
solutions, because businesses sometimes require more than just a single chip product. The
IoT modules installed in various things must connect them to other nearby IoT devices or
the cloud and exchange data. Here is an illustration of a block diagram for the DSGW-
210 IoT gateway hardware. You can see how many IoT chips it uses.
Types of IoT Chips Available In the Market
IoT chips are vital in enabling IoT devices, facilitating the interconnection and
functionality of the Internet of Things ecosystem. In detail, IoT chips provide essential
functionalities for IoT devices, including data sensing and acquisition from sensors,
wireless connectivity for communication, data processing and control capabilities, energy
efficiency features, security, and encryption measures.
There are many IoT chips available in the market for different applications.
Based on hardware, IoT chips may be divided into processor chip, sensor chip,
connectivity IC (integrated circuit), memory device chip, and logic device chip.
For AIoT, there are four essential IoT chips: SoC, MCU, communication chip,
and sensor chip.
 The SoC serves as the hub for data processing and is essential for achieving
intelligence;
 The MCU serves as the focal point for data gathering and command execution,
supporting SoC in realizing intelligence;
 Connectivity chip is the heart of data transmission and the key to distant
communication;
 Sensor chip is the center of data acquisition and the foundation for detecting
outside signals.
Following is a brief description of some common types of IoT chips used by Dusun IoT.
Sensor Chips
Sensor IoT chips convert analog signals from sensors into digital data that other
IoT device components can process and transmit. These IoT chips interface with various
sensors to collect environmental data like temperature, humidity, and motion.
Communication IC (Intergrated Circuit)
These IoT chips provide wireless connectivity options for IoT devices. Some
common examples of communication interfaces include Wi-Fi, Bluetooth, Zigbee, Z-
Wave, LoRawan and cellular network connectivity. Communication chips enable IoT
devices to connect to networks, exchange data with other devices or cloud services, and
allow remote monitoring and control.
Nordic
Nordic Semiconductor focuses on ultra-low-power wireless chips. Their
specialty is Bluetooth Low Energy (BLE) applications and mesh networking.
By incorporating Nordic nRF5284 Bluetooth Low Energy Module base on its
wireless chip, Dusun Bluetooth gateways can offer extended battery life for connected
devices while ensuring efficient and reliable wireless connectivity.
Silicon Labs
Silicon Labs offers a range of IoT chips that facilitate wireless connectivity,
energy management, and sensor integration.
These chips often support multiple wireless protocols, allowing Dusun IoT
gateways to connect with various devices. The high-performance analog-to-digital
converters (ADCs) provided by Silicon Labs enable accurate sensor data acquisition,
enhancing the gateway’s monitoring and control capabilities.
Semtech
Your first thought while considering Semtech could be LoRa. This is logical
given that they developed and are the primary proponents of the well-known LPWAN
technology.
One thing need to clarify here is the LoRa chip with LoRaWAN chip, a lot of
customers get confused about it. They often ask us if Dusun IoT can manufacture LoRa
gateway? Dusun IoT only make LoRaWAN gateway, which uses SX1302 digital
baseband chip, which employs a more advanced process to get a greater cost
performance.
Rockchip
Rockchip’s IoT chips provide high-performance processing capabilities,
enabling efficient data handling and computation tasks within the Smart gateways. These
chips are known for their high computing efficiency, allowing the gateway to operate
reliably for computationally extensive jobs.

MTK (MediaTek)
MediaTek chips offer exceptional wireless connectivity options, especially for
WiFi. By incorporating MTK7688 chips, Dusun IoT’s DSGW-030 wireless USB
gateway can support seamless communication between devices and the cloud, enabling
efficient data transfer and remote management.
NXP
NXP’s IoT chips offer robust security features, crucial for safeguarding sensitive
data transmitted over the IoT network. These IoT chips often include built-in hardware
encryption, authentication mechanisms, and secure boot features.
DSDW-081 Modbus RS485 Ethernet converter gateways benefit from NXP’s
secure connectivity solutions, ensuring data integrity and protection against unauthorized
access.
ESP32
The ESP32 IoT chip, developed by Espressif Systems, provides Wi-Fi and
Bluetooth connectivity capabilities, making it suitable for various IoT gateway
applications. The low-power operation of ESP32 chips allows DSGW-092 ESP32
Bluetooth gateway to conserve energy while maintaining reliable wireless connections.
How To Choose a Good IoT Chip?
Choosing a good IoT chip for your project requires careful consideration of
several factors. Here are some key aspects to consider when selecting an IoT chip:
Connectivity Options
IoT devices connect to wireless networks and send and receive data using a
number of protocols, such as NB-IoT, LTE, BLE 5, Zigbee 3.0, etc.
Evaluate the wireless connectivity options offered by the IoT chip, and make
sure it is compatible with your desired network protocols, transmission range, coverage
requirements, data transfer rates, and integration with existing infrastructure or cloud
services.
Power Consumption
The right low-power IoT chips greatly will simplify a developer’s task. Therefore,
it is necessary to determine the power requirements of your IoT device and consider
whether the IoT chip supports low-power modes, sleep/wake-up functionality, or energy-
efficient features.
It is crucial for battery-powered devices or applications where power efficiency is
critical.
Processing Capabilities
Evaluate the processing capabilities of the IoT chip, including the type of
processor, clock speed, memory capacity, and support for running software or firmware.
The chosen IoT chip must handle the computational requirements of your application,
such as data processing or running machine learning algorithms.
Security Features
Security is a crucial consideration for IoT devices. Review the built-in security
features of the IoT chip, such as encryption. The ideal IoT chips support secure boot,
storage, and authentication mechanisms.
Compatibility and Interoperability
Ensure the IoT chip is compatible with your desired hardware and software
components. Consider its interoperability with other devices, protocols, and cloud
platforms to ensure seamless integration within your IoT ecosystem.
Scalability
Assess the scalability of the IoT chip for potential future expansions or
upgrades. Look for the chip’s compatibility with evolving technologies and standards to
ensure your IoT solution remains viable and adaptable in the long term.
The Significance of IoT Chips in IoT Gateways
IoT chips play a crucial role in IoT gateways, which bridge IoT devices and the
broader network infrastructure. The choice of an IoT chip in an IoT gateway is
instrumental in determining the gateway’s performance, compatibility with various
devices and protocols, and overall reliability.
Microcontroller:
A microcomputer made on a single semiconductor chip is called single-chip
microcomputer. Since, single chip microcomputers are generally used in control
applications, they are also called microcontrollers.
Microcontroller contains all essential components of a microcomputer such as
CPU, RAM, ROM/EPROM, I/O lines etc. Some single chip microcontrollers contain
devices to perform specific functions such as DMA channels, A/D converter, serial port,
pulse width modulation, etc.
8051 Architecture
In 1980, Intel introduced a powerful 8051 series of 8 -bit microcontrollers. They
are the second generation of 8-bit microcontrollers. The 8051 microcontrollers are used
for a variety of applications involving limited calculations and relatively some control
strategies.
They are used for industrial and commercial control applications, appliances
control, instrumentation etc.
The 8051 contains Boolean processor, full duplex serial port and power saving
circuitry in addition to essential components such as 8-bit CPU, RAM,
ROM/EPROM/OTPROM, timer/counter and parallel I/O lines.
The following figure shows the block diagram or architecture of Intel 8051
microcontroller.
8051 Pins Description

The pin diagram of 8051 microcontroller consists of 40 pins as given below:


Pin 1-8 (Port1): These are 8-bit bidirectional I/O port with internal pull-up resisters. It
does not perform any task; it is just an I/O port
Pin 9 (RST): It is a Reset input pin which is used to reset the microcontroller to its initial
position.
Pin 10 to 17 (Port 3): It is also an 8-bit bidirectional I/O port with internal pull-up
resisters. Additionally, it performs some special functions:
PORT 3 Pin Function Description

P3.0 RXD Serial Input

P3.1 TXD Serial Output

P3.2 INT0 External Interrupt 0

P3.3 INT1 External Interrupt 1

P3.4 T0 Timer 0

P3.5 T1 Timer 1

P3.6 WR External Memory Write

P3.7 RD External Memory Read

Pin 18 and 19: It is XTAL1 and XTAL1 pins respectively. These pins are used for
connecting an external crystal to get the system clock.
Pin 20 (GND): It is a ground pin. It provides the power supply to the circuit.
Pin 21 to 28 (Port 2): These pins are bidirectional I/O port. Higher order address bus
signals are multiplexed with this bidirectional port.
Pin 29 (PSEN): It is a Program Enable Pin. Using this PSEN pin external program
memory can be read.
Pin 30 (ALE/PROG): This pin is the Address Latch Enable pin. Using this pin, external
address can be separated from data.
Pin 31 (EA/VPP): Named as external Access Enable Pin (EA). It is used to enable or
disable the external memory interfacing.
Pin 32 - 39 (Port 0): These are also a bidirectional I/O pins but without any internal pull-
ups. Hence, it requires external pins in order to use port 0 pins as I/O port. Lower order
data and address bus signals are multiplexed with this port.
Pin 40 (VCC): This pin is used to supply power to the circuit.
8051 I/O ports
8051 microcontroller have 4 I/O ports each of 8-bit, which can be configured as
input or output. Hence, total 32 I/O pins allows the microcontroller to be connected with
the peripheral devices.
1) PORT 0
P0 can be used as a bidirectional I/O port or it can be used for address/data
connected for accessing external memory. When control is 1 the port is used for address
or data interfacing. When the control is 0 then the port can be used as a bidirectional I/O
port.

Fig: Structure of port 0 pin


PORT 0 as an Input Port
If the control is 0 then the port is used as an input port and 1 is written to the
latch. In this type of situation both the output MOSFETs are off. Since the output pin has
floats therefore, whatever data written on pin is directly read by read pin.
PORT 0 as an Output Port
If we want to write 1 on pin of P0, a '1' written to the latch which turns 'off' the
lower FET while due to '0' control signal upper FET also turns off.
Suppose we want to write '0' on pin of port 0, when '0' is written to the latch, the pin is
pulled down by the lower FET. Hence the output becomes zero.
2) PORT 1
PORT 1 is dedicated only for I/O interfacing. When used as an output port, not
needed to connect additional pull-up resistor like port 0.
To use PORT 1 as an input port '1' has to be written to the latch. In this mode 1 is written
to the pin by the external device then it read fine.

Fig: Structure of port 1 pin


3) PORT 2
PORT 2 is used for higher external address byte or a normal I/O port. Here, the I/O
operation is similar to PORT 1. Latch of PORT 2 remains stable when Port 2 pin are used
for external memory access.

Fig: Structure of port 2 pin


4) PORT 3
Following are the alternate functions of PORT 3:

PORT 3 Pin Function Description

P3.0 RXD Serial Input

P3.1 TXD Serial Output

P3.2 INT0 External Interrupt 0

P3.3 INT1 External Interrupt 1

P3.4 T0 Timer 0

P3.5 T1 Timer 1

P3.6 WR External Memory Write

P3.7 RD External Memory Read

It works as an I/O port same like port 2. Alternate functions of port 3 makes its
architecture different than other ports.
Fig: Structure of port 3 pin
8051 interrupts
Interrupt is a process of creating a temporary halt main program and pass the control to
the external sources and execute their task and then passes the control to the main
program where it held left off.
8051 has 5 interrupt signals, i.e.
o INT0,
o TFO,
o INT1,
o TF1,
o RI/TI.
The number of interrupt sources differs from version to version. It varies from 5 to 15.
The important interrupt sources are: one from the serial port, two from timers, two from
external interrupts INT0 and INT1.
Each of the interrupts can individually be enabled/disabled by setting/clearing a bit in the
special function register IE (interrupt enable). The IE register also contains a global
disable bit, which disables all the interrupts.
Each interrupt can also be programmed to one of the priority level scheme by
setting/clearing bits in the special function register IP (Interrupt Priority register).
A low priority interrupt can be interrupted by a high priority interrupt, but it cannot be
interrupted by another low priority interrupt. A high priority interrupt can?t be interrupted
by a low priority interrupt.
Difference between Microprocessor and Microcontroller:

Microprocessors Microcontrollers

It is used for big applications. It is used to execute a single task within


an application.

Microprocessor is the heart of computer It is the heart of the embedded system.


system.

It is just a processor. Memory and I/O Microcontroller contains external


components have to be having to be processor along with internal memory and
connected externally. I/O components.

Since I/O and memory connected externally, Since I/O and memory present internally,
the circuit becomes large. the circuit is small.

Can't be used in compact systems and hence Can be used in compact systems and
inefficient. microcontroller is an efficient technique.

Cost of entire system increases. Cost of entire system is low.

Power consumption is high. Power consumption is low.

Most of the microprocessors do not have Most of the microcontrollers have power
power saving modes. saving mode.

Difficult to replace. Easy to replace.

Mainly used in personal computers. Used mainly in washing machine, MP3 players.
Multipurpose in IOT:
A multipurpose computer in the context of the internet of thinks(IOT) refers
to a computing device that designed to handle a variety of tasks and functions within an
IOT ecosystem .
IOT involves connecting and interconnecting various devices and system to
collect,exchange and analyze data for improved efficiency and decision-making.
A multipurpose computer in IOT can serve several roles and functions:

1.Data processing and Analysis


2.Gateway Functionally
3.Security and Authentication
4.Device Management
5.Communication Protocols
6.Custom Applications
7.Energy Efficiency
8.Scalability

1.Data processing and Analysis:


Edge Computer : The multipurpose computer can perform data processing and
analysis at the edge of the IOT network, allowing for faster response times and reduced
latency.
This is particularly important for applications that require real-time processing
,such as industrial automation or autonomous vehicles.
2.Gateway Functionally:
Data Aggregation: Acting as a gateway, the multipurpose computer can
aggregate data from various IOT devices before transmitting it to a centralized cloud or
server for further analysis.
This helps in reducing the load on the central server and optimizing bandwidth
usage.
3. Security and Authentication:
Security Protocols: The computer can implement security measures to ensure
the integrity and confidentiality of data within the IOT network .This may include
encryption, authentication and authorization mechanisms to protect against unauthorized
access and data breaches.
4. Device Management:
Firmware Updates: The multipurpose computer can manage and deploy
firmware update connected IOT devices,ensuring that they operate with the latest
software and security patches.
5.Communication Protocols:
Protocol Transistions: In a diverse IOT environment where devices may use different
communication protocols,the multipurpose computer can translate and
Bridge communication between devices,facilitating seamless interoperability.
6.Custom Applications:
Application Hosting: It can host custom application tailored to specific IOT use
cases,allowing for flexibility and adaptability in handing different tasks and functions
based on the requirement of the IOT ecosystem.
7.Energy Efficiency:
Power Management: For IOT devices with limited power resources the multipurpose
computer can implement eneryg-efficient strategies to optimize power consumption and
extend the operational life of connected devices.
8.Scalability:
Scalable Architecture: The computer can be designed with scalability in mind,
Accommodating the growing number of IOT devices and the increasing volume of data
generated with in the network.
A multipurpose computer in IOT should be versatile,robust ,and capable of adapting
to the evolving needs of the IOT ecosystem .It plays a crucial role in orchestrating the
flow of data,ensuring security, and enabling efficient communication and collaboration
among connected devices.

Electronics Signals :

A signal is an electromagnetic or electrical current that carries data from one


system or network to another. In electronics, a signal is often a time-varying voltage that
is also an electromagnetic wave carrying information, though it can take on other forms,
such as current. There are two main types of signals used in electronics: analog and digital
signals.
Analog Signal
 An analog signal is time-varying and generally bound to a range (e.g. +12V
to -12V), but there is an infinite number of values within that continuous range. An
analog signal uses a given property of the medium to convey the signal’s information,
such as electricity moving through a wire.
 In an electrical signal, the voltage, current, or frequency of the signal may be
varied to represent the information. Analog signals are often calculated responses to
changes in light, sound, temperature, position, pressure, or other physical phenomena.
 When plotted on a voltage vs. time graph, an analog signal should produce a
smooth and continuous curve. There should not be any discrete value changes

Digital Signal
 A digital signal is a signal that represents data as a sequence of discrete values.
 A digital signal can only take on one value from a finite set of possible values at a
given time. With digital signals, the physical quantity representing the information can
be many things:
 Variable electric current or voltage
 Phase or polarization of an electromagnetic field
 Acoustic pressure
 The magnetization of a magnetic storage media
Digital signals are used in all digital electronics, including computing equipment and data
transmission devices. When plotted on a voltage vs. time graph, digital signals are one of
two values, and are usually between 0V and VCC (usually 1.8V, 3.3V, or 5V)
Conversion of Analog signals to Digital signals
 Most of the image sensors are in the analog signal, and digital processing cannot be
applied on it, as it requires infinite memory to store because signals have an infinite
value that is why we cannot store it.
 To create a digital image we can convert data into digital form.
 For the conversion there are two steps:
1. Sampling
2. Quantization
To convert an analog signal into a digital signal, both its axis(x,y) are converted into
digital format.

 As we can see that image is continuous in its coordinates(x-y). So sampling deals with
digitizing of co-ordinates and quantization deals with digitizing the amplitude.

Sampling
 In analog signals, there are continuous electrical signals that vary with time. With the
help of subsystem, a sampler extracts continuous signals for the sampling of signals.
 Sampling is done along the x-axis of signals that continuously differs with time. It is
divided into two category one is sampling and other is downsampling.
 In downsampling, the range of values on the x-axis is always less.
Quantization
 It is a process of image processing, in which continuous and time-varying values of
analog signals are divided into non-overlapping discrete and unique values assigned to
each subrange.
 Sampling and quantization are opposite to each other. Sampling is done along the x-
axis but quantization is done along the y-axis.

 The main problem in the image is the continuous occurrence of false contours which
can be quantized later with inadequate brightness levels. The fine shading of the
image depends on the level of quantization.
Digital to analog conversions
 Digital to analog conversions can be performed using resistor networks and the
conversion to an analog signal is usually in the order of nanoseconds.
 Since the digital information is a step approximation of the input signal, the resulting
output from a D to A converter reflects this step nature of the signal.
 Digital to analog conversions may be made using a ladder network of resistors or
a weighted input to a summing amplifier. The voltage on the output depends upon the
voltages applied to the inputs.
 These voltages may be either 0 (for logic 0) or some supply voltage Vcc (for logic 1).
The TTL input connected to the lowest value resistor carries more weight than the
others, thus, a larger binary or digital input results in a larger analog output voltage.
Modulation
 Modulation is a process of mixing a signal with a sinusoid to produce a new signal.
This new signal, conceivably, will have certain benefits over an un-modulated signal.
Mixing of low frequency signal with high frequency carrier signal is called
modulation.
Types of Modulation
There are 3 basic types of modulation: Amplitude modulation, Frequency modulation, and
Phase modulation.
Amplitude modulation
 a type of modulation where the amplitude of the carrier signal is modulated (changed)
in proportion to the message signal while the frequency and phase are kept constant.
Frequency modulation
 a type of modulation where the frequency of the carrier signal is modulated (changed)
in proportion to the message signal while the amplitude and phase are kept constant.
Phase modulation
 a type of modulation where the phase of the carrier signal is varied accordance to the
low frequency of the message signal is known as phase modulation.
Modulation Signals
 Frequency of an RF channel is best understood as the frequency of a carrier wave.
 A carrier wave is a pure wave of constant frequency, a bit like a sine wave. By itself it
doesn’t carry much information that we can relate to (such as speech or data).
 To include speech information or data information, another wave needs to be
imposed, called an input signal, on top of the carrier wave. This process of imposing
an input signal onto a carrier wave is called modulation.
 Recall that any wave has three basic properties:
1) Amplitude — the height of the wave
2) Frequency — a number of waves passing through in a given second
3) Phase — where the phase is at any given moment.
 There are different strategies for modulating the carrier wave. First, a user can tweak
the height of the carrier. If an input signal’s height varies with the loudness of a user’s
voice and then adds this to the carrier, then the carrier’s amplitude will change
corresponding to the input signal that’s been fed into it. This is called amplitude
modulation or AM.

 Frequency of an input signal can also be changed. If this input signal is added to the
pure carrier wave, it will thereby change the frequency of the carrier wave. In that
way, users can use changes of frequency to carry speech information. This is
called frequency modulation or FM.
 These two strategies can be combined to create a third scheme. In fact, any strategy
that combines an input signal with a carrier wave to encode speech or other useful
information is called a modulation scheme.
 Modulation schemes can be analog or digital. An analog modulation scheme has an
input wave that varies continuously like a sine wave. In digital modulation scheme,
it’s a little more complicated. Voice is sampled at some rate and then compressed and
turned into a bit stream — a stream of zeros and ones — and this in turn is created
into a particular kind of wave which is then superimposed on the carrier.
 In order to keep communication cheap and convenient and require less power to carry
as much information as possible, carrier systems with modulated carriers are used.
D/A and A/D conversions:
D/A Converters
D/A converters convert digital signals into analog format.

Digital Data:
Evenly spaced discontinuous values
Temporally discrete, quantitatively discrete
Analog Data (Natural Phenomena):
Continuous range of values
Temporally continuous, quantitatively continuous
A/D Converters
An A/D converter is a device that converts analog signals (usually voltage) obtained from
environmental (physical) phenomena into digital format
Conversion involves a series of steps, including sampling, quantization, and coding.
A/D and D/A Requirements
Electrically sophisticated and high-speed processing are performed digitally in
CPUs and DSPs.
Natural phenomena are converted to digital signals using an A/D converter for
digital signal processing, then converted back to analog signals via a D/A converter.
Advancements in Microfabrication Technology→Signal Processing Digitization
→A/D and D/A Converters Required
A/D Converter Applications
Digital Audio:
Digital audio workstations, sound recording, pulse-code modulation
Digital signal processing:
TV tuner cards, microcontrollers, digital storage oscilloscopes
Scientific instruments:
Digital imaging systems, radar systems, temperature sensors
D/A Converter Applications
Digital Audio:
CD, MD, 1-bit Audio
Digital Video:
DVD, Digital Still Camera
Communication Equipment:
Smartphones, FAX, ADSl equipment
PCs:
Audio, video cards
Measurement instruments:
Programmable power supplies, etc.
Basic Operation of a D/A Converter
A D/A converter takes a precise number (most commonly a fixed-point binary
number) and converts it into a physical quantity (example: voltage or pressure). D/A
converters are often used to convert finite-precision time series data to a continually
varying physical signal.
An ideal D/A converter takes abstract numbers from a sequence of impulses
that are then processed by using a form of interpolation to fill in data between impulses.
A conventional D/A converter puts the numbers into a piecewise constant function made
up of a sequence of rectangular functions that is modeled with the zero-order hold.
Basic Operation of an A/D Converter
Now, let's take a look at the basic operation of an A/D converter.

The A/D converter breaks up (samples) the amplitude of the analog signal at
discrete intervals, which are then converted into digital values. The resolution of an
analog to digital converter (indicating the number of discrete values it can produce over a
range of analog values) is typically expressed by the number of bits.
The graph below shows the relationship between the analog input and digital output.
In addition, the first digital change point (000→001) below 0.5LSB is the zero
scale, while the last digital change point (110→111) is termed full scale and the interval
from zero to full scale referred to as the full scale range.
Analog Signal to Digital Signal Conversion Methods
Sampling:
Sampling is the process of taking amplitude values of the continuous analog signal
at discrete time intervals (sampling period Ts).
[Sampling Period Ts = 1/Fs (Sampling Frequency)]
Sampling is performed using a Sample and Hold (S&H) circuit.
Quantization:
Quantization involves assigning a numerical value to each sampled amplitude
value from a range of possible values covering the entire amplitude range (based
on the number of bits).
[Quantization error: Sampled Value - Quantized Value]
Coding:
Once the amplitude values have been quantized they are encoded into binary using
an Encoder.
Pulse Width Modulation:
Pulse width modulation is a proven effective technique that is used to control
semiconductor devices. Pulse width modulation or PWM is a commonly used control
technique that generates analog signals from digital devices such as microcontrollers. The
signal thus produced will have a train of pulses, and these pulses will be in the form of
square waves. Thus, at any given time, the wave will either be high or low. Let us learn
more about pulse width modulation in this article.

What is Pulse Width Modulation?


Pulse width modulation reduces the average power delivered by an electrical
signal by converting the signal into discrete parts. In the PWM technique, the signal’s
energy is distributed through a series of pulses rather than a continuously varying
(analogue) signal.
How is a Pulse Width Modulation Signal generated?
A pulse width modulating signal is generated using a comparator. The modulating
signal forms one part of the input to the comparator, while the non-sinusoidal wave or
sawtooth wave forms the other part of the input. The comparator compares two signals
and generates a PWM signal as its output waveform.
If the sawtooth signal is more than the modulating signal, then the output signal is
in a “High” state. The value of the magnitude determines the comparator output which
defines the width of the pulse generated at the output.

Important Parameters associated with PWM signal


Duty Cycle of PWM
As we know, a PWM signal stays “ON” for a given time and stays “OFF” for a
certain time.
The percentage of time for which the signal remains “ON” is known as the duty
cycle. If the signal is always “ON,” then the signal must have a 100 % duty cycle. The
formula to calculate the duty cycle is given as follows:
The average value of the voltage depends on the duty cycle. As a result, the average value
can be varied by controlling the width of the “ON” of a pulse.
Frequency of PWM

The frequency of PWM determines how fast a PWM completes a period. The frequency
of a pulse is shown in the figure above.
The frequency of PWM can be calculated as follows:
Frequency = 1/Time Period
Time Period = On Time + OFF time
Output Voltage of PWM signal
The output voltage of the PWM signal will be the percentage of the duty cycle. For
example, for a 100% duty cycle, if the operating voltage is 5 V then the output voltage
will also be 5 V. If the duty cycle is 50%, then the output voltage will be 2.5 V.
Types of Pulse Width Modulation Technique
There are three conventional types of pulse width modulation technique and they are
named as follows:
 Trail Edge Modulation – In this technique, the signal’s lead edge is modulated,
and the trailing edge is kept fixed.
 Lead Edge Modulation – In this technique, the signal’s lead edge is fixed, and the
trailing edge is modulated.
 Pulse Center Two Edge Modulation – In this technique, the pulse centre is fixed
and both edges of the pulse are modulated.
Related Links
 Pulse Amplitude Modulation
 Difference Between PWM and PPM
 Modulation and Demodulation
Applications of Pulse Width Modulation
Due to the high efficiency, low power loss, and the PWM technique’s ability to precisely
control the power, the technique is used in a variety of power applications. Some of the
applications of PWM are as follows:
 The pulse width modulation technique is used in telecommunication for encoding
purposes.
 The PWM helps in voltage regulation and therefore is used to control the speed of
motors.
 The PWM technique controls the fan inside a CPU of the computer, thereby
successfully dissipating the heat.
 PWM is used in Audio/Video Amplifiers.
Advantages and Disadvantages of Pulse Width Modulation
First, let us talk about the advantages of the pulse width modulation technique before
discussing its disadvantages:
 PWM technique prevents overheating of LED while maintaining its brightness.
 PWM technique is accurate and has a fast response time.
 PWM technique provides a high input power factor.
 PWM technique helps motors generate maximum torque even when they run at
lower speeds.
The above were some of the advantages of the Pulse width modulation technique, now let
us look at some of the disadvantages:
 As the PWM frequency is high, switching losses are considerably high.
 It induces Radio Frequency Interference (RFI)

5MARKS:
1. What is a logic chips?
2 .Explain about the multipurpose computer in IOT?
3 .Short note plus width modulation?
4. what is a A/D and D/A conversion?
5.Explain about binary calculations?

10 MARKS:
1.Explain about the Basic electronic for IOT?
2.Discuss on the multicontrollers & multipurpose computer in IOT?
3.Explain about the A/D and D/A conversion?
MCQ QUESTIONS:

1) How many numbers of the element in the open IoT architecture?


a)Four elements b)Five elements c)Six elements d)Seven elements
Answer: (d) Seven elements
2)Which of the following is the way in which an IoT device is associated with data?
a)Internet b)Cloud c)Automata d)Network
Answer: (b) Cloud
3)Which of the following IoT networks has a very short range?
a)Short Network b)LPWAN c)SigFox
d)Short-range Wireless Network
Answer: (d) Short Range Wireless Network
4)What is the full form of the LPWAN?
a)Low Protocol Wide Area Network b)Low Power Wide Area Network
c)Long Protocol Wide Area Network d)Long Power Wide Area Network
Answer: (b) Low Power Wide Area Network
5) An IoT network is a collection of ______ devices.
a)Signal b)Machine to Machine c)Interconnected d)Network to Network
Answer: (c) Interconnected
6) Which one of the following is not an IoT device?
a)Amazon echo voice controller b)Google Home c)Nest Smoke Alarm
d)None of these
Answer: (d) None of the these
7) What is the main purpose of WoT (Web of Things) in the IoT?
a)Improve the usability and interoperability b)Reduce the security
c)Complex the development d)Increase the cost
Answer: (a) Improve the usability and interoperability
8) What is the Arduino UNO?
a)Software b)Hardware device c)Network d)Protocol
Answer (b)
9) ______ allows the user to control electronic components.
a)Android API b)RETful API c)MQTT API d)CoAP API
Answer: (b) RETful API
10) Which of the following is not an application of IoT?
a)Wearables b)Smart Grid c)Arduino d)Smart City
Answer: (c) Arduino
11) Which one of the following protocols is lightweight?
a)IP b)HTTP c)MQTT d)CoAP
Answer: (c) MQTT
12) What is the role of Big Data in IoT's Smart Grid architecture?
a)Filter the data b)Locked the data c)Store data d)None of the these
Answer: (c) Store data
13) What is the real example of a smart grid device in IoT?
a)Mobile phone b)Television c)Smart Speaker d)Smart Meters
Answer: (d) Smart Meters
14) What is the full form of the MQTT?
a)Multi-Queue Telemetry Things b)Multiple Queue Telemetry Things
c)Message Queue Telemetry Things d)Message Queue Telemetry Transport
Answer: (d) Message Queue Telemetry Transport
15) What is the full form of ICT?
a) InterConnect Technology b)Internet Connection Topology
c)Information and Communication Technology
d)Infer Communication Topology
Answer: (c) Information and Communication Technology
16) Which of the following frequencies is correct for the Galileo gen 2 board?
a)250 MHz b)400 MHz c)450 MHz d)300 MHz
Answer: (b) 400 MHz
17) What is the full form of IANA?
a)Inter-Assessment-Number-Access b)Internet-Association-Numbers-Authority
c)International-Aid-for-Network-Authority d)Internet-Assigned-Numbers-Authority
Answer: (d) Internet-Assigned-Numbers-Authority
18) What is the standard port number of secure MQTT?
a)1883 b)8000 c)8883 d)8888
Answer: (c) 8883
19) Which of the following layers provides end-to-end communication in IoT?
a)Logical layer b)Data link layer c)Transport layer d)Session layer
Answer: (c) Transport layer
20) Which of the following devices is used to measure the gases or liquid?
a)Optical Sensor b)Gas Sensor c)Smoke Sensor d)Pressure sensor
Answer: (d) Pressure sensor
21.Which gate is known as the universal gate?
a)NAND b)OR c)AND d)None
Answer. A
22. How does a logic gate function?
a)Using the flow of electric current b)Spontaneously
c)By using energy from a chemical reaction d)None of the above
Answer. A
23. Which of the following is not a logic gate?
a)AND b)OR c)IF d)NOT
Answer. C.
24.Which of the following are the arithmetic logic gates?
a)X-OR b)X-NOR c)Both d)None
Answer. C
25. What is the full form of DCDVS logic?
a)Differential cascade voltage switch b)Differential cascade voltage static
c)Differential complex voltage switch d)None
Answer. A
26.Who was the inventor of the idea of logic gates?
a)George Boole b)Bardeen c)Claude Shannon d)Kornard Zuse
Answer. A
27. What is the one’s complement for the binary number 011001
a)000111 b)100110 c)111001 d)110001
Answer. B
28. Expand TTL
a)Transistor-transducer logic b)Transistor- transistor logic
c)Transducer-transistor logic d)None
Answer. B
29. How many types of logic families exist?
a)Two b)Six c)Four d)Seven
Answer. D
30. Which of the following signifies a NOT gate?
a)1 (input)- 0 (output) b)1,0 (input)- 1 (output)
c)0,0 (input)- 0 (output) d)None
Answer. A. 1 (input)- 0 (output).
31.What do you mean by micro in microcontroller?
a) Distance between 2 IC’s b) Distance between 2 transistors
c) Size of a controller d) Distance between 2 pins
Answer: b
32. What is the bit size of the 8051 microcontroller?
a) 8-bit b) 4-bit c) 16-bit d) 32-bit
Answer: a
33. Name the architecture and the instruction set for microcontroller?
a) Van- Neumann Architecture with CISC Instruction Set
b) Harvard Architecture with CISC Instruction Set
c) Van- Neumann Architecture with RISC Instruction Set
d) Harvard Architecture with RISC Instruction Set
Answer: b
34. Number of I/O ports in the 8051 microcontroller?
a) 3 ports b) 4 ports c) 5 ports d) 4 ports with last port having 5 pins
Answer: b
35. Is ROM is used for storing data storage?
a) True b) False
Answer: b
36. SCON in serial port is used for which operation?
a) Transferring data b) Receiving data
c) Controlling d) Controlling and transferring
Answer: c
37. Program counter stores what?
a) Address of before instruction b) Address of the next instruction
c) Data of the before execution to be executed
d) Data of the execution instruction
Answer: b
38. Auxiliary carry is set during which condition?
a) When carry is generated from D3 to D4
b) When carry is generated from D7
c) When carry is generated from both D3 to D4 and D7
d) When carry is generated at either D3 to D4 or D7
Answer: a
39.The use of Address Latch Enable is to multiplex address and data memory.
a) True b) False
Answer: a
40.How many control lines are present in analog to digital converter in addition to
reference voltage?
a) Three b) Two c) One d) None of the mentioned
Answer: b
41. Find out the integrating type analog to digital converter?
a) Flash type converter b) Tracking converter
c) Counter type converter d) Dual slope ADC
Answer: d
42. Which type of ADC follow the conversion technique of changing the analog input
signal to a linear function of frequency?
a) Direct type ADC b) Integrating type ADC
c) Both integrating and direct type ADC d) None of the mentioned
Answer: b
43. Which A/D converter is considered to be simplest, fastest and most expensive?
a) Servo converter b) Counter type ADC c) Flash type ADC
d) All of the mentioned
Answer: c
44. The flash type A/D converters are called as
a) Parallel non-inverting A/D converter b) Parallel counter A/D converter
c) Parallel inverting A/D converter d) Parallel comparator A/D converter
Answer: b
45. What is the advantage of using flash type A/D converter?
a) High speed conversion b) Low speed conversion
c) Nominal speed conversion d) None of the mentioned
Answer: a
46. The number of comparator required for flash type A/D converter
a) Triples for each added bit b) Reduce by half for each added bit
c) Double for each added bit d) Doubles exponentially for each added bit
Answer: c
47. Drawback of counter type A/D converter
a) Counter clears automatically b) More complex
c) High conversion time d) Low speed
Answer: d
48. Calculate the conversion time of a 12-bit counter type ADC with 1MHz clock
frequent to convert a full scale input?
a) 4.095 µs b) 4.095ms c) 4.095s d) None of the mentioned
Answer: b
49. In a servo tracking A/D converter, the input voltage is greater than the DAC output
signal at this condition
a) The counter count up b) The counter count down
c) The counter back and forth d) None of the mentioned
Answer: a
50. At what condition error occurs in the servo tracking A/D Converter?
a) Slow change input b) Rapid change in input
c) No change in input d) All of the mentioned
Answer: b
UNIT-III

Programming Fundamentals with c using Arduino IDE:


Arduino is an open-source hardware and software company, project
and user community that designs and manufactures single-board microcontrollers
and microcontroller kits for building digital devices. (Buy Arduino Starter Kit
Here)

Board Components
These are the components that make up an Arduino board and what
each of their functionalities are.
 Reset Button ~ This will restart any code that is loaded to the Arduino
board
 AREF ~ Stands for “Analog Reference” and is used to set an external
reference voltage
 Ground Pin ~ There are a few ground pins on the Arduino and they all
work the same
 Analog Pins ~ These pins read the signal from an analog sensor and
convert it to digital
 Digital Input/Output ~ Pins 0-13 can be used for digital input or output
 PWM ~ The pins marked with the (~) symbol can simulate analog output
 USB Connection ~ Used for powering up your Arduino and uploading
sketches
 TX/RX ~ Transmit and receive data indication LEDs
 ATmega Microcontroller ~ Popular microcontroller chip, this is where
the programs are stored
 Power LED Indicator ~ This LED lights up anytime the board is plugged
in a power source
 Voltage Regulator ~ Controls the amount of voltage going into the
Arduino board
 DC Power Barrel Jack ~ This is used for powering your Arduino with a
power supply
 3.3V Pin ~ This pin supplies 3.3 volts of power
 5V Pin ~ This pin supplies 5 volts of power

Install Arduino Code Editor


The open-source Arduino Software (IDE) makes it easy to write code
and upload it to the board. It runs on Windows, Mac OS X, and Linux. The
environment is written in Java and based on Processing and other open-source
software.

Download Arduino Code Editor


 Navigate to arduino.cc and download The open-source Arduino Software
(IDE) for Windows, MacOSX & Linux. (Click Here)
 Use the Online Code Editor, or scroll down on the arduino download page
to download the version for Windows, MacOSX & Linux.
Blink a LED light
Example Arduino Schema
A step by step example showing how to blink a LED light with an
Arduino, this example provides the board schematics, code and a list of
components that are required.
Components Required
1 × Arduino Uno R3
1 × LED
1 × 330Ω Resistor
Turn On, LED light with a Push Button
A step by step example showing how to Turn On, LED light with a Push Button
on an Arduino, this example provides the board schematics, code and a list of
components that are required.
Example Arduino Schema

Components Required

1 x Breadboard
1 × Arduino Uno R3
1 × LED
1 x Push Button
1 × 330Ω Resistor
5 x Jumper Cables
Example Code (Turn On, LED light with a Push Button)
int ledPin = 13; // The pin the LED is connected to
int inputPin = 2; // The input pin (for a push button)
int inputStatus = 0; // Variable for reading the pin status

// Executes once when the arduino power button is pressed on


void setup() {
pinMode(ledPin, OUTPUT); // Declare the LED as an output
pinMode(inputPin, INPUT); // Declare pushbutton as input
}

// This method repeats forever


// This method makes a led light when button is pushed
void loop() {

// Reads incomming input value from our inputPin


inputStatus = digitalRead(inputPin);

// Check if the input is HIGH (pushbutton released)


if (inputStatus == HIGH) {
digitalWrite(ledPin, LOW); // Turn the LED off
} else {
digitalWrite(ledPin, HIGH); // Turn the LED on
}
}
Using a LRD Light Sensor
A step by step example showing how to Turn On, LED light using a LDR
Light Sensor on an Arduino, this example provides the board schematics, code
and a list of components that are required.
Example Arduino Schema

Components Required
1 x Breadboard
1 × Arduino Uno R3
1 × LED
1 x LRD Light Sensor
1 × 330Ω Resistor
1 x 100k Ohm Resistor
7 x Jumper Cables

Example Code (Using a LRD Light Sensor, to turn on a LED light)


const int ledPin = 13; // The pin the LED is connected to
const int ldrPin = A0; // The pin the LDR sensor is connected to
int ldrStatus = 0; // Variable for reading the pin status

// Executes once when the arduino power button is pressed on


void setup()
{
pinMode(ledPin, OUTPUT); // Declare the LED as an output
pinMode(ldrPin, INPUT); // Declare LDR Sensor as an input
}

// This method repeats forever


void loop()
{
// Read incomming data from LRD sensor pin
ldrStatus = analogRead(ldrPin);

if (ldrStatus <= 400) {


digitalWrite(ledPin, HIGH); //It's dark, Turn on LED
} else {
digitalWrite(ledPin, LOW); // It's bright, Turn off LED
}
}

Run Project with Arduino IDE


 To run the code, on the menu bar, choose Sketch > Upload. The code will
be uploaded to the ATmega Microcontroller
 Press the reset button to restart any code that is loaded to the Arduino
board
Installting and setting up the Arduino IDE:
After learning about the main parts of the Arduino UNO board, we are
ready to learn how to set up the Arduino IDE. Once we learn this, we will be ready
to upload our program on the Arduino board.
In this section, we will learn in easy steps, how to set up the Arduino IDE
on our computer and prepare the board to receive the program via USB cable.
Step 1 − First you must have your Arduino board (you can choose your favorite
board) and a USB cable. In case you use Arduino UNO, Arduino Duemilanove,
Nano, Arduino Mega 2560, or Diecimila, you will need a standard USB cable (A
plug to B plug), the kind you would connect to a USB printer as shown in the
following image.
In case you use Arduino Nano, you will need an A to Mini-B cable instead as
shown in the following image.

Step 2 − Download Arduino IDE Software.


You can get different versions of Arduino IDE from the Download
page on the Arduino Official website. You must select your software, which is
compatible with your operating system (Windows, IOS, or Linux). After your file
download is complete, unzip the file.
Step 3 − Power up your board.
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically
draw power from either, the USB connection to the computer or an external power
supply. If you are using an Arduino Diecimila, you have to make sure that the
board is configured to draw power from the USB connection.
The power source is selected with a jumper, a small piece of plastic that
fits onto two of the three pins between the USB and power jacks. Check that it is
on the two pins closest to the USB port.
Connect the Arduino board to your computer using the USB cable. The
green power LED (labeled PWR) should glow.
Step 4 − Launch Arduino IDE.
After your Arduino IDE software is downloaded, you need to unzip the
folder. Inside the folder, you can find the application icon with an infinity label
(application.exe). Double-click the icon to start the IDE.

Step 5 − Open your first project.


Once the software starts, you have two options −
 Create a new project.
 Open an existing project example.
To create a new project, select File → New.
To open an existing project example, select File → Example → Basics → Blink.
Here, we are selecting just one of the examples with the name Blink. It
turns the LED on and off with some time delay. You can select any other example
from the list.
Step 6 − Select your Arduino board.
To avoid any error while uploading your program to the board, you must
select the correct Arduino board name, which matches with the board connected to
your computer.
Go to Tools → Board and select your board.

Here, we have selected Arduino Uno board according to our tutorial,


but you must select the name matching the board that you are using.
Step 7 − Select your serial port.
Select the serial device of the Arduino board. Go to Tools → Serial
Port menu. This is likely to be COM3 or higher (COM1 and COM2 are usually
reserved for hardware serial ports). To find out, you can disconnect your Arduino
board and re-open the menu, the entry that disappears should be of the Arduino
board. Reconnect the board and select that serial port.

Step 8 − Upload the program to your board.


Before explaining how we can upload our program to the board, we
must demonstrate the function of each symbol appearing in the Arduino IDE
toolbar.
A − Used to check if there is any compilation error.
B − Used to upload a program to the Arduino board.
C − Shortcut used to create a new sketch.
D − Used to directly open one of the example sketch.
E − Used to save your sketch.
F − Serial monitor used to receive serial data from the board and send the serial
data to the board.
Basic Syntax:
Syntax in Arduino signifies the rules need to be followed for the
successful uploading of the Arduino program to the board. The syntax of Arduino
is similar to the grammar in English.
It means that the rules must be followed in order to compile and run our
code successfully. If we break those rules, our computer program may compile and
run, but with some bugs.
Let's understand with an example.
As we open the Arduino IDE, the display will look like the below image:

The two functions that encapsulate the pieces of code in the Arduino program are
shown below:
1. void setup ( )
2. void loop ( )
Functions:
o The functions in Arduino combine many pieces of lines of code into one.
o The functions usually return a value after finishing execution. But here, the
function does not return any value due to the presence of void.
o The setup and loop function have void keyword present in front of their
function name.
o The multiple lines of code that a function encapsulates are written inside
curly brackets.
o Every closing curly bracket ' } ' must match the opening curly bracket '{ ' in
the code.
o We can also write our own functions, which will be discussed later in this
tutorial.
Spaces
o Arduino ignores the white spaces and tabs before the coding statements.
o The coding statements in the code are intent (empty spacing at the starting)
for the easy reading.
o In the function definition, loop, and conditional statements, 1 intent = 2
spaces.
o The compiler of Arduino also ignores the spaces in the parentheses,
commas, blank lines, etc.
Tools Tab
o The verify icon present on the tool tab only compiles the code. It is a quick
method to check that whether the syntax of our program is correct or not.
o To compile, run, and upload the code to the board, we need to click on the
Upload button.
Uses of Parentheses ( )
o It denotes the function like void setup ( ) and void loop ( ).
o The parameter's inputs to the function are enclosed within the parentheses.
o It is also used to change the order of operations in mathematical operations.
Semicolon ;
o It is the statement terminator in the C as well as C++.
o A statement is a command given to the Arduino, which instructs it to take
some kind of action. Hence, the terminator is essential to signify the end of a
statement.
o We can write one or more statements in a single line, but with semicolon
indicating the end of each statement.

Arduino Data Types:


The data types are used to identify the types of data and the associated
functions for handling the data. It is used for declaring functions and variables,
which determines the bit pattern and the storage space.
The data types that we will use in the Arduino are listed below:
o void Data Type
o int Data Type
o Char Data Type
o Float Data Type
o Double Data Type
o Unsigned int Data Type
o short Data Type
o long Data Type
o Unsigned long Data Type
o byte data type
o word data type
void Data Type:
The void data type specifies the empty set of values and only used to
declare the functions. It is used as the return type for the functions that do not
return any value.
Let's understand with an example in Arduino.
Consider the below code.
1. int a = 3;
2. void setup( )
3. {
4. . //
5. }
6. void loop ( )
7. {
8. .
9. .
10. }
Int Data Type:
The integer data types are the whole numbers like 5, -6, 10, -123, etc.
They do not have any fractional part. The integer data types are represented by int.
It is considered as the primary data type to store the numbers.
The size of int is 2 bytes ( 16 bits).
Minimal range: -32768 to 32767 or - (2^ 15) to ((2 ^ 15) - 1)
The syntax is used as:
1. int var = val;
where,
var= variable
value = the value assigned to the variable
For example,
1. int a;
2. int b = 3;
Any variable or identifier becomes an integer variable and can hold only integer
values.
Let's understand with an example in Arduino.
Consider the below code.
1. int Sum = 0;
2. void setup( )
3. {
4. Serial.begin(9600);
5. }
6. void loop ( )
7. {
8. Sum++; // on every loop, it adds 1 to the Sum int
9. Serial.println ( Sum); // it prints the current state of the Sum variable
10. delay(1500); // delay of 1.5 seconds
11. }
Char Data Type:
The char datatype can store any number of character set. An identifier
declared as the char becomes a character variable. The literals are written inside a
single quote.
The char type is often said to be an integer type. It is because, symbols, letters,
etc., are represented in memory by associated number codes and that are only
integers.
The size of character data type is minimum of 8 bits. We can use the byte
data type for an unsigned char data type of 8 bits or 1 byte.
For example, character ' A ' has the ASCII value of 65.
The syntax is:
1. char var = val;
where,
var= variable
val = The value assigned to the variable.
Let's understand with an example.
Consider the below code.
1. char myvariable = ' B ';
2. char myvariable = 66 ; // both the value are equivalent
Float Data Type:
A number having the fractional part and a decimal part is considered as a
floating-point number. For example, 4.567 is a floating-point number. The number
13 is an integer, while 13.0 is a floating-point number.
Due to their greater resolution, fractional numbers are used to approximate
the contiguous and analog values.
The syntax is:
1. float var = val;
where,
var= variable
val = The value assigned to the variable
Let's understand with an example.
Consider the below code.
1. int a ;
2. int b ;
3. float c ;
4. void setup ( )
5. {
6. Serial.begin (9600);
7. }
8. void loop ( )
9. {
10. a = 3 ;
11. b = a/2 ; // b is an integer. It cannot hold fractions. The output will be 1.
12. c = (float) a / 2.0 ; // c now contains 1.5.
13. // Here, we have to use 2.0 instead of 2.
14. }
Double Data Type:
The double data type is also used for handling the decimal or floating-
point numbers. It occupies twice as much memory as float. It stores floating point
numbers with larger precision and range. It stands for double precision floating
point numbers.
It occupies 4 bytes in ATmega and UNO boards, while 8 bytes on Arduino Due.
The syntax is:
1. double var = val;
where,
var= variable
val = The value assigned to the variable
Unsigned int Data Type:
The unsigned int stores the value upto 2 bytes or 16 bits. It stores only
positive values. The range of unsigned int data type is from 0 to 65,535 or 0 to ((2
^ 16) - 1).
Arduino Due stores the unsigned data value of 4 bytes or 32-bits.
The difference between Unsigned and signed data type is the sign bit. The
int type in Arduino is the signed int. In a 16-bit number, 15 bits are interpreted
with the 2's complement, while the high bit is interpreted as the positive or
negative number. If the high bit is '1', it is considered as a negative number.
The syntax is:
1. unsigned int var = val;
where,
var= variable
val = The value assigned to the variable
For example,
1. unsigned int pinofLED = 8;
short Data Type
The short is an integer data type that stores two bytes or 16-bit of data.
The range of short data types is from -32768 to 32767 or - (2^ 15) to ((2 ^
15) - 1). The ARM and ATmega based Arduino's usually stores the data value of 2
bytes.
The syntax is:
1. short var = val;
where,
var= variable
val = the value assigned to the variable
For example,
1. short pinofLED = 8 ;
long Data Type:
The long data types are considered as the extended size variables, which
store 4 bytes (32 -bits). The size ranges from -2,147,483,648 to 2,147,483,647.
While using integer numbers, at least one of the numbers should be
followed by L, which forces the number to be a long data type.
The syntax is:
1. long var = val;
where,
var= variable
val = The value assigned to the variable
For example,
1. long speed = 186000L;
Unsigned long Data Type:
The unsigned long data types are also considered as the extended size
variables, which store 4 bytes (32 -bits). It does not store negative numbers like
other unsigned data types, which makes their size ranges from 0 to 4,294,967,295
or (2^32 - 1).
The syntax is:
1. unsigned long var = val;
where,
var= variable
val = The value assigned to the variable
For example
1. unsigned long currenTtime;
byte:
1 byte = 8 bits.
It is considered as an unsigned number, which stores values from 0 to 255.
The syntax is:
1. byte var = val;
where,
var= variable
value = the value assigned to the variable
For example,
1. byte c = 20;
word:
It is considered as an unsigned number of 16 bits or 2 bytes, which stores values
from 0 to 65535.
The syntax is:
1. word var = val;
where,
var= variable
val = The value assigned to the variable
For example,
1. word c = 2000;
Arduino Variables:
The variables are defined as the place to store the data and values. It
consists of a name, value, and type.
The variables can belong to any data type such as int, float, char, etc.
Consider the url - Arduino data types for detailed information.
Consider the below example:
1. int pin = 8;

Here, the int data type is used to create a variable named pin that stores the
value 8. It also means that value 8 is initialized to the variable pin.
We can modify the name of the variable according to our choice. For example,
The above example can also be written as:
1. int LEDpin = 8;
Here, the variable name is LEDpin.
We can refer the declared variable further in our program or code.
For example,
1. pinMode(LEDpin, OUTPUT);
Here, the value stored (8) in the declared variable (LEDpin) will be passed to the
pinMode() function.
If we have not declared the variable, the value can also be directly passed to the
function.
For example:
1. pinMode( 8, OUTPUT);
Advantages of Variables
The advantages of the variables are listed below:
o We can use a variable many times in a program.
o The variables can represent integers, strings, characters, etc.
o It increases the flexibility of the program.
o We can easily modify the variables. For example, if we want to change the
value of variable LEDpin from 8 to 13, we need to change the only point in
the code.
o We can specify any name for a variable. For example, greenpin, bluePIN,
REDpin, etc.
How can we change the value of a variable in Arduino?
The value of a variable can be changed using the assignment operator ( equal =
sign). But we need to declare a variable before assigning the value.
If we directly specify the value as:
1. pin = 7;
We will get an error that pin has not declared.
We can easily change the variables by copying its value to another variable.
For example,
1. int LEDpin = 7;
2. int pin1 = LEDpin;
3. LEDpin = 13;
The LEDpin now contains the value 13 instead of 7. But, value of pin1 is still 7.
Let's understand with an example.
Consider the below code.
1. void setup()
2. {
3. Serial.begin(9600);
4. int pinLED = 7;
5. Serial.println(pinLED); // value 7 will be printed
6. int pin1 = pinLED;
7. pinLED = 13;
8. Serial.println(pinLED); // value is now changed
9. // now, value 13 will be printed
10. }
11. void loop()
12. {
13. }
Output:

We can notice in the output that the value of LEDpin is changed from 7 to 13.
Similarly, we can change the values of variables.
Variables Scope
It means that in how many ways the variables can be declared.
The variables can be declared in two ways in Arduino, which are listed below:
o Local variables
o Global variables
Local Variables
The local variables are declared within the function. The variables have scope only
within the function. These variables can be used only by the statements that lie
within that function.
For example,
1. void setup()
2. {
3. Serial.begin(9600);
4. }
5. void loop()
6. {
7. int x = 3;
8. int b = 4;
9. int sum = 0;
10. sum = x + b;
11. Serial.println(sum);
12. }
Global Variables
The global variables can be accessed anywhere in the program. The global
variable is declared outside the setup() and loop() function.
For example,
Consider the below code.
1. int LEDpin = 8;
2. void setup()
3. {
4. pinMode(LEDpin, OUTPUT);
5. }
6. void loop()
7. {
8. digitalWrite(LEDpin, HIGH);
9. }
Constants:
The constants in Arduino are defined as the predefined expressions. It
makes the code easy to read.
The constants in Arduino are defined as:
Logical level Constants
The logical level constants are true or false.
The value of true and false are defined as 1 and 0. Any non-zero integer is
determined as true in terms of Boolean language. The true and false constants are
type in lowercase rather than uppercase (such as HIGH, LOW, etc.).
Pin level Constants
The digital pins can take two value HIGH or LOW.
In Arduino, the pin is configured as INPUT or OUTPUT using the
pinMode() function. The pin is further made HIGH or LOW using the
digitalWrite() function.
HIGH
The board includes two types of voltage pins to provide HIGH value,
which are listed below:
o 5V
o 3V
Some boards include only 5V pins, while some include 3.3V.
Some boards consist of both 5V and 3.3V pins. For example, Arduino UNO R3.
The pin configured as HIGH is set at either 5V or 3.3V.
The pins are configured at the 5V or 3.3V depending on:
o for voltage > 3.0V (presented at 5V pin)
o for voltage > 2.0V (presented at 3.3V pin)
LOW
The pin configured as LOW is set at 0 Volts.
The pins are configured at the 5V or 3.3V depending on:
o for voltage < 1.5V (presented at 5V pin)
o for voltage < 1V (presented at 3.3V pin)
LED_BUILTIN Constant
The Arduino boards have built-in LED connected in series with the
resistor. The particular pin number is defined with the constant name called
LED_BUILTIN.
Most Arduino boards have the LED_BUILTIN connected to Pin number 13.
Constant Keyword
It modifies the behavior of the variables in our program. It further makes
the variable as 'read-only'.
The variable will remain the same as other variables, but its value cannot be
changed.
It means we cannot modify the constant. For example,
1. const int a =2;
2. //....
3. a = 7; // illegal - we cannot write to or modify a constant
The const keyword is considered superior compared to the #define keyword
because it obeys the rules of the variable scope.
For example,
Consider the below code:
1. const float x = 5.68;
2. float y;
3. void setup()
4. {
5. Serial.begin(9600);
6. y = x * 2; // we can also use constants in math
7. Serial.println(y);
8. }
9. void loop()
10. {
11. // ....
Output: 11.36
Arduino Operators:
The operators are widely used in Arduino programming from basics to
advanced levels. It plays a crucial role in every programming concept
like C, C++, Java, etc.
The operators are used to solve logical and mathematical problems. For
example, to calculate the temperature given by the sensor based on some analog
voltage.
The types of Operators classified in Arduino are:
1. Arithmetic Operators
2. Compound Operators
3. Boolean Operators
4. Comparison Operators
5. Bitwise Operators
Arithmetic Operators
There are six basic operators responsible for performing mathematical
operations in Arduino, which are listed below:
o Assignment Operator ( = )
The Assignment operator in Arduino is used to set the variable's value. It is quite
different from the equal symbol (=) normally used in mathematics.
o Addition ( + )
The addition operator is used for the addition of two numbers. For example, P + Q.
o Subtraction ( - )
Subtraction is used to subtract one value from the another. For example, P - Q.
o Multiplication ( * )
The multiplication is used to multiply two numbers. For example, P * Q.
o Division ( / )
The division is used to determine the result of one number divided with another.
For example, P/Q.
o Modulo ( % )
The Modulo operator is used to calculate the remainder after the division of one
number by another number.
Most of the operators are similar to the usual operator used in mathematics.
Let's understand the operators with the help of two examples.
Example 1:
Consider the below code.
1. int b;
2. void setup ( )
3. {
4. Serial.begin( 9600 );
5. }
6. void loop ( )
7. {
8. b = 5 + 2;
9. Serial.println(b);
10. }
In the above code, we have assigned the result of the addition of two
numbers to b before printing it to the console.
For output, click on the Upload and Serial Monitor button present on the toolbar.
Output: 7
Example 2:
Consider the below code:
1. int d;
2. void setup ( )
3. {
4. Serial.begin( 9600 );
5. }
6. void loop ( )
7. {
8. d = 5 - 2;
9. Serial.println(d);
10. d = d + 3;
11. Serial.println(d);
12. }
Here, d= d +3 is not operated as a usual mathematical operation. It is the
assignment operator where right of the function is evaluated first and is assigned to
the left of the equal sign.
Let's consider the below image for better understanding.

Output:
3
6
Compound Operators:
The compound operators perform two or more calculations at once.
The result of the right operand is assigned to the left operand, as already
discussed above. The same condition will apply to all the compound operators,
which are listed below:
Let's consider a variable b.
o b++
Here, b = b + 1. It is called the increment operator.
o b+=
For example, b + = 4. It means, b = b+ 4.
o b--
Here, b = b - 1. It is called as the decrement operator.
o b-=
For example, b - = 3. It means, b = b - 3.
o b*=
For example, b * = 6. It means, b = b * 6.
o b/=
For example, b / = 5. It means, b = b / 5.
o b%=
For example, b % = 2. It means, b = b % 2.
Now, let's use the above operators with two variables, b and c.
o b + = c ( b = b + c)
o b - = c ( b = b - c)
o b * = c ( b = b * c)
o b / = c ( b = b / c)
o b % = c ( b = b % c)
We can specify any variable instead of b and c.
Boolean Operators:
The Boolean Operators are NOT ( ! ), Logical AND ( & & ), and Logical OR ( | |
).
Let's discuss the above operators in detail.
o Logical AND ( & & )
The result of the condition is true if both the operands in the condition are true.
Consider the below example:
1. if ( a = = b & & b = = c )
Above statement is true if both conditions are true. If any of the conditions is false,
the statement will be false.
o Logical OR ( | | )
The result of the condition is true, if either of the variables in the condition is true.
Consider the below example.
1. if ( a > 0 | | b > 0 )
The above statement is true, if either of the above condition ( a> 0 or b > 0 ) is true.
o NOT ( ! )
It is used to reverse the logical state of the operand.
For example, a ! = 2.
The NOT operator returns the value 1 or TRUE when the specified operand is
FALSE. It also reverses the value of the specified expression.
Comparison Operators:
The comparison operators are used to compare the value of one variable with
the other.
The comparison operators are listed below:
o less than ( < )
The less than operator checks that the value of the left operand is less than the right
operand. The statement is true if the condition is satisfied.
Consider the below code.
1. int b;
2. int c ;
3. void setup ( )
4. {
5. Serial.begin( 9600 );
6. }
7. void loop ( )
8. {
9. b = 3;
10. c = 5;
11. if ( b < 4 )
12. Serial.println(b);
13. if ( c < 4)
14. Serial.println( c);
15. }
Output: 3
In the above code, if any of the two statement is correct, the
corresponding value of the variable will be printed. Here, only first condition is
correct. Hence, the value of b will be printed.
o greater than ( > )
The less than operator checks that the value of the left side of a statement
is greater than the right side. The statement is true if the condition is satisfied.
For example, a > b.
If a is greater than b, the condition is true, else false.
o equal to ( = = )
It checks the value of two operands. If the values are equal, the condition is
satisfied.
For example, a = = b.
The above statement is used to check if the value of a is equal to b or not.
o not equal to ( ! = )
It checks the value of two specified variables. If the values are not equal,
the condition will be correct and satisfied.
For example, a ! = b.
o less than or equal to ( < = )
The less or equal than operator checks that the value of left side of a
statement is less or equal to the value on right side. The statement is true if either
of the condition is satisfied.
For example, a < = b
It checks the value of a is less or equal than b.
o greater than or equal to ( > = )
The greater or equal than operator checks that the value of the left side of a
statement is greater or equal to the value on the right side of that statement. The
statement is true if the condition is satisfied.
For example, a > = b
It checks the value of a is greater or equal than b. If either of the condition satisfies,
the statement is true.
Bitwise Operators
The Bitwise operators operate at the binary level. These operators are quite
easy to use.
There are various bitwise operators. Some of the popular operators are listed
below:
o bitwise NOT ( ~ )
The bitwise NOT operator acts as a complement for reversing the bits.
For example, if b = 1, the NOT operator will make the value of b = 0.
Let's understand with another example.
1. 0 0 1 1 // Input or operand 1 ( decimal value 3)
2. 1 1 0 0 // Output ( reverses the input bits ) decimal value is 12
o bitwise XOR ( ^ )
The output is 0 if both the inputs are same, and it is 1 if the two input bits are
different.
For example,
For example,
1. 1 0 0 1 // input 1 or operand 1
2. 0 1 0 1 // input 2
3. 1 1 0 0 // Output ( resultant - XOR)
o bitwise OR ( | )
The output is 0 if both of the inputs in the OR operation are 0. Otherwise, the
output is 1. The two input patterns are of 4 bits.
For example,
1. 1 1 0 0 // input 1 or operand 1
2. 0 0 0 1 // input 2
3. 1 1 0 1 // Output ( resultant - OR)
o bitwise AND ( & )
The output is 1 if both the inputs in the AND operation are 1. Otherwise, the output
is 0. The two input patterns are of 4 bits.
For example,
1. 1 1 0 0 // input 1 or operand 1
2. 0 1 0 1 // input 2
3. 0 1 0 0 // Output ( resultant - AND)
o bitwise left shift ( < < )
The left operator is shifted by the number of bits defined by the right operator.
o bitwise right shift ( > > )
The right operator is shifted by the number of bits defined by the left operator.

Conditional statement:
Arduino If statement
The if ( ) statement is the conditional statement, which is the basis for all
types of programming languages.
If the condition in the code is true, the corresponding task or function is
performed accordingly. It returns one value if the condition in a program is true. It
further returns another value if the condition is false.
It means that if ( ) statement checks for the condition and then executes a
statement or a set of statements.
Let's understand the concept with the help of a flow chart.
It clearly explains the process of execution of a statement. If the condition is False,
it comes out of the if ( ) statement. If the condition is true, the function is
performed.
The if ( ) statement is written as:
1. if ( condition)
2. {
3. // include statements
4. // if the condition is true
5. // then performs the function or task specified inside the curly braces
6. }
Here,
condition = It includes the boolean expressions, that can be true or false.
We can also use one or more operators inside the parentheses.
The comparison operators that can be used as a condition inside the parentheses are
listed below:
o a ! = b ( a not equal to b )
o a < b ( a less than b )
o a > b ( a greater than b )
o a = = b ( a equal to b )
o a < = b ( a less than or equal to b )
o a > = b ( a greater than or equal to b )
where,
a and b are the variables.
Code Examples
Let's understand with the help of two coding examples.
Example 1:
Consider the below code.
1. int a = 6; // initiaization of values to variables a and b
2. int b = 4;
3. void setup()
4. {
5. Serial.begin(9600);
6. }
7. void loop()
8. {
9. if (a > b )
10. {
11. Serial.println( " a is greater than b ");
12. }
13. if (b > a )
14. {
15. Serial.println( " b is greater than a ");
16. }
17. }
Output: a is greater than b
The code shows the initialization of values to the two variables a and b. In this
example, the first condition is True. Hence the corresponding information is
printed.
Example 2:
Consider the below code.
1. const int LED1 = 2;
2. const int LED2 = 13;
3. int x = 80 ;
4. void setup ( )
5. {
6. Serial.begin( 9600 );
7. pinMode ( LED1, OUTPUT);
8. pinMode ( LED2, OUTPUT);
9. }
10. void loop ( )
11. {
12. if ( x > 100 )
13. {
14. digitalWrite(LED1, HIGH);
15. delay (500);
16. }
17. if ( x < 100 )
18. {
19. digitalWrite(LED2, HIGH);
20. delay (500);
21. }
22. }
The example is of two LEDs.
In the above example, we have initialized the value of x. Since the value of x is
less than 100, the second condition is true. Hence, LED2 will light up.
If the value of x is greater than 100, LED1 will light.
Arduino if-else and else-if
The else and else-if both are used after specifying the if statement. It
allows multiple conditions to be grouped.
If else
The if-else condition includes if ( ) statement and else ( ) statement. The
condition in the else statement is executed if the result of the If ( ) statement is
false.
The flowchart is shown below:

Let's understand with an example.


1. if (condition)
2. {
3. // statements
4. }
5. else
6. {
7. //statements
8. }
The else( ) statement can also include other if statements. Due to this, we
can run multiple statements in a single program.
The flowchart is shown below:

The statements will be executed one by one until the true statement is
found. When the true statement is found, it will skip all other if and else statements
in the code and runs the associated blocks of code.
Code Example
Let's understand if else statement with the help of two examples.

Example 1:
Consider the below code.
1. int a = 5;
2. int b= 6;
3. void setup ( )
4. {
5. Serial.begin ( 9600 );
6. }
7. void loop ( )
8. {
9. if ( a > b )
10. {
11. Serial.println ( " a is greater " );
12. }
13. else
14. {
15. Serial.println ( " a is smaller " );
16. }
17. }
In the above example, the values are initialized to the variables a and b. The
message concerning the satisfied condition will be printed.
Else if
The else if statement can be used with or without the else ( ) statement. We can
include multiple else if statements in a program.
Let's understand with an example.
1. if (condition)
2. {
3. // statements
4. }
5. else if ( condition)
6. {
7. // statements
8. // only if the first condition is false and the second is true
9. }
10. else
11. {
12. //statements
13. }
Code Example
Let's understand else-if statement with the help of an example.
Example 1:
Consider the below code.
1. int i = 2;
2. int j = 3;
3. void setup ( )
4. {
5. Serial.begin(9600);
6. }
7. void loop ( )
8. {
9. if ( i > j )
10. {
11. Serial.println( " I is greater ");
12. }
13. else if ( i < j )
14. {
15. Serial.println( " J is greater " );
16. }
17. else
18. {
19. Serial.println( " Both are equal " );
20. }
21. }
Output: J is greater
The else if ( ) statement will stop the flow once its execution is true.
Arduino for Loop:
The statements inside the curly brackets under for loop are executed
repeatedly according to the specified condition. An increment counter in the for
loop is used to increment or decrement the loop repetitions.
The for statement is commonly used for repetitive task or operation or to
operate on the group of data/pins in combination with arrays.

The syntax is:


1. for (initialization; condition; increment)
2. {
3. \\ statements
4. }
where,
o initialization: It is defined as the initialization of the variable.
o condition: The condition is tested on every execution. If the condition
is true, it will execute the given task. The loop ends only when the condition
becomes false.
o increment: It includes the increment operator, such as i + +, i - - , i + 1, etc.
It is incremented each time until the condition remains true.
For example,
1. for ( i = 0 ; i < 5 ; i + +)
The above statement will execute the loop for five times. The values of i will be
from 0 to 4.
If the statement is:
1. for ( i = 0 ; i < = 5 ; i + +)
The above statement will execute the loop six times. The values of i will be from 0
to 5.
Example 1:
To overcome this, programmers prefer to use for loop to execute a task
multiple times, while using a single statement.
Let's consider the below code.
1. int i;
2. void setup ( )
3. {
4. Serial.begin(9600);
5. for ( i = 0 ; i < 15 ; i ++ )
6. {
7. Serial.println( "Arduino");
8. }
9. }
10. void loop ( ) {
11. }
Output:

Example 2:
To use a multiplication increment
The multiplication increment in the for loop will generate a logarithmic
progression.
Consider the below code:
1. int x;
2. void setup ( )
3. {
4. Serial.begin(9600);
5. for (x = 2; x < 100; x = x * 2)
6. {
7. Serial.println(x);
8. }
9. }
10. void loop ( ) {
11. }
Output:

We can also declare the int data type directly in the for loop.
Arduino while loop:
The while loop() is the conditional loop that continues to execute the code
inside the parentheses until the specified condition becomes false.
The while loop will never exit until the tested condition is changed or
made to stop. The common use of a while loop in Arduino includes sensor testing,
calibration (calibrating the input of sensor), variable increment, etc.
The syntax is:
1. while (condition)
2. {
3. // code or set of statements
4. }
where,
condition: It specifies the boolean expression, which determines the condition to
be true or false.
For example,
1. variable = 0;
2. while (variable < 100) {
3. // performs the specified task 100 times repeatedly
4. variable++ ; // increments after every execution
5. }
The above code inside the curly braces in while loop will execute continuously and
repeatedly as long as the variable is less than 100.
Flowchart
The flowchart is shown below:

Code Example
In order to change the flow of the program, we need to change the specified
condition inside the parentheses of while loop. The process is much like the if
statement.
Let's understand the concept of while loop with two examples.
Example 1:
Consider the below code:
1. int a = 0;
2. void setup()
3. {
4. Serial.begin(9600);
5. while( a < 5)
6. {
7. Serial.println("Welcome to Arduino");
8. a = a + 1;
9. }
10. }
11. void loop()
12. {
13. }

Output:
The message inside the loop will be printed five times, as shown below:

Let's look at the code


Arduino switch case:
The switch case controls the flow of the program by executing the code
in various cases. A switch statement compares a particular value of a variable with
statements in other cases.
When the statements in a case matches the value of a variable, the code
associated with that case executes.
The break keyword is used at the end of each case. For example, if there
are five cases, the break statements will also be five. The break statement exits the
switch case.
The switch statement without a break will continue to execute all the
cases until the end. Hence, it is essential to include a break statement at the end of
each case.
Let's understand with an example.
1. switch(variable)
2. {
3. case 1:
4. // statements related to case1
5. break;
6. case 2:
7. // statements related to case2
8. break;
9. .
10. .
11. case n:
12. // statements related to case n
13. break;
14. default:
15. // it contains the optional code
16. //if nothing matches in the above cases, the default statement runs
17. break;
18. }
where,
variable: It includes the variables whose value will be compared with the multiple
cases
value: It consists of a value to compare. These values are constants. The allowed
data types are int and char.
Flowchart of the switch case
Consider the below flowchart:
The if statement allows us to choose between the two options, TRUE or
FALSE. We can also use multiple if statements for more than two cases. The
switch case allows us to choose between various discrete options.
Code Example
We will include the switch case in the setup() function, as we do not require the
repeated execution.
Consider the below code:
1. // switch case example
2. void setup()
3. {
4. Serial.begin(9600);
5. int a = 1;
6. switch(a) // the case matching the value in the declared variable will run
7. {
8. case 1:
9. Serial.println(" Case 1 matches");
10. // the value of variable matches with the value in case 1.
11. // The message associated with case 1 will be printed
12. break;
13. case 2:
14. Serial.println(" Case 2 matches");
15. break;
16. case 3:
17. Serial.println(" Case 3 matches");
18. break;
19. default:
20. Serial.println(" default matches");
21. break;
22. }
23. }
24. void loop()
25. {
26. }
Output:

Using Arduino C Library Function for serial,delay and invoking Function:


Serial.available( )

The Serial.available( ) function in Arduino gets the stored bytes from


the serial port that are available for reading. It is the data, which is already stored
and arrived in the serial buffer. The serial buffer in Arduino holds the 64 bytes.

Serial.available( ) function inherits from the utility class called stream.


The stream is only invoked when the function relying on it is called. The stream
class is considered as the base class for binary and character-based streams.
Let's understand with an example.

Consider the below code.

1. int arrivingdatabyte = 0; // initializing the incoming serial byte


2. void setup( )
3. {
4. Serial.begin(9600); // 9600 is the data rate in bps (bits per second).
5. }
6. void loop( ) // loop function that executes repeatedly
7. {
8. if(Serial.available( ) > 0) // It will only send data when the received data is greater
than 0.
9. {
10. arrivingdatabyte = Serial.read( ); // It will read the incoming or arriving data byte
11. Serial.print("data byte received:");
12. Serial.println(arrivingdatabyte, DEC); // here, DEC means Decimal
13. }
14. }

In case of the Arduino Mega, the ports available are:

Serial1.available( )

Serial2.available( )

Serial3.available( )

Let's understand the concept of Mega with an example.

In this example, the data will be read and sent from one port to another.

It will read data from port 0 and will then send the data to port 1.

Consider the below code.

1. void setup( )
2. {
3. Serial.begin(4800);
4. Serial1.begin(4800);
5. }
6. // two if conditions will be used.
7. //In first, if the data is available in the port 0, it will send to the port 1. In second, if
the data is available in the port 1, it will send to the port 0.
8. void loop( )
9. {
10. // Now,the data will be read from port 0 and will be sent to the port 1.
11. if( Serial.available( ) )
12. {
13. int incomingdatabyte = Serial.read( );
14. Serial1.print('incomingdatabyte, byte');
15. }
16. // Now,the data will be read from port 1 and will be sent to the port 0.
17. if( Serial1.available( ) )
18. {
19. int incomingdatabyte = Serial1.read( );
20. Serial.print('incomingdatabyte, byte');
21. }
22. }

We can also check the errors in our code by compiling. For that, click on
the Verify button.

The Arduino screen will look like the below image:


Arduino Delay:
Here, Arduino Delay specifies the delay( ) function used in
the Arduino programming. Let's discuss the delay( ) function in detail.
delay( ) function
The delay( ) function pauses the program or task for a specified duration
of time. The time is specified inside the open and closed parentheses in
milliseconds.
Where,
1 second = 1000 milliseconds
Example 1:
delay(500)
Here, the specified time is 0.5 seconds.
It is shown below:

The program waits for a specified duration before proceeding onto the
next line of the code. The delay( ) function allows the unsigned long data type in
the code.
The Drawback of using delay( ) in the sketch
The delay( ) cease (stops) the other activities, such as manipulation of
pins on the board, mathematical calculations, reading of other sensors during
the delay function. The programmers usually avoid delay( ) of more than 10
seconds in the sketch.
Let's understand the delay() function with the help of two examples.
Example 1:
Consider the below code.
1. int LEDlightPin = 8; // PIN 8 of the Arduino board initialized to the LED
2. // We can specify the variable according to our choice.
3. // For example, int PINonboard= 8
4. void setup( )
5. {
6. pinMode( LEDlightPin, OUTPUT) // the digital pin on board is set as the Output.
7. }
8. void loop( )
9. {
10. digitalWrite(LEDlightPin, HIGH);
11. delay(1500); // The LED will light/ON for 1.5 seconds = 1500 milliseconds
12. digitalWrite(LEDlightPin, LOW);
13. delay(500); // The LED will dim/OFF for 0.5 seconds = 0.5x1000 = 500 millisecon
ds
14. //We can modify the time duration accoordingly.
15. }
Example 2:
Consider the below code:
1. void setup ( )
2. {
3. Serial.begin ( 4800); //opens the serial port and set the bits per rate to 4800
4. }
5. void loop ( )
6. {
7. Serial.print(" Welcome");
8. delay(1000);
9. Serial.println("to delay"); // It will print 'to delay' followed by a new line.
10. delay ( 500); // delay of 0.5 seconds between each printed line.
11. }
Output:
Welcome to delay
Welcome to delay
.
.
.
.
The output will be printed repeatedly.
Strings and Mathematics Library functions:
The predefined functions which are designed to handle strings are available in
the library string.h. They are −
 strlen ()
 strcmp ()
 strcpy ()
 strncmp ()
 strncpy ()
 strrev ()
 strcat ()
 strstr ()
 strncat ()
The strlen () function:
It returns the number of characters in a string.
Syntax
int strlen (string name)
Example
#include <string.h>
main (){
char a[30] = “Hello”;
int l;
l = strlen (a);
printf (“length of the string = %d”, l);
getch ();
}
Output
length of the string = 5
The strcpy () function:
 It is for copying source string into destination string.
 The length of the destination string >= source string.
Syntax
strcpy (Destination string, Source String);
For example,
1) char a[50];
strcpy (“Hello”,a);
o/p: error
2) char a[50];
strcpy ( a,”hello”);
o/p: a= “Hello”
Example
#include <string.h>
main (){
char a[50], b[50];
printf ("enter a source string");
scanf("%s", a);
printf("enter destination string");
scanf("%s",b);
strcpy ( b,a);
printf ("copied string = %s",b);
getch ();
}
Output
Enter a source string : Hello
Copied string = Hello
The strncpy () function:
 It copy’s ‘n’ characters of source string into destination string.
 The length of the destination string must >= that of the source string.
Syntax
strncpy (Destination string, Source String, n);

Example
#include<string.h>
main (){
char a[50], b[50];
printf ("enter a string");
gets (a);
gets(b);
strncpy (b,a,3);// copy first 3 char from a string
b[3] = '\0';
printf ("copied string = %s",b);
getch ();
}
Output
Enter a string : Hello
Copied string = Hel
It is also used for extracting substrings;
The strcat () function:
 It combines two strings.
 The length of the destination string must be > than the source string.
Syntax
strcat (Destination String, Source string);

Example
#include <string.h>
main(){
char a[50] = "Hello";
char b[20] = "Good Morning";
clrscr ();
strcat (a,b);
printf("concatenated string = %s", a);
getch ();
}
Output
Concatenated string = Hello Good Morning
The strncat () function:
 This is used for combining or concatenating n characters of one string into
another.
 The length of the destination string must be greater than the source string
 The resultant concatenated string will be in the destination string.
Syntax
strncat (Destination String, Source string,n);
Example
#include <string.h>
main (){
char a [30] = “Hello”;
char b [20] = “Good Morning”;
clrscr ();
strncat (a,b,4);
a [9] = ‘\0’;
printf(“concatenated string = %s”, a);
getch ();
}
Output
Concatenated string = Hello Good.

The strcmp() function (String comparison):


 This function compares 2 strings.
 It returns the ASCII difference of the first two non – matching characters in
both the strings.
Syntax
int strcmp (string1, string2);
//If the difference is equal to zero, then string1 = string2
//If the difference is positive, then string1 > string2
//If the difference is negative, then string1 < string2
Example
#include<stdio.h>
#include<string.h>
int main (){
char a[50], b [50];
int d;
printf ("Enter 2 strings:");
scanf ("%s %s", a,b);
d = strcmp(a,b);
if (d==0){
printf("%s is (alphabetically) equal to %s", a,b);
}else if (d>0){
printf("%s is (alphabetically) greater than %s",a,b);
}else if (d<0){
printf("%s is (alphabetically) less than %s", a,b);
}
}
Output
Enter 2 strings:apple ball
apple is (alphabetically) less than ball
The strncmp () function:
This function is used for comparing first ‘n’ characters of 2 strings.
Syntax
strncmp ( string1, string2,2)
For example, char a[10] = “the”;
char b[10] = “there”
strncmp (a,b,4);
Output − Both strings are equal
The strrev() function:
 The function is used for reversing a string.
 The reversed string will be stored in the same string.
Syntax
strrev (string)
Example
#include<stdio.h>
main (){
char a[50] ;
clrscr();
printf ("enter a string");
gets (a);
strrev (a);
printf("reversed string = %s",a)
getch ();
}
Output
enter a string Hello
reversed string = olleH
The strstr() function:
 It is used to search whether a substring is present in the main string or not.
 It returns pointer to first occurrence of s2 in s1.

Syntax
strstr(mainsring,substring);
Example
#include<stdio.h>
void main(){
char a[30],b[30];
char *found;
printf("Enter a string:\t");
gets(a);
printf("Enter the string to be searched for:\t");
gets(b);
found=strstr(a,b);
if(found)
printf("%s is found in %s in %d position",b,a,found-a);
else
printf("-1 since the string is not found");
getch();
}
Output
Enter a string: how are you
Enter the string to be searched for: you
you is found in 8 position

5MARKS:
1. Explain about the Installing and setting up the arduino IDE?
2 .Explain about Basic syntax and data type ,variable?
3 .Short note conditional statement?
4. what is a strings and mathematics library function?
5.Explain about the delay?

10 MARKS:
1.Explain about the constants?
2.Discuss about programming fundamentals with c Arduino?
3.Explain about the operators and loops?
1. What is Arduino?
a) Programming language b) Image editing software
c) Open-source electronics platform d) Text editor
Answer: c
2. How many types of Arduino do we have?
a) 4 b) 8 c) 12 d) 16
Answer: b
3. What language is a typical Arduino code based on?
a) Assembly Code b) Python c) Java d) C/C++
Answer: d
4. Arduino shields are also called as _________
a) Another Arduinos b) Extra peripherals
c) Add on modules d) Connectivity modules
Answer: c
5. What language is the Arduino IDE built on?
a) Java b) HTML c) C/C++ d) Python
Answer: a
6. How many analog pins are used in Arduino Mega board?
a) 12 b) 16 c) 8 d) 14
Answer: b
7. Arduino IDE consists of 2 functions. What are they?
a) Loop() and build() and setup() b) Build() and loop()
c) Setup() and build() d) Setup() and loop()
Answer: d
8. Arduino Codes are referred to as ________ in the Arduino IDE.
a) sketches b) drawings c) links d) notes
Answer: a
9. What is the default bootloader of the Arduino UNO?
a) AIR-boot b) GAG c) Optiboot bootloader d) Bare box
Answer: c
10. What does p refer to in ATmega328p?
a) Programmable on chip b) Power-Pico c) Production d) Pico-Power
Answer: d
11. What is the use of the Arduino.h header file?
a) It enables the programmer to access all of Arduino’s core functionality
b) It doesn’t have any use and can be omitted at any point of time in the code
c) It gives root access to the microcontroller’s file system
d) It allows other people to create libraries for the Arduino code
Answer: a
12. What is the use of the Vin pin present on some Arduino Boards?
a) To ground the Arduino Board b) To power the Arduino Board
c) To provide a 5V output d) Is used for plugging in 3V supply
Answer: b
13. What is the correct execution process of an Arduino code?
a) Editor->Preprocessor->Compiler b) Preprocessor->Editor->Compiler
c) Compiler->Preprocessor->Editor d) Editor->Compiler->Preprocessor
Answer: a
14. What is the microcontroller used in Arduino UNO?
a) ATmega32114 b) AT91SAM3x8E c) ATmega2560
d) ATmega328p
Answer: d
15. Which board is the first to use a microcontroller within the build USB?
a) RedBoard b) Leonardo c) LilyPad d) UNO
Answer: b
16. Which Arduino Board contains an onboard joystick?
a) Arduino Nano b) Arduino UNO c) Arduino Esplora d) Arduino Due
Answer: c
17. What is the function of the IOREF pin on the Arduino UNO?
a) To take input voltage and set it as a reference for all GPIO operations
b) To provide a constant 12V DC supply
c) To provide ground
d) To provide the voltage corresponding to the standard GPIO working voltage of
the board
Answer: d
18. Which processor supports the Arduino Zero?
a) ARM Cortex M0+ b) ARM Cortex M3 c) Atmega32u4
d) Atmega328P
Answer: a
19. Which software is used to upload the Arduino Sketches to the board?
a) avrgcc b) g++ c) cpython for windows d) avrdude
Answer: d
20. What is the use for the 2 serial pins on the Arduino Diecimila?
a) To send PWM signals b) To send and receive Serial TTL signals
c) To send and receive GPIO digital signals
d) To receive analog signals
Answer: b
21. Which Arduino Boards use the Atmega2560?
a) Arduino Micro and Due b) Arduino Nano and Fio
c) Arduino Mega and Mega ADK d) Arduino Uno and Robot
Answer: c
22. What is the operating voltage of Atmega328?
a) 1.9V to 5V b) 1.8V to 5.5V c) 1.1V to 5V d) 12V to 9V
Answer: b
23. Which Arduino Boards use the Atmega32U4?
a) Arduino Uno b) None Mega c) Arduino Micro d) Arduino Leonardo
Answer: d
24. Is the Arduino code an Object-Oriented programming language or a Procedural
programming language?
a) The Arduino Code follows the Top-Down Procedural ideology
b) The Arduino Code follows a custom Procedural Ideology
c) The Arduino Code follows the Object-Oriented ideology
d) The Arduino Code follows the Bottom-Up Procedural ideology
Answer: c
25. What is the difference between an IDE and a compiler?
a) The compiler executes the code while the IDE gives a graphical environment for
writing the code
b) The compiler links the code to the respective files and the IDE takes it from
there
c) The compiler and the IDE are the same thing
d) The IDE executes the code while the compiler gives a graphical environment for
writing the code
Answer: a
26. Where does the Arduino IDE search if it needs to find out the Name of a type
of Arduino Board?
a) Arduino.h b) build.txt c) boards.txt d) build.core
Answer: c
27. How many times does the setup() function run on every startup of the Arduino
System?
a) 4 b) 5 c) 2 d) 1
Answer: d
28. Which of the following statements is not true when dealing with the Firmata
library?
a) The Firmata Library uses the Firmata Protocol for communicating data
b) The Firmata Library uses the Midi Message Format
c) The Firmata Library can only be used on an Arduino Uno
d) The Firmata Library is used to establish communications between the Arduino
and the Desktop
Answer: c
29. Which Arduino Board does the SigFox Library work with?
a) Arduino MKRFOX1200 b) Arduino MKRZero
c) Arduino MKRFOX1230 d) Arduino MKR1000
Answer: a
30. What technology does the OV7670 Camera Module use for image sub-
sampling?
a) ConstPix b) Activarr c) Tidal d) VarioPixel
Answer: d
31. What will be the output of the following Arduino code?
void main() {
int a = 0;
double d = 10.21;
printf("%lu", sizeof(a + d));
}
void loop() {}
a) 10.21 b) 8 c) null d) 23
Answer: b
32. What is the use of the ESP8266 WiFi Module?
a) Network Provider b) Switches circuits
c) Evaluates air pressure d) Monitors Motion
Answer: a
33. What is the full form of EEPROM?
a) Electrically Encoded Programmable Read Only Memory
b) Encrypted Electronic Programmable Read Only Memory
c) Electrically Erasable Programmable Read Only Memory
d) Electronic Embedded Programmable Read Only Memory
Answer: c
34. Why is the Arduino Mega more a viable solution when dealing with complex
projects, than the Arduino UNO?
a) More flash memory on the Arduino Mega
b) Higher power rating on the Arduino Mega
c) Higher SRAM on the Arduino Mega
d) More number of GPIO pins on the Arduino Mega
Answer: b
35. The Atmega168 is an ________ bit chip.
a) 32 b) 64 c) 8 d) 16
Answer: c
36. Why does every compilation of a source code in Arduino check for previous
compilations?
a) To copy the previously generated “.o” files
b) To relocate the previously generated “.o” files
c) To delete the previously generated “.o” files
d) To use the previously generated “.o” files
Answer: d
37. What type of signal does the analogWrite() function output?
a) Pulse Code Modulated Signal b) Frequency Modulated Signal
c) Pulse Width Modulated Signal d) Pulse Amplitude Modulated Signal
Answer: c
38. What is the use of the SD.h Library in Arduino?
a) To communicate with the computer
b) To communicate with the internet
c) To communicate with the SD Card Module
d) To communicate with another microcontroller
Answer: c
39. What is the use of the Ethernet library?
a) To connect the Arduino to Ethernet b) To connect the Arduino to Li-Fi
c) To connect the Arduino to Bluetooth d) To connect the Arduino to Wi-Fi
Answer: a
40. What is the purpose of the following Arduino code?
1. void setup() {
2. Seria.begin(9600);
3. }
4. void setup() {
5. Serial.write(40);
6. }
a) Send a signal to pin 40 on the Arduino board
b) Send a octal number of 40 through the Serial pins
c) Send a byte with value 40 through the Serial pins
d) Send a hexadecimal number of 40 through the Serial pins
Answer: c
41. Which chipset is the LCD library for Arduino based on?
a) Hitachi HDD4780 b) Hitachi HD46780
c) Hitachi HD45780 d) Hitachi HD44780
Answer: d
42. What is the resolution of the micros() function on the Arduino Nano?
a) 7 Microseconds b) 4 Microseconds
c) 6 Microseconds d) 2 Microseconds
Answer: b
43. What is the use of the Interrupt Service Routine in an Arduino?
a) To boot up the arduino b) To exit any code that is running
c) To automate functions d) To make more memory
Answer: c
44. What mode should we put the Arduino pin to, in order for object detection to
work with the Ultrasonic Sensor?
a) TDM b) PCM c) Analog d) Digital
Answer: d
45. What will happen if we supply a voltage of 25V to the Vcc of the Nokia 5110
GDM?
a) Module will function normally b) Damage is caused
c) Module will shut down d) Module will not respond for the time the
voltage is applied
Answer: b
46. Which port on any Arduino board should be connected to the Key Port on the
Adafruit FONA 3G+GPS Breakout?
a) Gnd b) Any Analog Pin c) Vcc d) Any Digital Pin
Answer: a
47. What is the way of throwing an error using preprocessing directives to the
Arduino Compiler and forcing it to stop compilation?
a) #warning b) #stop c) #cut d) #error
Answer: d
48.What is the role of Bigdata in smart grid architecture of IoT?
a) Store data b) Manage data c) Collect data d) Security
Answer: a
49. What is the role of Gateway in smart grid architecture of IoT?
a) Store data b) Manage data c) Collect data d) Security
Answer: c
50. What is the role of Sensor in smart grid architecture of IoT?
a) Store data b) Manage data c) Collect data d) Security
Answer: a
UNIT-IV

Sensors and Actuators :

The Internet of Things is a major contributing factor of the new Data


Economy. The value of an IoT system goes beyond the original intended use case,
for instance in automation.
This is because further value lies in the intelligence that an IoT system
creates. Sensors are the source of IoT data. Furthermore, sensors and actuators in
IoT can work together to enable automation at industrial scale.
Finally, analysis of the data that these sensors and actuators produce
can provide valuable business insights over time.
Driven by new innovations in materials and nanotechnology, sensor
technology is developing at a never before seen pace, with a result of increased
accuracy, decreased size and cost, and the ability to measure or detect things that
weren’t previously possible.

Sensors
A better term for a sensor is a transducer. A transducer is any physical
device that converts one form of energy into another. So, in the case of a sensor,
the transducer converts some physical phenomenon into an electrical impulse that
determines the reading.
A microphone is a sensor that takes vibrational energy (sound waves), and
converts it to electrical energy in a useful way for other components in the system
to correlate back to the original sound.
Actuators
Another type of transducer that you will encounter in many IoT systems is
an actuator.
In simple terms, an actuator operates in the reverse direction of a sensor. It
takes an electrical input and turns it into physical action. For instance, an
electric motor, a hydraulic system, and a pneumatic system are all different types
of actuators.
Controller
In a typical IoT system, a sensor may collect information and route to a
control center. There, previously defined logic dictates the decision. As a result, a
corresponding command controls an actuator in response to that sensed input.
Thus, sensors and actuators in IoT work together from opposite ends.
Later, we will discuss where the control center resides in the greater IoT system.

IoT Variety is Key


There are many different types of sensors in an IoT system. Flow
sensors, temperature sensors, voltage sensors, humidity sensors, and the list goes
on. In addition, there are multiple ways to measure the same thing. For instance, a
small propeller like the one you see on a weather station can measure airflow.
However, this method would not work in a moving vehicle. As an
alternative, vehicles can measure airflow by heating a small element and
measuring the rate at which it cools.

The Importance of Accurate Sensors


Imagine that you are a bar owner and you want to measure the amount of
beer coming out of one of your taps. One way you might do this is to install a
sensor in line with the line that runs from the keg of beer to the tap.
This sensor would most likely have a small impeller inside of it. When
the beer ran through the sensor, it would cause the impeller to spin, just like the
propeller on a weather station.
Sensor Calibration
To calibrate the sensor, we’d have to take a container with a known
carrying capacity, say, a pint glass. Then we’d have to fill that container under a
variety of conditions to determine what the electrical pulse signal looked like.
Then, monitor the actuator that is responsible to turn on and off the flow
on the other end.
For instance, the first pour off a new keg might tend to have more foam,
which would read differently than a pour from the middle of the keg that was all
beer. It’s only through repeated trials and a lot of data that we gain confidence that
we can interpret the data. Sensors and actuators in IoT can work together to
automate processes, such as filling bottles.

The Importance of Accurate Calibration


With this correlation identified, a protocol can always assure the sensor
is reading correctly. This process is calibration. Reputable manufacturers will
deliver fully calibrated devices and provide instruction on how to re-calibrate
to verify sensor accuracy.
The accuracy of sensed data is paramount, since you will make mission-
critical decisions based on later analysis of the data, which will hold little value if
the data is wrong.

Important Next Steps


Sensors and actuators in IoT work together like bookends. Once you have
your device engineering completed, you will be ready to prototype your IoT
System
which is most effective with an IoT cloud solution that can ingest device
data and provide a way to query or visualize the data. Bridgera IoT is a cloud
platform and a service that allows companies to produce something quickly .

Analog and Digital Sensors:


We frequently use different types of sensors in several electrical and
electronic applications, which are classified as chemical, pressure, temperature,
position, force, proximity, thermal, presence, flow, optical, automotive, sound,
speed, magnetic, electric, heat, fiber-optic sensors, analog and digital sensors.
A sensor can be defined as an appliance that detects changes in
physical or electrical or other quantities and by this means, generally, produces an
electrical or optical signal output as an acknowledgement of the change in that
specific quantity.
In this article, we will discuss about different types of sensors and
practical examples in brief. But, primarily we must know the types of analog and
digital sensors.
Analog Sensors

There are different types of sensors that produce continuous analog


output signal and these sensors are considered as analog sensors. This continuous
output signal produced by the analog sensors is proportional to the measurand.
There are various types of analog sensors; practical examples of various
types of analog sensors are as follows: accelerometers, pressure sensors, light
sensors, sound sensors, temperature sensors, and so on.
Accelerometers

Analog sensors that detect changes in position, velocity, orientation,


shock, vibration, and tilt by sensing motion are called as accelerometers. These
analog accelerometers are again classified into different types based on
the variety of configurations and sensitivities.
Accelerometer

These accelerometers are available as analog and digital sensors, based


on the output signal. Analog accelerometer produces a constant variable voltage
based on the amount of acceleration applied to the accelerometer.

Light Sensors

Analog sensors that are used for detecting the amount of light striking the
sensors are called as light sensors. These analog light sensors are again classified
into various types such as photo-resistor, Cadmium Sulfide (CdS), and, photocell.
Light dependent resistor (LDR) can be used as analog light
sensor which can be used to switch on and off loads automatically based on the day
light incident on the LDR. The resistance of the LDR increases with decrease in
light and decreases with increase in light.
Sound Sensors
Analog sensors that are used to sense sound level are called as sound
sensors. These analog sound sensors translate the amplitude of the acoustic volume
of the sound into an electrical voltage for sensing sound level. This process
requires some circuitry, and utilizes microcontroller along with a microphone for
creating an analog output signal.

Pressure Sensor

The analog sensors that are used to measure the amount of pressure
applied to a sensor are called as analog pressure sensors. Pressure sensor will
produce an analog output signal that is proportional to the amount of applied
pressure.
These pressure sensors are used for different types of applications such as
piezoelectric plates or piezoelectric sensors that are used for the generation of
electric charge. These piezoelectric sensors are one type of pressure sensors that
can produce an analog output voltage signal proportional to the pressure applied to
the piezoelectric sensor.
Analog Temperature Sensor

Temperature sensors are widely available as both digital and analog


sensors. Typically used analog temperature sensors are thermistors. There
are different types of thermistors that are used for different applications.
Thermistor is a thermally sensitive resistor that is used for detecting
changes in temperature. If the temperature increases, then the electrical resistance
of thermistor increases. Similarly, if temperature decreases, then the resistance
decreases. It is used in various temperature sensor applications.

Practical example of analog temperature sensor is thermistor


based temperature control system. This project is used to maintain constant
temperature in an enclosed area. A block diagram of temperature control system
consists of lamp (that represents a cooler), temperature sensor or thermistor, relay.
If the temperature exceeds certain value, then the lamp switches on
automatically indicating a cooler for bringing back temperature to normal value.
Operational along with a negative temperature coefficient thermistor is used for
activating relay-in case if the temperature exceeds certain range.
As this process of activating relay for switching on cooler (in this
system shown as lamp) can be done automatically, hence there is no need to
monitor temperature in person. Thermistor is most frequently used analog
temperature sensor, because of its low cost advantage.
Digital Sensors
Electronic sensors or electrochemical sensors in which data conversion
and data transmission takes place digitally are called as digital sensors. These
digital sensors are replacing analog sensors as they are capable of overcoming the
drawbacks of analog sensors.
The digital sensor consists of majorly three components: senor, cable,
and transmitter. In digital sensors, the signal measured is directly converted into
digital signal output inside the digital sensor itself. And this digital signal is
transmitted through cable digitally. There are different types of digital sensors that
overcome disadvantages of analog sensors.
Digital Accelerometers

The method of generation of variable frequency square wave output by


the digital accelerometer is called as pulse-width modulation. The readings
are taken by the pulse width modulated accelerometer at fixed rate, generally at
1000 Hz (but this can be configured by a user based on the IC used). The output
PWM signal, pulse width or duty cycle is proportional to the acceleration value.
Digital Temperature Sensor
DS1620 is a digital temperature sensor that provides temperature
of device with 9-bit temperature readings. It acts a thermostat with its three thermal
alarm outputs. If the temperature of device is greater than or equal to user defined
temperature TH, then THIGH is driven high.
If the temperature of the device is less than or equal to user defined
temperature TL, then the TLOW is driven high. If the temperature of
the device exceeds TH and remains high until it falls below that of TL, then the
TCOM is driven high.

A practical example of the digital sensor can be considered as a digital


temperature control system using digital temperature sensor that has more
advantages and accuracy compared to the analog temperature control system using
analog sensor thermistor.
Digital temperature sensor DS1620, push buttons, seven segment
display, and relay are interfaced to 8051 microcontroller. This proposed digital
temperature control system provides display of temperature information using
seven-segment displays.
If the temperature value exceeds set point, then the load (heater)
gets switched off by the relay after receiving signal from the microcontroller.
Here a lamp is used to represent the load for demonstration purpose. As
this digital temperature control system provides accuracy by displaying
temperature information on seven segment displays, it is advantageous than
the analog temperature control system.

Interfacing Temperature Sensor ultrasound sensor and infrared(IR)


sensor with Arduino:

Reading temperature using Arduino sounds like a very exciting project.


Because,Temperature measurement is very common and useful in many
applications. From small household to huge industrial devices everything needs to
be operated within a pre-defined temperature.
You will find temperature sensor in

1. Automobiles
2. Computers
3. Home appliances
4. Medical devices
5. And more….

It is responsible for maintaining the device's temperature at a rated value,


thereby assuring the system's safety and long life.

In this article, we will start with the basics of temperature sensors,


understand its types, and finally interfacing with Arduino.

Anyhow I will say that temperature sensor is common in engineering


applications, it would help if you understand it in detail.

Table of Contents (click on the links to jump to that section)

1. What is Temperature Sesnor and its types?


1. Contact
2. Non-contact
2. Interfacing of Temperature Sensor with Arduino
1. What is PT-100S?
2. PT-100S Connection with Arduino
3. Code
3. Conclusion

Now without any further ado, let's start.

What is a Temperature Sensor?

It is a device that measures and converts surrounding temperature into the data
that can be understood by other devices. They work on the principle of resistance or
voltage change in response to temperature variations.

A temperature sensor needs to be very precise and accurate as the failure to


measure temperature can lead to damage to respective as well as surrounding
devices.
Types of Temperature Sensors

1. Contact Temperature Sensor

This type of temperature sensor is in direct contact with the material under
observation. It works on the principle of Heat Conduction.

Useful in distinguishing solids, liquids, and gases over a broad scope of


temperature.

2. Non-contact Temperature Sensor

This type of sensor helps in determining the temperature of liquids and


gases that radiates energy in response to rise in heat.
Interfacing Temperature Sensor with Arduino

We will be using PT100-S to illustrate the temperature sensor interfacing


with Arduino.

What is PT100-S Temperature Sensor?

The PT100-S is a thermistor that changes the resistance value in response


to the surrounding temperature changes. It has good response time, accuracy, and
repeatability.
The resistor is a strip of platinum that has resistance of 100-138.4 Ω.
It is useful in laboratories and industries for measuring the temperature with
excellent precision.The PT100-S is equipped with a 316L stainless steel shield that
makes it compatible with temperatures up to 420°C.
Know more about PT100-S by clicking here.
PT100-S Connection with Arduino
Connecting PT100-S with Arduino will take only 5-10 minutes.

Note: DO NOT connect the power supply until you ensure that everything is
connected properly.

Follow the steps below to make proper connection,

Step 1 – Connect one end of the PT100-S temperature sensor to the analog pin on
Arduino.

Step 2 – Now, we need to connect the same end of the sensor to 5V on Arduino
through a resistor.

Resistor is added here to avoid heating problems. You can calculate value of the
resistor using the formula below,

R2 = R1*1/(Vin/Vout-1)

The value of R2 should be low enough to avoid a low signal to noise ratio.

Here we are using a 150Ω resistor in this project.

Step 3 – Connect the other end of the sensor to the "GND" pin on Arduino.

Try keeping the PT100-S sensor near hot (candle) or cold (ice cube) material. You
will see the change is readings.

Code

//Robu.in
#include <Wire.h>

const int analogInPin = A5; //sensor connected to A5 pin

const int SensorValueLow = 463;


const int SensorValueDiff = 36; // differance between high and low sensor value
const int TempValueDiff = 42; // differance between high and low Temp value
const int TempValueLow = 9;

int sensorValue = 0;
double Temp = 0;
void setup()
{
}

void loop()
{
sensorValue = analogRead(analogInPin);
Temp = sensorValue-SensorValueLow;
Temp = Temp/SensorValueDiff;
Temp = Temp*Tem

Interfacing IR Sensor with Arduino

Arduino IR Sensor Interfacing

An infrared proximity sensor or IR Sensor is an electronic device that


emits infrared lights to sense some aspect of the surroundings and can be employed
to detect the motion of an object. As this is a passive sensor, it can only measure
infrared radiation. This sensor is very common in the electronic industry and if
you’ve ever tried to design an obstacle avoidance robot or any other proximity
detection-based system, chances are you already know about this module, and if
you don’t, then follow this article as here we will discuss everything about it.

IR Sensor Pinout

The IR sensor has a 3-pin connector that interfaces it to the outside world.
The connections are as follows:

VCC is the power supply pin for the IR sensor which we connect to the 5V pin on
the Arduino.

OUT pin is a 5V TTL logic output. LOW indicates no motion is detected; HIGH
means motion is detected.

GND Should be connected to the ground of the Arduino.

How Does an IR Motion Sensor Module Work?

The working of the IR sensor module is very simple, it consists of


two main components: the first is the IR transmitter section and the second is the
IR receiver section. In the transmitter section, IR led is used and in the receiver
section, a photodiode is used to receive infrared signal and after some signal
processing and conditioning, you will get the output.

An IR proximity sensor works by applying a voltage to the


onboard Infrared Light Emitting Diode which in turn emits infrared light. This
light propagates through the air and hits an object, after that the light gets reflected
in the photodiode sensor.
If the object is close, the reflected light will be stronger, if the object is
far away, the reflected light will be weaker.
If you look closely toward the module. When the sensor becomes active it
sends a corresponding Low signal through the output pin that can be sensed by an
Arduino or any kind of microcontroller to execute a particular task.

IR Motion Sensor Module – Parts

For most of the Arduino projects, this sensor is used to detect proximity or
to build obstacle avoidance robots. This Sensor is popular among beginners as
these are low power, low cost, rugged, and feature a wide sensing range that can be
trimmed down to adjust the sensitivity.
Interfacing LED and Buzzer with Arduino:

I just Wanted To Build A LDR Buzzer And Got Many Instructables


Which Were Using To Do This Project.

This arduino basic tutorial for beginner. We will learn use piezzo buzzer, ldr and
led in Arduino board.

PARTS NEEDED IN THIS TUTORIAL


Active buzzer

male to male jumpers

LDR

LED

uno board

10k and 220 ohms resistors

CIRCUIT DIAGRAM

Just Follow The picture and the instruction i will give below icant upload
fritzing diagram bcoz my pc cant install the app. Do The Wiring As Described In
The Image
Place the Buzzer, LDR and the LED to the vertical rail of the breadboard

PU the 220 ohms resistor to the possitve leg of the LED the long leg
should be the possitve, and the short leg will bw the GND negative.
Wired the negtive GND of the parts, connect the short leg of the buzzer, the
short leg of the LED, the left leg of the LDR, connect all that in one rail then
connect it to the GND on the uno board.

The right leg of the LDR to the 5v on the board, the long leg of the buzzer to the
Digital pin 13.

The last Connect the left leg of the 10k ohms resistor of the LDR to the pin Analog
(A0) on the board.
SOFTWARE

Before we work on our sketch, make sure to download the Arduino IDE for
your specific operating system. I’ll leave a link to where you can download this
software: https://www.arduino.cc/en/Main/Software

Arduino Sketch code for Buzzer, LDR and LED, the led pin should be in pin 13,
the buzzer in pin 12 and the lrdpin in analog pin 0
CODE:

//set pin numbers


const int ledPin = 13;
const int buzzerPin = 12;
const int ldrPin = A0;
void setup () {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(buzzerPin, OUTPUT);
pinMode(ldrPin, INPUT);
}
void loop() {
int ldrStatus = analogRead(ldrPin); //read the state of the LDR value

if (ldrStatus >= 400) {

tone(buzzerPin, 100);
digitalWrite(ledPin, HIGH);
delay(100);

noTone(buzzerPin);
digitalWrite(ledPin, LOW);
delay(100);

Serial.println("----------- ALARM ACTIVATED -----------");


}
else {

noTone(buzzerPin);
digitalWrite(ledPin, LOW);

Serial.println("ALARM DEACTIVATED");
}
}

when connecting an LDR to Arduino board, one would automatically


go for one of the Analog pins, which gives us an ON/OFF state instead of a value.
when the light is ON the BUzzer start the tone and the LED start blinking, if we
block the light passing thru the ldr the buzzer and LED should be deactivated as
you can ob the GIF image below..

I was inspired by this blog so thats it for my little project today, ig you
like this please upvote and follow me @pakganern
This sensor has three pins two of which are power pins leveled VCC and
GND and the other one is the sense/data pin which is shown in the diagram above.
It has an onboard power LED and a signal LED the power LED turns on when
power is applied to the board the signal LED turns on when the circuit is triggered.
This board also has a comparator Op-amp that is responsible for converting the
incoming analog signal from the photodiode to a digital signal. We also have a
sensitivity adjustment potentiometer; with that, we can adjust the sensitivity of the
device. Last and finally, we have the photodiode and the IR emitting LED pair
which all together make the total IR Proximity Sensor Module.

Commonly Asked Questions about IR Sensor

Circuit Diagram for IR Motion Sensor Module

The schematic diagram of the IR Motion sensor is shown below. The


schematic itself is very simple and needs a handful of generic components to build.
If you don't have a prebuilt module on hand but still want to test your project, the
schematic below will come in handy.
In the schematic, we have an IR LED as Transmitter and the Photodiode
as a Receiver. If an object is in front of the sensor, the reflected light from the
object is received by the photodiode, and depending upon the intensity we can
determine how far or how close the object is.

IR Sensor with Arduino UNO – Connection Diagram

Now that we have a complete understanding of how an IR sensor works,


we can connect all the required wires to Arduino as shown below.

Connecting the IR sensor to any microcontroller is really simple. As we know this


sensor outputs a digital signal and processing this signal is very easy.
There exist two methods to do so first, you can always check the port in an
infinite loop to see when the port changes its state from high to low, or the other
way is to do it with an interrupt if you are making a complicated project the
interrupt method is recommended.

Power the IR with 5V or 3.3V and connect ground to ground. Then


connect the output to a digital pin D9. We have just used a Male to Female Jumper
wire to connect the IR sensor module with Arduino board as shown below.

With that, you’re now ready to upload some code and get the IR Motion Sensor
working. You can also check out the above module in action at the bottom of this
article.
Arduino Code for Interfacing IR Motion Sensor Module with Arduino

The Arduino IR sensor module code is very simple and easy to


understand. We are just basically keeping track of whether the input to pin D9 is
HIGH or LOW.

We initialize our code by declaring two global variables, the first one holds
the pin value where the IR sensor is connected and the second one holds the value
where the LED is connected

int IRSensor = 9; // connect IR sensor module to Arduino pin D9


int LED = 13; // connect LED to Arduino pin 13

Next, we have our setup function. In the setup function, we initialize


the serial with 115200 baud. Next, we print a statement to check if the serial
monitor window is properly working or not, and then we initialize the IRSensor
pin as input and the LED pin as output.

void setup(){
Serial.begin(115200); // Init Serial at 115200 Baud Rate.
Serial.println("Serial Working"); // Test to check if serial is working or not
pinMode(IRSensor, INPUT); // IR Sensor pin INPUT
pinMode(LED, OUTPUT); // LED Pin Output
}
void loop(){
int sensorStatus = digitalRead(IRSensor); // Set the GPIO as Input
if (sensorStatus == 1) // Check if the pin high or not
{
// if the pin is high turn off the onboard Led
digitalWrite(LED, LOW); // LED LOW
Serial.println("Motion Detected!"); // print Motion Detected! on the serial monit
or window
}
else {
//else turn on the onboard LED
digitalWrite(LED, HIGH); // LED High
Serial.println("Motion Ended!"); // print Motion Ended! on the serial monitor wi
ndow
}
}

5MARKS:
1. Explain abou the sensor and Actuators?
2 .Explain about analog and digital sensors?
3 .Short note interfacing LEDand Buzzer with Arduino?

10 MARKS:
1. Explain about Interfacing Temperature Sensor ultrasound sensor and infrared(IR)
sensor with Arduino?

2.Discuss about the interfacing LEDand Buzzer with Arduino?


MCQ QUESTIONS:

1. How many voltage levels are present when a pin uses digitalWrite()?
a) 1 b) 2 c) 3 d) 4
Answer: b
2. Can the digitalRead() function identify analog voltages?
a) Yes, it can b) No, it cannot c) Yes, it can but only 2
d) Yes, it can but only 4
Answer: c
3. Can the digitalWrite() function be used from any analog pin?
a) No, it cannot b) Yes, it can, but only on certain Arduino Boards
c) Yes, it can d) Yes, it can, but only through certain pins
Answer: b
4. How many errors are present in the code given below?
1. int i=10;
2. void setup() {
3. pinMode(i,OUTPUT);
4. digitalwrite(HIGH);
5. }
6. void loop() {
7. //Do Nothing.
8. }
a) 1 b) 2 c) 3 d) 4
Answer: b
5. How many arguments does the digitalRead() function have?
a) 1 b) 2 c) 3 d) 4
Answer: a
6. Can the analogRead() function be used as a replacement for the digitalRead()
function?
a) No, it cannot be used
b) Yes, it can be used but only on certain Arduino Boards
c) Yes, it can be used
d) Yes, it can be used but only for certain pins
Answer: c
7. What is the need for a quantizer in Digital Communications?
a) Break up a sampled signal to a finite dataset
b) Sample a pure analog signal
c) Sample a digital signal
d) Encode an analog signal
Answer: a
8. Which of the following is not a Digital Encoding Technique?
a) NRZ (Non-Return to Zero) b) Amplitude Modulation
c) Manchester d) RZ (Return to Zero)
Answer: b
9. Which of the following is not a method to convert analog signals to digital
signals?
a) Pulse Code Modulation b) Pulse Amplitude Modulation
c) Pulse Width Modulation d) Frequency Modulation
Answer: d
10. What is the numeric base of the math operations performed in binary?
a) 1 b) 2 c) 3 d) 4
Answer: b
11. How many types of arduinos do we have?
a) 5 b) 6 c) 8 d) 7
Answer: c
12. What is the microcontroller used in Arduino UNO?
a) ATmega328p b) ATmega2560 c) ATmega32114
d) AT91SAM3x8E
Answer: a
13. What does p refer to in ATmega328p?
a) Production b) Pico-Power c) Power-Pico
d) Programmable on chip
Answer: b
14. Arduino shields are also called as _________
a) Extra peripherals b) Add on modules c) Connectivity modules
d) Another Arduinos
Answer: b
15. What is the default bootloader of the Arduino UNO?
a) Optiboot bootloader b) AIR-boot c) Bare box d) GAG
Answer: a
16. Does the level shifter converts the voltage levels between RS-232 and
transistor-transistor logic.
a) True
b) False
Answer: a
17. Which is the software or a programming language used for controlling of
Arduino?
a) Assembly Language b) C Languages c) JAVA d) Any Language
Answer: d
18. Do Arduino provides IDE Environment?
a) True b) False
Answer: a
19. A program written with the IDE for Arduino is called _________
a) IDE source b) Sketch c) Cryptography d) Source code
Answer: b
20. Arduino IDE consists of 2 functions. What are they?
a) Build() and loop() b) Setup() and build()
c) Setup() and loop() d) Loop() and build() and setup()
Answer: c
21. How many digital pins are there on the UNO board?
a) 14 b) 12 c) 16 d) 20
Answer: a
22. _________ board allows sewn into clothing.
a) UNO b) RedBoard c) LilyPad d) Mega
Answer: c
23. How many analog pins are used in Arduino Mega board?
a) 16 b) 14 c) 12 d) 8
Answer: a
24. Which board is first to use microcontroller within build USB?
a) LilyPad b) UNO c) RedBoard d) Leonardo
Answer: d
25. ___________ are pre built circuit boards that fit on top of Android.
a) Sensor b) Data types c) Breadboard d) Sheilds
Answer: d
26. What is the use of the LM35 Temperature Sensor Module?
a) Object Identification b) To provide 3G Connectivity
c) To measure temperature d) To measure Wi-Fi strength
Answer: c.
27. How many terminals does the LM35 Temperature Sensor Module have?
a) 1 b) 3 c) 2 d) 4
Answer: b
28. What is the sensitivity of the LM35 Temperature Sensor Module?
a) 10mV/°C b) 1mV/°C c) 23mV/°C d) 12mV/°C
Answer: a
29. What will happen if we supply a voltage of 250V to the Vcc of the LM35
Temperature Sensor Module?
a) Damage is caused
b) Module will shut down
c) Module will not respond for the time the voltage is applied
d) Module will function normally
Answer: a
30. What is the maximum temperature value that the LM35 Temperature Sensor
Module can read?
a) 100°C b) 140°C c) 150°C d) 130°C
Answer: c
31. What is the minimum temperature that the LM35 Temperature Sensor Module
can read?
a) -11°C b) -55°C c) -10°C d) 0°C
Answer: b
32. If the temperature would be 25°C then what would be the corresponding output
on the LM35 Temperature Sensor?
a) 250mV b) 200mV c) 25V d) 250V
Answer: a
33. What is the formula for obtaining the temperature value in degrees centigrade
from the LM35 Temperature Sensor while using an ADC?
a) °C=ADC/10mV b) °C=ADC/100mV
c) °C=ADC/1mV d) °C=ADC/120mV
Answer: a
34. What is the approximate self heating temperature of the LM35 Temperature
Sensor Module?
a) 0.08°C b) 0.91°C c) 0.11°C d) 1.23°C
Answer: a
35. Does one need to calibrate the LM35 Temperature Sensor Module?
a) Yes b) No
Answer: b
36. What is the use of the ESP8266 WiFi Module?
a) Monitors Motion b) Evaluates air pressure
c) Network Provider d) Switches circuits
Answer: c
37. How many pins are present in the ESP8266 WiFi Module?
a) 12 b) 10 c) 8 d) 50
Answer: c
38. What is the use of the TX pin?
a) Upload b) Download c) Ground d) Power input
Answer: a
39. What will happen if we supply a voltage of 250 kV to the Vcc of the ESP8266
WiFi Module?
a) Damage is caused b) Module will shut down
c) Module will not respond for the time the voltage is applied
d) Module will function normally
Answer: a
40. What is the maximum source current that is required to operate the ESP8266
WiFi Module?
a) 28 A b) 12 mA c) 100 mA d) 1 A
Answer: b
41. What is the optimum supply current that is required to operate the ESP8266
WiFi Module?
a) 28 A b) 13 mA c) 100 mA d) 1 A
Answer: c
42. What kind of device is the ESP8266 WiFi Module?
a) Passive Sensor b) Active Sensor c) Networking Device
d) Switching Device
Answer: c
43. What is the type of waves that the ESP8266 WiFi Module detects?
a) Infrared Signal b) Radio Signal c) DC Signal d) Hybrid Signal
Answer: b
44. What mode does the ESP8266 WiFi Module switch to when fed the sequence 1
1 to its GPIO-0 and GPIO-2 Pins?
a) UART Mode b) Sleep Mode c) Active Mode d) Flash Mode
Answer: d
45. What mode does the ESP8266 WiFi Module switch to when fed the sequence 0
1 to its GPIO-0 and GPIO-2 Pins?
a) UART Mode b) Sleep Mode c) Active Mode d) Flash Mode
Answer: a
46.What is the use of the IR Sensor?
a) Object Detection b) Humidity Detection
c) Image Processing d) GPS
Answer: a
47. How many pins are present in the IR Sensor?
a) 1 b) 3 c) 2 d) 4
Answer: b
48. What mode should we put the Arduino pin to, for object detection to work with
the IR Sensor?
a) Analog b) Digital c) PCM d) TDM
Answer: b
49. What will happen if we supply a voltage of 25V to the Vcc of the IR sensor?
a) Damage is caused b) Sensor will work fine
c) Sensor will not respond for the time the voltage is applied
d) Sensor will function normally
Answer: a
50. If 1 means an object is detected and 0 meaning no object is detected, then
considering the sensor is stationary, what can be said about the movement of the
object if the output by the sensor is 1010101?
a) Object is stationary b) Object is oscillating side by side
c) Object is continuously moving away
d) Object is continuously moving closer
Answer: b
UNIT-V

Sending Sensor Data Over Internet:

We’re all familiar with WiFi. It runs our home, let’s us stream our favorite
movies, and keeps us from having to talk with other people when we’re at a coffee
shop.
But there's more ways to use WiFi than simply accessing the internet
through different applications. In this tutorial, we'll show you how to set up your
own peer-to-peer network to sense data from one area and send that data to an
LCD screen
Somewhere else without needing any internet connection or routers. This a
great first step in being able to remove the wires from any embedded physical
computing application.

The Project: Wirelessly Monitor Temperature, Humidity, and Barometric


Pressure.
For this build, we're going to create a simple point-to-point closed WiFi
system that reads the data from an environmental sensor and sends it to a display
somewhere else.
We'll keep this example as simple as possible by using our hardware,
utilizing the Qwiic Connect System to connect our hardware without the need for
soldering.
The hardware includes a pair of ESP32 Thing Plus Wroom modules,
a Qwiic Environmental Combo Breakout, a SparkFun Qwiic Single Relay, and a
couple of Qwiic Cables. (And of course, a power supply - either battery or wall
charger - for each.) You can add all the items of this tutorial to your cart using the
wishlist below.

Sending Data over WiFi Parts List SparkFun Wish List


Add all to cart

SparkFun 20x4 SerLCD - RGB Backlight (Qwiic)LCD-16398

(2) SparkFun Thing Plus - ESP32 WROOM (Micro-B)WRL-15663

SparkFun Environmental Combo Breakout - CCS811/BME280


(Qwiic)SEN-14348The SparkFun CCS811/BME280 Environmental Combo
Breakout takes care of all your atmospheric-quality sensing needs with the popular
CCS811 and BME280 IC…

SparkFun Qwiic Cable KitKIT-15081

V I E W S E N D I N G D A T A O V E R W I FI PA R T S L IS T O N S PA R K FU N . C O M

Step 1: Obtaining MAC Addresses


In order to communicate with any device over WiFi, we need to know its
Media Access Control Address, or MAC address. There’s a short and simple
Arduino sketch that will find the MAC address of each device, and this one should
go in your drawer of super-useful Arduino utility sketches right next to your I2C
sniffer.

COPY CODE/*
* MAC Address Finder
* Run this on each of your WiFi-enabled
* boards to get their MAC addresses, so
* you can plug them into your code,
* allowing your components to connect
* on power-up or after power-cycling
* without the need for any intervention!
*
* Once you've uploaded the code, open
* the Serial Monitor, hit the reset
* button on your board, and write down
* the MAC address.
* (I use a label maker to put the MAC
* address on the back of each board.)
*/

#include "WiFi.h"

void setup(){
Serial.begin(115200);

void loop(){
WiFi.mode(WIFI_STA);
Serial.print("The MAC address for this board is: ");
Serial.println(WiFi.macAddress());
while(1){ // This holds the loop, so it doesn't
} // print the info a million times.
}
Once the code is uploaded, open a Serial Monitor, reset the board, and write down the MAC address.

Tip from the author:


When I was first starting to work with WiFi boards, I would find the
MAC address, write it on a sticky note, then put that on each board. Of course I
would then throw them all in my bag, go from my home workspace into SparkFun
HQ and pull all the boards out, only to find that the sticky notes were all stuck to
each other in the bottom of my bag.
Useless! Since then I’ve been using a label maker to tag the back of each
board. I would recommend against using a permanent marker on your boards for
this since the MAC addresses can be changed.

Step 2: Connecting the Hardware


As stated before, working with SparkFun's Qwiic Connect System is very
simple and this project will only require you to make 6 total connections. To one of
the ESP32 Thing Plus boards (the transmitter or server board), we’ve connected
the SparkFun Qwiic Environmental Breakout, and to the other ESP32 Thing Plus
board (the receiver or client board), the Qwiic 20x4 SerLCD RGB Backlight
Display.
Note that since we’re only using the BME280 sensor from the environmental
combo board, you could also use our Atmospheric Sensor Breakout -
BME280 without any change to the code, if you would like to use that sensor
board instead.
Step 3: Uploading the Code
For this example we have two Arduino sketches - one for the data
transmitter, and one for the data receiver.
Copy this sketch and upload it to your transmitting board, the one with
the Qwiic Environmental Combo connected to it. Make sure that before you upload
it, you insert the MAC address of your receiving board on line 34 of the sketch, so
that, in our case,
COPY CODEuint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF};
would become
COPY CODEuint8_t broadcastAddress[] = {0x94, 0x3C, 0xC6, 0x96, 0x38,
0xB4};
Full Transmitter Code
The proper board (SparkFun ESP32 Thing Plus) should still be selected, just make
sure you've connected to the proper COM port, and upload the following sketch.

COPY CODE/* WiFi Peer-to-Peer example, Transmitter Sketch


* Rob Reynolds, SparkFun Electronics, November 2021
* This example uses a pair of SparkFun ESP32 Thing Plus Wroom modules
* (https://www.sparkfun.com/products/15663, a SparkFun Qwiic Environmental
* Combo Breakout (https://www.sparkfun.com/products/14348), and a SparkFun
* Qwiic 20x4 SerLCD - RGB Backlight
(https://www.sparkfun.com/products/16398).
*
* Feel like supporting our work? Buy a board from SparkFun!
* https://www.sparkfun.com/
*
* License: MIT. See license file for more information but you can
* basically do whatever you want with this code.
*
* Based on original code by
* Rui Santos
* Complete project details at https://RandomNerdTutorials.com/esp-now-esp32-
arduino-ide/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files.
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

#include <esp_now.h>
#include <WiFi.h>

#include <Wire.h> // Used to establish serial communication on the I2C bus


#include "SparkFunBME280.h" // Install library for the BME280
BME280 mySensor; // Define sensor

// REPLACE WITH YOUR RECEIVER MAC Address


uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

// Structure example to send data


// Must match the receiver structure
typedef struct struct_message {
float a;
float b;
float c;
} struct_message;

// Create a struct_message called myData


struct_message myData;

// callback when data is sent


void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
Serial.print("\r\nLast Packet Send Status:\t");
Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Delivery Success" :
"Delivery Fail");
}

void setup() {
Serial.begin(115200);
Serial.println("Reading basic values from BME280");

Wire.begin();

//**********Setup for BME280 module**********//


if (mySensor.beginI2C() == false) //Begin communication over I2C
{
Serial.println("The sensor did not respond. Please check wiring.");
while(1); //Freeze
}

// Set device as a Wi-Fi Station


WiFi.mode(WIFI_STA);

// Init ESP-NOW
if (esp_now_init() != ESP_OK) {
Serial.println("Error initializing ESP-NOW");
return;
}

// Once ESPNow is successfully Init, we will register for Send CB to


// get the status of Trasnmitted packet
esp_now_register_send_cb(OnDataSent);

// Register peer
esp_now_peer_info_t peerInfo;
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;

// Add peer
if (esp_now_add_peer(&peerInfo) != ESP_OK){
Serial.println("Failed to add peer");
return;
}
}

void loop() {
// Set values to send
//strcpy(myData.a, "THIS IS A CHAR");
myData.a = (mySensor.readTempF());
myData.b = (mySensor.readFloatHumidity());
myData.c = (mySensor.readFloatPressure());

// Send message via ESP-NOW


esp_err_t result = esp_now_send(broadcastAddress, (uint8_t *) &myData,
sizeof(myData));
// The following is only used for testing, to check data in Serial Monitor
Serial.print("Temperature in Fahrenheit: ");
Serial.println(myData.a);
Serial.print("Humidity: ");
Serial.println(myData.b);
Serial.print("Pressure: ");
Serial.println(myData.c);

if (result == ESP_OK) {
Serial.println("Sent with success");
}
else {
Serial.println("Error sending the data");
}
delay(2000); // Send data every two seconds
}
Full Receiver Code

COPY CODE/* WiFi Peer-to-Peer example, Receiver Sketch


* Rob Reynolds, SparkFun Electronics, November 2021
* This example uses a pair of SparkFun ESP32 Thing Plus Wroom modules
* (https://www.sparkfun.com/products/15663, a SparkFun Qwiic Environmental
* Combo Breakout (https://www.sparkfun.com/products/14348), and a SparkFun
* Qwiic 20x4 SerLCD - RGB Backlight
(https://www.sparkfun.com/products/16398).
*
* Feel like supporting our work? Buy a board from SparkFun!
* https://www.sparkfun.com/
*
* License: MIT. See license file for more information but you can
* basically do whatever you want with this code.
*
* Based on original code by
* Rui Santos
* Complete project details at https://RandomNerdTutorials.com/esp-now-esp32-
arduino-ide/
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files.
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

#include <esp_now.h>
#include <WiFi.h>

#include <SerLCD.h> //Click here to get the library:


http://librarymanager/All#SparkFun_SerLCD
SerLCD lcd; // Initialize the library with default I2C address 0x72

// Structure example to receive data


// Must match the sender structure
typedef struct struct_message {
float a;
float b;
float c;
float d;
} struct_message;

// Create a struct_message called myData


struct_message myData;

void setup() {
// Initialize Serial Monitor
Serial.begin(115200);

// Set device as a Wi-Fi Station


WiFi.mode(WIFI_STA);

Wire.begin();
//********** Setup for LCD display**********//
lcd.begin(Wire); //Set up the LCD for I2C communication

lcd.setBacklight(50, 55, 255); //Set backlight to bright white


lcd.setContrast(5); //Set contrast. Lower to 0 for higher contrast.

lcd.clear(); //Clear the display - this moves the cursor to home position as well
lcd.print(" Current Conditions");
lcd.setCursor(0, 1);
lcd.print("Temperature: ");
lcd.setCursor(0,2);
lcd.print("Humidity: ");
lcd.setCursor(0,3);
lcd.print("Pressure: ");

// Init ESP-NOW
if (esp_now_init() != ESP_OK) {
Serial.println("Error initializing ESP-NOW");
return;
}

// Once ESPNow is successfully Init, we will register for recv CB to


// get recv packer info
esp_now_register_recv_cb(OnDataRecv);
}

void loop() {

// callback function that will be executed when data is received


void OnDataRecv(const uint8_t * mac, const uint8_t *incomingData, int len) {
memcpy(&myData, incomingData, sizeof(myData));

// Use this for testing in Serial Monitor if you're not seeing anything on the LCD
display
Serial.print("Temperature F: ");
Serial.println(myData.a);
Serial.print("Humidity: ");
Serial.println(myData.b);
Serial.print("Pressure: ");
Serial.println(myData.c);
Serial.println();
lcd.setCursor(13, 1);
lcd.print(String(myData.a) + (char)223 + " F");
lcd.setCursor(13, 2);
lcd.print(String(myData.b) + (char)37);
lcd.setCursor(13, 3);
lcd.print(String(myData.c, 1)); // The comma followed bt 1 limits output to 1
decimal place

}
In the receiving script, the line we want to focus on is here inside the onDataRecv()
function (line 86):

COPY CODEmemcpy(&myData, incomingData, sizeof(myData));


This takes the the incoming data and moves it to myData so it can be
displayed. Just make sure that the the data structure in the receiving sketch matches
the data structure in the transmitting sketch. (That is, the data type for each of your
variable to be sent matches the data types that the receving sketch expects.)
Once you've got the code loaded to both boards, powering them up will
connect them, and you should see incoming data after only a few seconds.

Troubleshooting
If you aren't getting anything on the LCD display, or some other issue
seems to have shown up, there are a few things you can check. Let's start by
connecting the transmitting board (with the Environmental Sensor) to your
computer with a USB cable, then opening up the Serial Monitor window.
If the sensor is working properly and the WiFi module is sending the
package, you should see something like this in the Serial Monitor:

Resources and Going Further


The focus of this project was simply to show you how to send data
wirelessly. The great thing about the simplicity of this tutorial is that you could
change out the sensor board we used for any one of many sensors with relative
ease.
You could also add another Qwiic sensor to this setup such as the SparkFun
Ambient Light Sensor to add another data point which expands the dataset
showing on your LCD. Looking through the hookup guides for the sensor you
would like to use is a great place to start.
If you want to learn more about the SparkFun components used in this
project, you can find that information in the hookup guides below.

Introduction to ESP8266 NODEMCU WiFi Module:


The ESP8266 is, the name of a microcontroller designed by Espressif
Systems. It is a self-contained WiFi networking solution offering as a bridge from
the existing microcontroller to WiFi and is also capable of running self-contained
applications. For less than $3, it can monitor and control things from anywhere in
the world – perfect for just about any IoT project.
Contents:
 Pinout and description
 Power Requirement
 Various Peripherals and I/O
 On-Board buttons and LED
 Development Platforms
 Applications of ESP8266

1. Pinout and description


Pin out
The NodeMCU_ESP8266 has 30 pins in total out of which there are 17
GPIO pins. GPIO stands for General Purpose Input Output. There are the 9 digital
pins ranging from D0-D8 and there is only one analog pin A0, which is a 10 bit
ADC. The D0 pin can only be used to read or write data and can’t perform other
options.
The ESP8266 chip is enabled when the EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power. The board has a 2.4 GHz antenna
for a long-range of network and the CP2102 is the USB to TTL converter. The
development board equips the ESP-12E module containing ESP8266 chip
having Tensilica Xtensa® 32-bit LX106 RISC microprocessor which operates
at 80 to 160 MHz adjustable clock frequency and supports RTOS.
There’s also 128 KB RAM and 4MB of Flash memory (for program
and data storage) just enough to cope with the large strings that make up web
pages, JSON/XML data, and everything we throw at IoT devices nowadays. The
ESP8266 Integrates 802.11b/g/n HT40 Wi-Fi transceiver, so it can not only
connect to a WiFi network and interact with the Internet, but it can also set up a
network of its own, allowing other devices to connect directly to it. This makes the
ESP8266 NodeMCU even more versatile.
2. Power Requirement
As the operating voltage range of ESP8266 is 3V to 3.6V, the board comes
with an LDO (low dropout) voltage regulator to keep the voltage steady at 3.3V. It
can reliably supply up to 600mA. It has three 3v3 pins along with 4 GND pins.
The power supply is via the onboard MicroB USB connector.
Alternatively, if you have a regulated 5V voltage source, the VIN pin is used to
directly supply the ESP8266. Moreover, it requires 80mA Operating Current and
20 µA during Sleep Mode.
3. Various Peripherals and I/O

The ESP8266 supports UART, I2C, SPI communication protocols. It also


has 4 PWM channels which can be used to drive motors, the brightness of the
LED, etc. Moreover, there are 2 channels of the UART protocol. The ADC
(A0) can be used to control any analog device. The CMD is the Chip select pin
used in the SPI protocol.
4. On-Board buttons and LED
ESP8266 has 2 onboard buttons along with an on-board LED which
connects with the D0 PIN. The two buttons are FLASH and RST.
 FLASH pin– It is to download new programs to the board
 RST pin – It is to reset the ESP8266 chip
5. Development Platforms
The prominent platforms include the Arduino IDE and the ESPlorer IDE.
Other development platforms that can be equipped to program the ESP8266 are
the Espruino – JavaScript SDK and firmware closely emulating Node.js,
or Mongoose OS – An operating system for IoT devices.

6. Applications of ESP8266
The NodeMCU_ESP8266 is basically a WIFI module integrated with a
Microcontroller, which makes it a very useful device in the field of IoT. It’s 17
GPIO pins are the prime example of this.
The main use of ESP8266 is in home automation which is so much
trending these days. This is due to its low power consumption in Sleep mode.
Apart from it, some other examples where the ESP8266 can be used are:
 Making a web server using ESP8266
 Controlling DHT11 using the NodeMCU
 ESP8266 weather station-using BMP280
 OTA programming
 ESP8266 NTP server for fetching time
Programming NODEMCU using Arduino IDE:

In the last blog we discuss and see the hardware specification about
NodeMCU, today in this blog we will be going to run NodeMCU on Arduino IDE.
Basically, NodeMCU is firmware based on Lua script. ESPlorer IDE is
referred for writing Lua scripts for NodeMCU, So we require to get familiar with
ESPlorer IDE and Lua scripting language.
But there is another way to program NodeMCU with a well-known IDE
called Arduino IDE. It makes things easy for Arduino developers than learning a
new language and IDE for NodeMCU.
What is the LUA Script?
Lua is a powerful, efficient, lightweight, embeddable scripting language. It
supports procedural programming, object-oriented programming, functional
programming, data-driven programming, and data description.
Step by Step Process of Installation of NodeMCU Board.
Let's see about setting up Arduino IDE with NodeMCU
 First thing you need to download Arduino IDE from the Arduino.cc platform
and then install.
 If you already have it, then it is great, the next thing to follow a path.
 File -> preferences -> Additional board manager URL
And paste this
URL: http://arduino.esp8266.com/stable/package_esp8266com_index.json
like this

 Now close Preference window and go to Tools -> Board -> Boards
Manager

 In Boards Manager window, Type esp in the search box, esp8266 will be
listed there below. Now select latest version of board and click on install.
After installing ESP8266 board it will appear like this

 After installation of the board is complete,open Tools -> Board-


> NodeMCU 1.0 (ESP-12E Module).

 Now your board installed completely on Arduino IDE


 Now Your Arduino IDE is ready for NodeMCU
Now you can run multi-application code on NodeMCU and upload into
NodeMCU, just Ensure that you have selected the correct board as shown in the
below figure. Also, make sure that you have selected the appropriate COM port.

I hope this article will find useful to you if you are a beginner in the IOT
platform.For more information, you can also check on links below
 LUA script
 ESP8266-ESplorer

Using wifi and NODEMCU to transmit data from temperature sensor to open
source IOT cloud platform (Think Speak):

Description
Learn how to connect it to evive using the ESP8266 module. Get a
comprehensive guide on using PictoBlox to program evive and send data to a
ThingSpeak channel.
 Software Used: PictoBlox
 Difficulty Level: Intermediate
 Category: evive IoT Kit, Tutorial
What is the Internet of Things (IoT)?
An internet connection is a wonderful thing, it gives us all sorts of
benefits that just weren’t possible before. If you’re old enough, think of your
cellphone before it was a smartphone.
You could call and you could text sure, but now you can read any book,
watch any movie, or listen to any song all in the palm of your hand. And that’s just
to name a few of the incredible things your smartphone can do.
The point is that connecting thing to the internet yields many amazing
benefits. We’ve all seen these benefits with our smartphones, laptops, and tablets,
but this is true for everything else too. And yes, I do mean everything.
The Internet of Things is actually a pretty simple concept, it means
taking all the things in the world and connecting them to the internet.
IoT is a system of interrelated
1. Sensors
2. Actuators
3. Objects
4. Animals or people
All things are provided with a unique identifier and have the ability to transfer data
over the internet. No requirement of human-to-human or human-to-computer
interaction
Classification of Things
In the Internet of Things, all the things that are being connected to the internet can
be put into three categories:
1. Things that collect information and then send it.
2. Things that receive information and then act on it.
3. Things that do both.
And all three of these have enormous benefits that feed on each other.
Collecting and Sending Information
This means sensors. Sensors could be temperature sensors, motion sensors,
moisture sensors, air quality sensors, light sensors, you name it. These sensors,
along with a connection, allow us to automatically collect information from the
environment which, in turn, allows us to make more intelligent decisions.
On the farm, automatically getting information about the soil moisture
can tell farmers exactly when their crops need to be watered. Instead of watering
too much (which can be an expensive over-use of irrigation systems and
environmentally wasteful) or watering too little (which can be an expensive loss of
crops), the farmer can ensure that crops get exactly the right amount of water.
More money for farmers and more food for the world!
Receiving and Acting on Information
We’re all very familiar with machines getting information and then acting.
Your printer receives a document and it prints it. Your car receives a signal from
your car keys and the doors open. The examples are endless.
ThingSpeak
ThingSpeak is an open-source IoT application and API to store and retrieve data
from things.
Applications
1. Sensor logging applications
2. Location tracking applications
3. The social network of things with status updates
Creating Channel on ThingSpeak
1. Create a ThingSpeak account.
2. Create a new channel
3. You can store up to 8 fields on 1 channel. We will store 1 parameter:

4. When a new channel is created, you can see four graphs for each parameter:
5. Get the Channel ID of your Channel (To be used while connecting to the
channel):

6. Get the Read and Write API from API tab:

Connecting evive to the Internet


To connect evive to the internet we will use the ESP8266 module.

Connect ESP8266 Module to its header on evive:

PictoBlox Program
In this example, we will be sending data to the potentiometer data to the
ThingSpeak channel we have created.
1. Open PictoBlox.
2. Select the board as evive:

3. Connect the evive.


4. Add the Internet of Things extension in PictoBlox by clicking on the add
extension button in the bottom left corner.

5. Create the following script using when evive starts up block:


6. Upload the code onto evive:

You can download the PictoBlox program from here: IoT – Sending data on cloud
(ThingSpeak)
When you start your evive, you will see two things happening:
1. M1 LED glowing:
1. Yellow: Connected to Wi-Fi.
2. Red: Not connected to Wi-Fi. Check if your Wi-Fi name and password are
correct.
2. M2 LED glowing:
1. Yellow: Connected to ThingSpeak.
2. Red: Not connected to ThingSpeak.
Output
Conclusion
The Internet of Things (IoT) is a revolutionary way for us to permanently connect
all of the things in the world to the Internet, allowing us to collect and share data in
ways never before possible.

Through the use of sensors, actuators, objects, and even animals or people, IoT allo
ws us to collect, store and analyze data, and then act on it. This could be beneficial
in any number of industries, from agriculture to the medical field.

5MARKS:
1. Explain about the sending sensor data over Internet?
2 .Explain about programming NODEMDU using arduino IDE?
5.Explain about the using wifi and nodemcu to transmit data(Think Speak)?

10 MARKS:
1.Explain about the programming NODEMDU using arduino IDE?
2.Discuss about using wifi and nodemcu to transmit data from temperature sensor
to open source IOT cloud platform ?
MCQ QUESTIONS:
1. What is the use of the ESP8266 WiFi Module?
a) Monitors Motion b) Evaluates air pressure
c) Network Provider d) Switches circuits
Answer: c
2. How many pins are present in the ESP8266 WiFi Module?
a) 12 b) 10 c) 8 d) 50
Answer: c
3. What is the use of the TX pin?
a) Upload b) Download c) Ground d) Power input
Answer: a
4. What will happen if we supply a voltage of 250 kV to the Vcc of the ESP8266
WiFi Module?
a) Damage is caused b) Module will shut down
c) Module will not respond for the time the voltage is applied
d) Module will function normally
Answer: a
5. What is the maximum source current that is required to operate the ESP8266
WiFi Module?
a) 28 A b) 12 mA c) 100 mA d) 1 A
Answer: b
6. What is the optimum supply current that is required to operate the ESP8266
WiFi Module?
a) 28 A b) 13 mA c) 100 mA d) 1 A
Answer: c
7. What kind of device is the ESP8266 WiFi Module?
a) Passive Sensor b) Active Sensor c) Networking Device
d) Switching Device
Answer: c
8. What is the type of waves that the ESP8266 WiFi Module detects?
a) Infrared Signal b) Radio Signal c) DC Signal d) Hybrid Signal
Answer: b
9. What mode does the ESP8266 WiFi Module switch to when fed the sequence 1
1 to its GPIO-0 and GPIO-2 Pins?
a) UART Mode b) Sleep Mode c) Active Mode d) Flash Mode
Answer: d
10. What mode does the ESP8266 WiFi Module switch to when fed the sequence 0
1 to its GPIO-0 and GPIO-2 Pins?
a) UART Mode b) Sleep Mode c) Active Mode d) Flash Mode
Answer: a
11. What is the use of the Nokia 5110 GDM?
a) To measure luminosity of something b) To display something
c) To measure temperature d) To measure GPS Location
Answer: b
12. How many pins are present in the Nokia 5110 GDM have?
a) 1 b) 8 c) 10 d) 5
Answer: b
13. What kind of input does the DC pin accept?
a) Analog b) Digital c) PCM d) TDM
Answer: b
14. What will happen if we supply a voltage of 25V to the Vcc of the Nokia 5110
GDM?
a) Damage is caused b) Module will shut down
c) Module will not respond for the time the voltage is applied
d) Module will function normally
Answer: a
15. What will happen if we start using the Nokia 5110 GDM without resetting?
a) Damage is caused b) Module will work fine
c) Module will not respond indefinitely
d) Module will overheat
Answer: a
16. What communication protocol does the Nokia 5110 GDM follow?
a) SPI b) UART c) I2C d) API
Answer: a
17. What is the use of the X and Y Addresses of the RAM for Display Control?
a) Rows and Columns b) Rows c) Columns d) Pixels
Answer: a
18. What is the use of the VLCD?
a) Temperature Control b) Heat Generation c) Shutting down the LCD
d) Starting up the LCD
Answer: a.
19. What kind of images can the Nokia 5110 GDM display?
a) Colored Image b) Grayscale Image c) Binary Image
d) Inverted Image
Answer: c
20. What is the use of the RFID Module?
a) Object Identification b) To provide 3G Connectivity
c) To measure temperature d) To measure Wi-Fi strength
Answer: a

21. What is the role of the MISO pin in the RFID Module?
a) Master In Slave Out b) Manage Internal Slave Output
c) Master Internal Search Optimization d) Manage Input Slave Op
Answer: a
22. Is there an SDA pin on the RFID Module?
a) Yes b) No
Answer: a
23. What will happen if we supply a voltage of 25V to the Vcc of the RFID
Module?
a) Damage is caused b) Module will shut down
c) Module will not respond for the time the voltage is applied
d) Module will function normally
Answer: a
24. Which frequency does the RFID Module operate in?
a) 12.98 MHz b) 14.67 MHz c) 19.56 MHz d) 13.56 MHz
Answer: d
25. What is the maximum data rate of the RFID Module?
a) 11 Mbps b) 1 Kbps c) 10 Mbps d) 11 Gbps
Answer: c
26. What is the maximum read range of the RFID Module?
a) 2 cm b) 1 cm c) 10 cm d) 5 cm
Answer: d
27. Is there an interrupt pin on the RFID Module?
a) Yes b) No
Answer: a
28. What is the minimum working current internally in the RFID Module?
a) 12 mA b) 13 mA c) 10 mA d) 1 mA
Answer: b
29. Till what voltage are the logic pins on the RFID Module resistant to?
a) 5V b) 3.3V c) 2V d) 12V
Answer: a
30. Which software is used to upload the Arduino Sketches to the board?
a) avrdude b) avrgcc c) g++ d) cpython for windows
Answer: a
31. What is the use of the dmesg command?
a) Sending messages to the device connected
b) Reading messages generated from avrdude
c) Receiving messages from the gcc compiler
d) Receiving messages from the particular device
Answer: d
32. What is USBasp?
a) It is a compiler for microcontroller code
b) It is a software for debugging any code preexisting in microcontrollers
c) It is a programmer for a specific microcontroller family
d) It is a microcontroller that is produced by Atmel
Answer: c
33. What is the use of the MOSI and MISO pins?
a) To download code from the microcontroller to the computer
b) To verify the program that the computer uploads to the microcontroller
c) To erase the SRAM of the microcontroller
d) To dump or transfer programs from the computer to the microcontroller
Answer: d
34. Fill in the correct pattern of words for the following statement. (Here, M-
>Master & S-> Slave)
During data transfer from ______ to _____ the clock is synchronized according to
the _____
a) MSS b) SMM c) MSM d) SMS
Answer: a
35. Select the correct name for the SPI master-slave configuration.
a) Dependent Slave Configuration b) Independent Master Configuration
c) Independent Slave Configuration
d) Chained Master and Slave Configuration
Answer: c
36. What is the recipe for compiling Assembly Source Code in the Arduino IDE?
a) recipe.S.o.pattern b) recipe.A.n.pattern
c) recipe.S.b.pattern d) recipe.S.i.pattern
Answer: a
37. What is the purpose of the code given below?
1. uno.upload.tool=avrdude
a) To set the Board Variant name b) To set the upload software name
c) To erase the upload tool name d) To reset the upload tool
Answer: b
38. IoT gateway must provide __________
a) Protocol abstraction b) Data storage
c) Security with hardware d) Simple and fast installation
Answer: a
39. What IoT collects?
a) Device data b) Machine generated data
c) Sensor data d) Human generated data
Answer: b
40. Which of the following protocol is used to link all the devices in the IoT?
a) HTTP b) UDP c) Network d) TCP/IP
Answer: d
41. Which service permits the changes to the IoT services?
a) Update b) Registered service status c) Enable from suspension d) Enable
Answer: a
42. What is the role of Cloud in smart grid architecture of IoT?
a) Security b) Collect data c) Manage data d) Store data
Answer: c
43. What is the component of an IoT system that executes a program?
a) A sensor b) A microcontroller c) An actuator d) A digital to
analog converter
Answer: b
44. Which programming language is used by Arduino IDE IoT software for writing
codes?
a) Python b) Java c) C/C++ d) JavaScript
Answer: c
45. What is the full form of DHCP in IoT communication protocols?
a) Dynamic Host Communication Protocol b) Domain Host Communication
Protocol
c) Dynamic Host Control Protocol d) Domain Host Control Protocol
Answer: a
46. What is the full form of IDE in Arduino IDE IoT software?
a) Intra Defence Environment b) Intra Development Environment
c) Integrated Development Environment d) Integrated Deployed Environment
Answer: c
47. dweet.io provides __________ to send data from IoT devices.
a) Web API b) POST HTTP c) JSON d) HTTP
Answer: a
48. Which of the following is not an IoT platform?
a) Amazon Web Services b) Microsoft Azure
c) Salesforce d) Flipkart
Answer: d
49. Which of the following is not an application of IoT?
a) BMP280 b) Smart home c) Smart city d) Self-driven cars
Answer: a
50. Which of the following is not a fundamental component of an IoT system?
a) Sensors b) Connectivity and data processing
c) User interface d) Transformer
Answer: d

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy