Iot PG
Iot PG
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).
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.
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 :
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
Level of IoT
IoT Level 1
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:
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 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.
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.
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.
2. Smart Robotics
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.
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
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.
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.
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
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:
10101010 + 11001100
=?
Calculate
Result
10101010
Binary Value: =?
Calculate
170
Decimal Value: =?
Calculate
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
P3.4 T0 Timer 0
P3.5 T1 Timer 1
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.
P3.4 T0 Timer 0
P3.5 T1 Timer 1
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
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.
Most of the microprocessors do not have Most of the microcontrollers have power
power saving modes. saving mode.
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:
Electronics Signals :
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.
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:
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
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
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
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.
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:
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.
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:
Serial1.available( )
Serial2.available( )
Serial3.available( )
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.
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 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.
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
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.
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
1. Automobiles
2. Computers
3. Home appliances
4. Medical devices
5. And more….
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.
This type of temperature sensor is in direct contact with the material under
observation. It works on the principle of Heat Conduction.
Note: DO NOT connect the power supply until you ensure that everything is
connected properly.
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.
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>
int sensorValue = 0;
double Temp = 0;
void setup()
{
}
void loop()
{
sensorValue = analogRead(analogInPin);
Temp = sensorValue-SensorValueLow;
Temp = Temp/SensorValueDiff;
Temp = Temp*Tem
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.
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:
This arduino basic tutorial for beginner. We will learn use piezzo buzzer, ldr and
led in Arduino board.
LDR
LED
uno board
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:
tone(buzzerPin, 100);
digitalWrite(ledPin, HIGH);
delay(100);
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
delay(100);
noTone(buzzerPin);
digitalWrite(ledPin, LOW);
Serial.println("ALARM DEACTIVATED");
}
}
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.
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
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
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?
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
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.
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
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.
#include <esp_now.h>
#include <WiFi.h>
void setup() {
Serial.begin(115200);
Serial.println("Reading basic values from BME280");
Wire.begin();
// Init ESP-NOW
if (esp_now_init() != ESP_OK) {
Serial.println("Error initializing ESP-NOW");
return;
}
// 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());
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
#include <esp_now.h>
#include <WiFi.h>
void setup() {
// Initialize Serial Monitor
Serial.begin(115200);
Wire.begin();
//********** Setup for LCD display**********//
lcd.begin(Wire); //Set up the LCD for I2C communication
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;
}
void loop() {
// 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):
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:
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
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):
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:
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