Mahesh Iot1
Mahesh Iot1
An Autonomous Institution with A+ Grade UGC by NAAC UGC, Approved by UGC, AICTE, Government
of Karnataka, Yelahanka, Bengaluru-560064, Karnatka, India.
Internship Report On
“IOT -ML”
BACHELOR OF ENGINEERING
in
ELECTRONICS AND COMMUNICATION ENGINEERING
2023-2024
Submitted By
1
An Autonomous Institution with A+ Grade UGC by NAAC UGC, Approved by UGC, AICTE, Government of
Karnataka, Yelahanka, Bengaluru-560064, Karnatka, India.
Certificate
This is to certify that MAHESH NAIK.L (1NT21EC077) has submitted the Internship report entitled “IOT-
ML” in fulfillment for the award of Bachelor of Engineering in Electronics and Communication Engineering
from Visvesvaraya Technological University, Belagavi during the year 2023-2024. It is certified that all the
corrections and suggestions indicated for internal assessment have been incorporated in the report. The
Internship report has been approved as it satisfies the academic requirements in respect of work prescribed for
the aforesaid degree.
Dr.Ramachandra AC
Dr. Viswanatha V
Dr. Parameshachari B D Dr. H. C. Nagaraj
Guide HoD Principal
2
Acknowledgement
It is my proud privilege and duty to acknowledge the kind help and guidance received from several people in the
preparation of this report. It would not have been possible to prepare this report in this form without valuable
suggestions, cooperation, and guidance.
I wish to record my sincere gratitude to Management, and Dr. H. C. Nagaraj, Principal, Nitte Meenakshi
Institute of Technology, Bengaluru for the permission provided to accomplish this internship.
My sincere thanks to Dr. Parameshachari B. D., Professor and Head, Department of Electronics and
Communication Engineering for his valuable suggestions and guidance.
My sincere gratitude to Dr. Thimmaraja Yadava G, Dr. Vinaykumar R and Dr. Rajani N, Internship
Coordinators, Department of Electronics and Communication Engineering, for their valuable suggestions in
preparing this report.
I express my sincere gratitude to our beloved guide, Guide Name, Designation, Department of Electronics and
Communication and Engineering for his/her support and guidance.
I am extremely great full to faculty members of Department of Electronics and Communication Engineering, and
friends for their support and encouragement in successful completion of this internship.
3
Contents
1. Introduction ………………………………………………………………..05-19
2. About the Domain (IoT-ML/VLSI Design)………………………………..20-22
3. Work Carried Out…………………………………………………………..23-52
4. Conclusion………………………………………………………………….......53
5. References……………………………………………………………………..54
4
Chapter 1
What is Internet of Things (IoT)?
Definition, history and features of IoT.
This chapter describes some important highlights in the history of the IoT (Internetof things). Nowadays,
the internet-based information architecture allows the exchange of services and goods between all
elements, equipment and objects connected to the network. The IoT refers to the networked
interconnection of those everyday objects, which are often equipped with some kind of intelligence. In
this context, Internet can be also a platform for devices to communicate electronically and share
information and specific data with the world around them. So, IoT can beseen as a real evolution of what
we know as Internet by adding more extensive interconnectivity, a better perception of the information
and more comprehensive smart services. For the most part, the Internet was used for connection-
oriented application protocols like HTTP (Hypertext Transfer Protocol) and SMTP (Simple Mail
Transfer Protocol). However, nowadays a large number of smart devices communicate between
themselves and to other control systems. This concept is known as M2M (Machine-to-Machine
communications).
IoT (Internet of things) is an emerging global Internet-based technical architecturefacilitating the exchange of
goods and services in global supply chain networks hasan impact on the security and privacy of the involved
stakeholders
The term Internet of Things was first used by Kevin Ashton in 1999 that was working
in the field of networked RFID (radio frequency identification) and emerging sensing
technologies.
In 2010, the number of everyday physical objects and devices connected to the
Internet was around 12.5 billion. Nowadays there are about 25 billion of devices
connected to the IoT. More or less a smart device per person .
The number of smart devices or “things” connected to the IoT is expected to increase
to a further 50 billion by 2020.
The IoT introduces a step change in individuals’ quality of life by offering a lot of new
opportunities to data access, specific services in education, security, health care or
transportation among others. On the other hand, it will be a key to increase enterprises’
productivity by offering a widely distributed, locally intelligent network of smart devices
and new services that can be personalized to customer needs. The IoT brings benefits
from improved management and tracking of assets and products, it increases the amount
of information data and allows the optimization of equipment and use of resources that
can be translated into costs saving. Moreover, it offers the opportunity to create new
smart interconnected devices and explore new business models.
5
Introduction
The IoT can be seen as a combination of sensors and actuators providing and receiving information
that is digitalized and placed into bidirectional networks able to transmit all data to be used by a lot of
different services and final users
Multiple sensors can be attached to an object or device in order to measure a broad range of physical
variables or phenomena and then transmit all data to the cloud. The sensing can be understood as a
service model.
Sensor Classification
Sensor Data Providers Business entities that deploy and manage sensors by
themselves.
Public or Private. Public infrastructures. Commercial
Organizations organizations. Private corporations:Technology and
services providers.
Mobile phones, smart watches, gyroscopes, cameras,
GPS, accelerometers microphones, laptops, food items
Personal and Households and household items, such as televisions, cameras,
freezers, microwave furnaces, washing machines, smart
appliances etc
Nowadays, state of the art devices such as conventional house items as refrigerators or televisions
comprise communication and sensing capabilities. These capabilities will be constantly increasing by
incorporating smarter communication and sensingtools.
Smart connected products capabilities
The external environment. The product’s condition,
Monitoring
operations and usage.
Control Product functions control. Personalization of theuser
experience. Programing.
Optimization Predictive diagnostics. Product performance
optimization. Costs reduction.
Autonomous product enhancement and
Autonomy personalization. Self-diagnosis and repair.
Coordination operation with other products
Efficient decisionmaking process.
Real-time data for decision making.
6
The architecture of IoT systems can be divided into four layers: Object sensing layer, data exchange
layer, information integration layer, and application service layer .
Smart devices can be already connected through traditional Internet. However, the IoT incorporates the
sensing layer which reduces the requirements on the capability of those devices and enables the
interconnection among them. Sensor data consumers communicate with sensors or sensor owner’s
through the information integration layer that is responsible of all the communication and transactions.
Meanwhile, new requirements and challenges to data exchange, information filtering and integration,
definition of new services to users, as well as the complexity of the network architecture Moreover, the
use of cloud technologies is exponentially growing. New infrastructure platforms and software
applications are offered in the frame of the IoT. Some of the major advantages and benefits of the IoT
will be the creation of innovative services with improved performance and value added solutions along
with the reduction of data acquisition costs of existing services and the opportunity to create new
revenue streams in a context of a sustainable business model. These applications can be oriented to
consumers, business, commercials, and survey activities, industrial and scientific community by
harnessing the application developers.
Four-layer architecture of IoT
Object Sensing Layer Sensing the physical objects and obtaining data.
Transparent transmission of data through
Data Exchange Layer
communication networks.
Processing of the uncertain information acquired
Information IntegrationLayer from the networks, filtering undesired data and
integratation of main information into usable
knowledge for services and final users.
Application Service Layer
Provides content services to users.
IoT market
The IoT is an emerging global Internet-based technical architecture facilitating the exchange of goods in
a global supply-chain network [1]. As the technology trend shifts towards providing faster data rates and
lower latency connectivity the Internet is expected to double in size every 5.3 years and cloud computing
can play a key role in that growing. Cloud computing is one of the enabling platforms to support IoT.
Most “things” of the real world will be integrated into the virtual world by enabling anytime, anywhere
full connectivity.
Cloud computing is a model for enabling access to a shared pool of configurable computing resources
by allowing users to take benefit from all existing technologies, without the need for deep knowledge
about or expertise with each oneof them
In 2010, the number of everyday physical objects and devices connected to the Internet was around 12.5
billion. This number is expected to double to 25 billion in2015 as the number of more smart devices per
person increases, and to a further 50billion by 2020.
7
Fig. Number of IoT connections .
Connected World.
31 % Phones.
29% Notebook.
10% Smart Phones.
8% Smart TV.
5% Tablets.
5% Game Players.
5% Media Players.
5% eReaders.
3% Others.
Asia currently has the most M2M connections because of the big effort carried out in some countries as
Japan and China. However, American and European technology companies are making an important
progress on IoT and they will bring to a market growing in these countries. With the important
emergence of the IoT,
8
Applications
The number of applications and services that can provide IoT is practically unlimited and can be
adapted to many fields of human activity by facilitating and enhancing their quality of life in multiple
ways. This chapter gives a short list of applications and services based on IoT. However, it is just a
limited description in order to understand all possible new applications and services that IoT could
provide. An estimated value about $19 trillion by 2020 is expected to be achieved by IoT applications
and services.
Education: Linking virtual and physical classrooms to make learning more efficient
and accessible, e-learning. Access services to virtual libraries and educational portals.
Interchange of reports and results in real time. Lifelong learning. Foreign languages learning.
Attendance management.
Consumer electronics: Smart phones. Smart TV. Laptops, computers and tablets.
Smart refrigerators, washers and dryers. Smart home theatre systems. Smart appliances. Pet
collar sensors. Personalization of the user experience. Autonomous product operation. Personal
locators. Smart glasses.
Automotive: Smart Cars. Traffic control. Advance information about what is broken.
Wireless monitoring of tire pressure of car. Smart energy management and control. Self-
diagnosis. Accelerometers. Position, presence and proximity sensors. Analysis of the best way to
go in real time. GPS tracking. Vehicle speedcontrol. Autonomous vehicles using IoT services.
Education: Linking virtual and physical classrooms to make learning more efficient
and accessible, e-learning. Access services to virtual libraries and educational portals.
Interchange of reports and results in real time. Lifelong learning. Foreign languages learning.
Attendance management.
Consumer electronics: Smart phones. Smart TV. Laptops, computers and tablets.
Smart refrigerators, washers and dryers. Smart home theatre systems. Smart appliances. Pet
collar sensors. Personalization of the user experience. Autonomous product operation. Personal
locators. Smart glasses.
Automotive: Smart Cars. Traffic control. Advance information about what is broken.
Wireless monitoring of tire pressure of car. Smart energy management and control. Self-
diagnosis. Accelerometers. Position, presence and proximity sensors. Analysis of the best way to
go in real time. GPS tracking. Vehicle speedcontrol. Autonomous vehicles using IoT services.
Enabling technologies
Successful application of the IoT concept into the real world is possible thanks to advancements in
underlying technologies. In this section the most relevant enabling technologies will be stated with the
aim to provide a picture of the role they will likely play in the IoT [6, 7].
Energy
Power and energy storage technologies are enablers for the deployment of IoT applications. Energy
issues, in all its phases, from harvesting to conservation and usage, are central to the development of the
IoT. These technologies have to provide high power-density energy generation and harvesting solutions
which, when used with today’s low power nanoelectronics, will enable us to design self-powered
intelligent sensor-based wireless identifiable device. There is still a need to researchand develop solutions
in this area (nanoelectronics, semiconductor, sensor technology, micro systems integration) having as
an objective ultra low power devices, and more efficient and compact energy storage like batteries, fuel
cells, and printed/polymer batteries, as current devices seem inadequate considering the processing
power needed and energy limitations of the future. In addition, system integration will increase
efficiency of current systems, and will provide a number of solutions for the future needs.
10
Cloud computing
Cloud computing is a model for on-demand access to a shared pool of configurable resources (e.g.,
computers, networks, servers, storage, applications, services, software) that can be provisioned as
Infrastructure as a Service (IaaS) or Software as a Service (SaaS). One of the most important outcomes
of the IoT is an enormous amount of data generated from devices connected to the Internet [7]. Many
IoT applications require massive data storage, huge processing speed to enable real time decision making,
and high-speed broadband networks to stream data, audio, or video. Cloud computing provides an ideal
back-end solution for handling huge data streams and processing them for the unprecedented number of
IoT devices and humans in real time.
Integration
Integration of smart devices into packaging, or better, into the products themselves will allow a
significant cost saving and increase the Eco friendliness of products. The use of integration of chips and
antennas into non-standard substrates like textiles and paper, and the development of new substrates,
conducting paths and bonding materials adequate for harsh environments and for ecologically sound
disposal will continue. System-in-Package (SiP) technology allows flexible and 3D integration of
different elements such as antennas, sensors, active and passive components into the packaging,
improving performance and reducing the tag cost. RFID inlays with a strap coupling structure are used to
connect the integrated circuitchip and antenna in order to produce a variety of shapes and sizes of labels,
insteadof direct mounting.
Sensors
Sensors are one of the key building blocks of the Internet of Things. As ubiquitous systems, they can be
deployed everywhere. They can also be implanted under human skin, in a purse or on a T-shirt. Some
can be as small as four millimetres in size, but the data they collect can be received hundreds of miles
away. They complement human senses and have become indispensable in a large number of industries,
from health care to construction. Sensors have the key advantage that they can anticipate human needs
based on information collected about their context. Their intelligence multiplied by numerous networks
allows them not only to report about external environment, but also to take action without human
intervention.
Miniaturized silicon chips are designed with new capabilities in smaller form factors and better
processing performance and efficiency. Costs are falling, following the Moore’s Law. The cost of
bandwidth has also declined and similarly the processing costs, enabling more devices to be not just
connected, but smart enough to know what to do with all the new data they are generating or receiving.
Capabilities such as context awareness and inter-machine communication areconsidered a high priority
for the IoT. Additional priorities are the integration of memory and processing power, the capacity of
resisting harsh environments, and an affordable security. Furthermore, the development of ultra low
power processors/microcontrollers cores designed specifically for mobile IoT devices anda new class of
simple and affordable IoT-centric smart systems will be an enablingfactor. The solutions in this respect
will range from micro programmed finite state machines to the use of microcontrollers. The choice is a
trade-off between flexibility, programmability, silicon area, and power consumption. The devices
require some form of non-volatile storage (EEPROM/FRAM/Polymer), independent of whether this
will be laser trimmed at the time of manufacture, one time programmable, or electrically rewritable.
Rewritable non-volatile memory is clearly preferred for achieving high throughput during production
test, and allows concurrently the benefit of user memory, programmability and storage of sensor data.
11
Communication
New, smart multi frequency band antennas, integrated on-chip and made of new materials are the
communication means that will enable the devices tocommunicate. On-chip antennas must be optimized
for size, cost and efficiency, and could come in various forms like coil on chip, printed antennas,
embedded antennas, and multiple antenna using different substrates and 3D structures. Modulation
schemes and transmission speed are also important issues to be tackledallowing multi-frequency energy
efficient communication protocols and transmission rates. The communication protocols will be designed
for Web orientedarchitectures of the IoT platform where all objects, wireless devices, cameras, PCs etc.
are combined to analyze location, intent and even emotions over a network. New methods of effectively
managing power consumption at different levels of the network design are needed, from network routing
down to the architecture of individual devices.
Standards
IoT devices are quite diverse and measure different parameters and with different conventions and units
of measure. Though competing proprietary protocols keep getting proposed, it is likely that open source
standards will be one of the ways to get this data to interoperate.
Clearly, open standards are key enablers for the success of wireless communication technologies and, in
general, for any kind of Machine-to-Machine communication. However, the need for faster setting of
interoperable standards has been recognised an important element for IoT applications deployment.
Clarification on the requirements for a unique global identification, naming and resolver is needed.
Lack of convergence of the definition of common reference models, reference architecture for the
Future Networks, Future Internet and IoT and integration of legacy systems and networks is a challange
that has to be addressed in the future.
Future of IoT
It is possible to identify, for the years to come, four distinct macro-trends that will shape the future of
internet technologies, together with the explosion of ubiquitousdevices that constitute the future Internet
of Things :
1. The first one, sometimes referred as “exaflood” or “data deluge”, is the explosion of
the amount of data collected and exchanged. As current networks are ill-suited for this
exponential traffic growth, there is a need by all the actors to re-think current
networking and storage architectures. It will be imperative to find novel ways and
mechanisms to find, fetch, and transmit data. One relevant reason for this data deluge
is the explosion in the number of devices collecting and exchanging information as
envisioned as the Internet of Things becomes a reality.
2. The energy required to operate the intelligent devices will dramatically decrease.
Already today many data centers have reached the maximum level of energy
consumption and the acquisition of new devices has necessarily to follow the
dismissal of old ones. Therefore, the second trend can be identified covering all
devices and systems from the tiniest smart dust to the huge data centers: the search
for a zero level of entropy where the device or system will have to harvest its own
energy.
Absence of Governance
One major barrier for the widespread adoption of the Internet of Things technology is the absence of
governance. Without an impartial governing authority it will be impossible to have a truly global IoT,
accepted by states, companies, trade organizations and the common people. Today there is not a unique
universal numbering scheme: EPCglobal and the Ubiquitous Networking Lab propose two different,
non-compatible ways of identifying objects and there is the risk to have them competing in the coming
future over the global market. There is also the need of keeping governance as generic as possible, as
having one authority per application field will certainly lead to overlap, confusion and competition
between standards. Objects can have different identities in different contexts so having multiple
authorities would create a kind of multi-homing, which can lead todisastrous results.
The security and privacy issues should be addressed by the forthcoming standards which must define
different security features to provide confidentiality, integrity, or availability services.
There are also a range of issues related to the identity of people. These must be dealt with in politics and
legislation, and they are of crucial importance for the efficient public administrations of the future.
13
Challenges
Reliability
Reliability aims to increase the success rate of IoT service delivery. It has a close relationship with
availability as by reliability, we guarantee the availability of information and services over time.
Reliability is even more critical and has more stringent requirements when it comes to the field of
emergency response applications. In these systems, the critical part is the communication network which
must be resilient to failures in order to realize reliable information distribution. Reliability must be
implemented in software and hardware throughout all the IoT layers. In order to have an efficient IoT,
the underlying communication must be reliable, because for example by an unreliable perception, data
gathering, processing, and transmission can lead to long delays, loss of data, and eventually wrong
decisions, which can lead to disastrous scenarios and can consequently makethe IoT less dependable.
Performance
Evaluating the performance of IoT services is a big challenge since it depends on the performance of
many components as well as the performance of the underlying technologies. The IoT, like other
systems, needs to continuously develop and improve its services to meet requirements of customers. The
IoT devices need to be monitored and evaluated to provide the best possible performance at an
affordable price for customers. Many metrics can be used to assess the performance of the IoT including
the processing speed, communication speed, device form factor, and cost.
Performance evaluation of the individual underlying protocols and technologies, application layer
protocols, and QoS have been reported in the literature, but the lack of a thorough performance
evaluation for IoT applications is still an open issue.
Interoperability
End-to-end interoperability is another challenge for the IoT due to the need to handle a large number of
heterogeneous things that belong to different platforms. Interoperability should be considered by both
application developers and IoT device manufactures to ensure the delivery of services for all customers
regardless of the specifications of the hardware platform that they use. For example, most of the
smartphones nowadays support common communication technologies such as WiFi, NFC, and GSM to
guarantee the interoperability in different scenarios. Also, programmers of the IoT should build their
applications to allow for adding new functions without causing problems or losing functions while
maintaining.
integration with different communication technologies. Consequently, interoperability is
a significant criterion in designing and building IoT services to meet requirements of customers. Beside
variety of protocols, different interpretations of the same standard implemented by different parties
presents a challenge for interoperability. To avoid such ambiguities, interoperability testing between
different products in a test-bed like ETSI Plugtests would be helpful. PROBE-IT is a research project
that aims to ensure the interoperability of validatedIoT solutions that conducted interoperability tests like
CoAP, 6LoWPAN, and IoT semantic interoperability.
It is a known fact that two different devices might not be interoperable, even if they are following the
same standard. This is a major showstopper for wide adoption of IoT technologies. Future tags must
integrate different communication standards andprotocols that operate at different frequencies and allow
different architectur es, centralised or distributed, and be able to communicate with other networks
unless global, well defined standards emerge.
14
Security and Privacy
Security presents a significant challenge for the IoT implementations due to the lack of common
standard and architecture for the IoT security. In heterogeneous networks as in the case of the
IoT, it is not easy to guarantee the security and privacyof users. The core functionality of the IoT
is based on the exchange of information between billions or even trillions of Internet connection
objects. One open problem in IoT security that has not been considered in the standards is the
distribution of the keys amongst devices. On the other hand, privacy issues and profile access
operations between IoT devices without interferences are extremely critical. Still, securing data
exchanges is necessary to avoid losing or compromising privacy. The increased number of smart
things around us with sensitive data necessitates a transparent and easy access control
management in such a way that for example one vendor can just read the data while another is
allowed to control the device. In this regard, some solutions have been proposed such as
grouping embedded devices into virtual networks and only present desired devices within each
virtual network. Another approach is to support access control in the application layer on a per-
vendor basis.
Management
The connection of billions or trillions of smart devices presents service providers with daunting issues to
manage the Fault, Configuration, Accounting, Performance and Security (FCAPS) aspects of these
devices. This management effort necessitates the development of new light-weight management
protocols to handlethe potential management nightmare that will potentially stem from the deployment of
the IoT in the coming years. Managing IoT devices and applications can be an effective factor for
growing the IoT deployments. For example, monitoring the M2M communication of the IoT objects is
important to ensure all times connectivity for providing on demand services. The Light-weight M2M
(LWM2M) is a standard that is being developed by the Open Mobile Alliance to provide interface
between M2M devices and M2M Servers to build an application agnostic scheme for the management
of a variety of devices. It aims to provide M2M
.
applications with remote management capabilities of machine-to-machine devices, services, and
applications. The NETCONF Light protocol is an Internet Engineering Task Force (IETF) effort for the
management of constrained devices provides mechanisms to install, manipulate, and delete the
configuration of network devices. It is capable of managing a broad range of devices from resource-
constrained to resource-rich devices. The independently developed MASH IoT Platform is an example
of a platform that facilitates the management (monitoring, control, and configuration) of IoT assets
anywhere in real-time using an IoT dashboard on smartphones. Maintaining compatibility across the IoT
layers also needs to be managed to enhance connectivity speed and to ensure service delivery. The Open
Mobile Alliance (OMA) Device Management working group is specifying protocols and mechanisms
for the management of mobile devices and services in resource constrained environments.
Manufacturing
Manufacturing challenges must be convincingly solved. Costs must be lowered to less than one
cent per passive RFID tag, and production must reach extremely high volumes, while the whole
production process must have a very limited impact on the environment, be based on strategies
for reuse and recycling considering the overall life-cycle of digital devices and other products
that might be tagged or sensor-enabled.
15
BLUETOOTH TECHNOLOGY
Bluetooth is a wireless communication technology designed for exchanging data over short distances using
short-wavelength UHF radio waves in the ISM band from 2.4 to 2.485 GHz. It enables devices to connect and
communicate without the need for cables, making it ideal for personal area networks (PANs).
Applications of Bluetooth
1. Audio Devices: Bluetooth is widely used for wireless headphones, speakers, and car audio systems,
allowing users to stream music and make hands-free calls.
2. Wearable Devices: Fitness trackers, smartwatches, and health monitors use Bluetooth to sync data
with smartphones and other devices.
3. Peripheral Devices: Keyboards, mice, printers, and other computer peripherals use Bluetooth to
connect wirelessly to computers and tablet s.
4. Home Automation: Smart home devices, such as lights, locks, and thermostats, use Bluetooth to
communicate with each other and with control hubs or smartphones.
5. Automotive: Bluetooth technology is used in cars for hands-free calling, audio streaming, and
connecting to diagnostic tools.
16
Benefits of Bluetooth
Wireless Convenience: Eliminates the need for cables, providing greater flexibility and
mobility.
Interoperability: Standardized protocol ensures compatibility between devices from different
manufacturers.
Low Energy Consumption: Efficient power usage makes it ideal for battery-operated devices.
Secure Communication: Built-in security features, such as encryption and frequency hopping, help
protect data during transmission.
Challenges of Bluetooth
Future of Bluetooth
The future of Bluetooth includes advancements such as Bluetooth 5.2, which brings features like LE Audio for
improved sound quality and broadcast audio for sharing audio streams with multiple devices. The development
of Bluetooth Mesh extends Bluetooth capabilities to larger-scale networks, making it suitable for smart
buildings and industrial applications. Bluetooth technology has revolutionized the way we connect devices,
providing a versatile and user-friendly wireless communication solution. Its continuous evolution and
widespread adoption make it a cornerstone of modern wireless connectivity.
17
WI-FI TECHNOLOGY
Wi-Fi is a wireless networking technology that allows devices to connect to the internet and communicate with
each other using radio waves. It is based on the IEEE 802.11 standards and operates in the 2.4 GHz and 5 GHz
frequency bands, with newer standards also utilizing the 6 GHz band. Wi-Fi is ubiquitous in homes, businesses,
and public spaces, providing a convenient and efficient way to access the internet and share data wirelessly.
1. Wireless Connectivity: Enables devices to connect to a network without physical cables, offering
mobility and ease of installation.
2. High Data Rates: Modern Wi-Fi standards support high-speed internet access, suitable for streaming
video, online gaming, and large data transfers.
3. Wide Range: Wi-Fi networks can cover large areas, from individual rooms to entire buildings and
even outdoor spaces, depending on the equipment used.
4. Interoperability: Wi-Fi-certified devices from different manufacturers can interoperate, ensuring
compatibility and ease of use.
Applications of Wi-Fi
1. Home Networking: Wi-Fi is the primary means of connecting devices like smartphones, tablets,
laptops, smart TVs, and IoT devices to the home internet.
2. Business and Enterprise: Wi-Fi provides wireless networking for offices, enabling flexible
workspaces, collaboration, and guest access.
3. Public Wi-Fi: Available in public places such as cafes, airports, and hotels, offering internet access to
visitors.
4. Education: Schools and universities use Wi-Fi to support digital learning, providing students and
faculty with internet access and network resources.
5. Healthcare: Hospitals and clinics use Wi-Fi for patient monitoring, electronic medical records, and
communication between medical devices.
18
Benefits of Wi-Fi
Convenience: Eliminates the need for cables, providing flexibility in device placement and user
mobility.
Scalability: Easy to expand a Wi-Fi network by adding more access points or range extenders.
Cost-Effective: Reduces the need for extensive cabling infrastructure, lowering installation and
maintenance costs.
High Speed and Capacity: Modern Wi-Fi standards support high data rates and multiple
simultaneous connections, suitable for bandwidth-intensive applications.
Challenges of Wi-Fi
Interference: Wi-Fi signals can be affected by other wireless devices, physical obstructions, and radio
frequency interference.
Security: Ensuring network security is crucial to prevent unauthorized access and data breaches,
requiring robust encryption and security protocols.
Coverage Limitations: Wi-Fi coverage can be limited by distance and obstacles, necessitating the
use of additional access points or mesh systems to ensure consistent coverage.
Congestion: In densely populated areas, multiple Wi-Fi networks can cause congestion, leading to
reduced performance.
Future of Wi-Fi
The future of Wi-Fi includes continued advancements in speed, capacity, and efficiency. Wi-Fi 7 (based
on the upcoming 802.11be standard) is expected to bring even higher data rates, lower latency, and
improved performance in high-density environments. Additionally, the integration of Wi-Fi with other
emerging technologies, such as 5G, will further enhance connectivity and enable new applications and
use cases.
Wi-Fi technology has become an essential part of modern life, providing seamless and convenient
wireless connectivity. Its ongoing evolution continues to enhance our ability to connect and
communicate in increasingly sophisticated ways.
19
Chapter 2
ESPRESSIF ESP 32
The ESP32, designed by Espressif Systems, is a highly integrated System-on-Chip (SoC)
that caters to the needs of the Internet of Things (IoT), wearable electronics, and embedded systems. It features
a dual-core Xtensa LX6 microprocessor, capable of operating at up to 240 MHz, providing significant
processing power for handling complex tasks. The 32-bit architecture supports efficient computation and
extensive memory addressing, complemented by 520 KB of SRAM and 448 KB of ROM for program and data
storage. The ESP32 stands out with its robust wireless capabilities, supporting IEEE 802.11 b/g/n/e/i WiFi
standards and both Bluetooth v4.2 BR/EDR and BLE, making it ideal for various wireless communication
applications.
20
PIN CONFIGURATION OF ESPRESSIF ESP 32
Communication Protocols
Communication protocols are essential for microcontrollers like the ESP32 to interface with various
peripherals and devices, ensuring reliable data exchange and coordination. The ESP32 supports multiple
communication protocols, including UART, SPI, I2C, I2S, and CAN, each serving different purposes
and applications.
SPI (Serial Peripheral Interface) is a high-speed protocol ideal for short-distance communication,
commonly used to interface with devices such as displays, memory cards, and sensors. It supports full-
duplex communication and requires four wires: MISO, MOSI, SCLK, and SS.
I2C (Inter-Integrated Circuit)is a multi-master, multi-slave protocol that enables the ESP32 to
communicate with multiple peripherals using only two wires: SDA and SCL. It is widely used for
connecting sensors, EEPROMs, and other low-speed peripherals.
I2S (Inter-IC Sound)is a protocol designed for digital audio communication. It allows the ESP32 to
interface with audio codecs, digital microphones, and other audio devices, supporting applications like
audio streaming and voice processing.
CAN (Controller Area Network)is used in automotive and industrial applications for robust and
efficient communication between multiple microcontrollers and devices within a network. It supports
high-speed data transfer and ensures data integrity in noisy environments.
22
Chapter 3
Work Carried Out
PROJECT 1:
Introduction
. Blinking LEDs is a fundamental project that introduces the basics of digital output using
microcontrollers. This simple experiment helps beginners understand how to control LEDs using code,
providing a foundation for more complex projects involving digital signals and outputs
Components
1. Microcontroller (e.g., Arduino, ESP32): The main component to control the LEDs.
2. LEDs: Light-emitting diodes, used to visually display the output signals.
o Red LED
o Green LED
o Yellow LED
3. Resistors (220 ohms): To limit the current passing through the LEDs, preventing damage.
4. Breadboard and Jumper Wires: For connecting the components.
5. Power Supply: Typically provided via the microcontroller’s USB connection to a computer.
Working Principle
The working principle is based on digital signals:
Using the digitalWrite function in the code, you can set the state of the GPIO (General Purpose
Input/Output) pins to HIGH or LOW, controlling the LEDs connected to these pins. The delay
function is used to create intervals between switching the states, resulting in the blinking effect.
Circuit Diagram
Here’s how to connect the LEDs to an Arduino microcontroller:
1. Red LED:
o Anode (long leg) to Digital Pin 2
o Cathode (short leg) to one end of a 220-ohm resistor
o Other end of the resistor to GND
o
2. Green LED:
o Anode to Digital Pin 4
o Cathode to a 220-ohm resistor, then to GND
23
3. Yellow LED:
o Anode to Digital Pin 5
o Cathode to a 220-ohm resistor, then to GND
Code Example
cpp
Copy code
#define LEDR1 2
#define LEDG2 4
#define LEDY3 5
void setup() {
pinMode(LEDR1, OUTPUT);
pinMode(LEDG2, OUTPUT);
pinMode(LEDY3, OUTPUT);
}
void loop() {
digitalWrite(LEDR1, HIGH);
delay(1000);
digitalWrite(LEDG2, LOW);
delay(100);
digitalWrite(LEDY3, LOW);
delay(100);
digitalWrite(LEDR1, LOW);
delay(1000);
digitalWrite(LEDG2, HIGH);
delay(1000);
digitalWrite(LEDY3, LOW);
delay(1000);
digitalWrite(LEDR1, LOW);
delay(1000);
digitalWrite(LEDG2, LOW);
delay(1000);
digitalWrite(LEDY3, HIGH);
delay(1000);
24
SIMULATION
Applications
1. Learning Tool: Used by beginners to understand the basics of digital output control.
2. Visual Indicators: Used in projects to provide visual feedback or status indication.
3. Debugging: Helps in troubleshooting by providing a visual indication of the program’s flow.
Conclusion
Blinking LEDs using a microcontroller is a simple yet effective way to learn about digital output
control. This foundational experiment helps build the necessary skills for more advanced projects. By
understanding the principles and code involved, you can create various patterns and control multiple
LEDs, opening the door to countless applications in electronics and embedded systems.
25
PROJECT 2:
ULTRASONIC SENSOR:
Introduction
An ultrasonic sensor is a device that uses ultrasonic sound waves to measure the distance to an object. It
sends out a sound wave at a frequency above the range of human hearing and measures the time it takes
for the sound wave to bounce back. This time is then used to calculate the distance to the object.
Ultrasonic sensors are widely used in various applications, including robotics, automotive parking
sensors, and industrial automation.
Components
1. Ultrasonic Sensor Module (HC-SR04):The main component that emits and receives ultrasonic waves.
2. Microcontroller (e.g., Arduino, ESP32): To process the sensor's data and perform calculations.
5. LCD Display (Optional): For displaying the distance measured by the sensor.
HC-SR04 Pinout:
- Echo:*Echo output.
- GND: Ground.
Working Principle
The HC-SR04 sensor works on the principle of echo. It sends out an ultrasonic pulse at 40kHz, which
travels through the air and bounces back when it hits an object. The sensor then calculates the time it
takes for the pulse to return and uses this information to determine the distance to the object.
Steps:
26
3. The pulse hits an object and reflects back.
4. The Echo pin goes HIGH for the duration of the time taken for the echo to return.
5. The microcontroller reads this time and calculates the distance using the formula:
Circuit Diagram
Here's how you can connect the HC-SR04 to a microcontroller like Arduino:
1. VCCto 5V on Arduino.
Applications
1. Obstacle Avoidance: Used in robots and vehicles to detect obstacles and avoid collisions.
2. Level Measurement: Used in tanks and silos to measure the level of liquids or solids.
5. Proximity Sensors: Used in automation systems for detecting the presence of objects .
Code Example
void setup() {
Serial.begin(9600); // Initialize serial communication
pinMode(TRIGGER_PIN, OUTPUT); // Set trigger pin as output
pinMode(ECHO_PIN, INPUT); // Set echo pin as input
pinMode(LED_PIN, OUTPUT); // Set LED pin as output
}
void loop() {
long duration, distance; // Variables to hold the pulse duration and calculated distance
27
// Measure the pulse duration from the echo pin
duration = pulseIn(ECHO_PIN, HIGH);
SIMULATION
makefile
Copy code
Distance: 15 cm
Distance:15 cm
Distance: 16 cm
Distance: 15 cm
Distance: 16 cm ...
Conclusion
Ultrasonic sensors like the HC-SR04 are versatile and widely used in various applications due to their
accuracy and ease of use. By understanding the working principle, components, and interfacing
techniques, you can implement these sensors in numerous projects to measure distance and detect
objects effectively.
28
PROJECT 3
Components
1. DHT11 Sensor Module: The main component that measures temperature and humidity.
2. Microcontroller (e.g., Arduino, ESP32): To process the sensor’s data.
3. Breadboard and Jumper Wires: For connecting the components.
4. Power Supply: Typically provided via the microcontroller’s USB connection to a computer.
5. Resistor (10k ohms): For pull-up configuration on the data line.
6. LCD Display (Optional): For displaying the temperature and humidity readings.
Specifications:
Humidity Range: 20-90% RH with ±5% accuracy.
Temperature Range: 0-50°C with ±2°C accuracy.
Operating Voltage: 3.5V to 5.5V.
Sampling Period: 1 second (takes readings every second).
Working Principle
The DHT11 sensor uses a capacitive humidity sensor and a thermistor to measure the surrounding air,
and it outputs a digital signal on the data pin. The sensor collects data in periodic intervals (typically
every 2 seconds), making it suitable for applications where real-time data is not critical but regular
updates are needed.
29
Humidity Measurement:
The capacitive humidity sensor measures the humidity in the air.
The sensor outputs an analog voltage proportional to the humidity.
The built-in ADC converts this analog voltage to a digital signal.
Temperature Measurement:
The thermistor changes its resistance with temperature.
The sensor measures the resistance and converts it to a temperature value.
Circuit Diagram
Here's how you can connect the DHT11 to an Arduino:
1. VCC to 5V on Arduino.
2. Data to Digital Pin 2 on Arduino (with a 10k ohm pull-up resistor between Data and VCC).
3. GND to GND on Arduino.
Applications
1. Weather Stations: To monitor environmental conditions.
2. Home Automation: For HVAC systems and smart home applications.
3. Greenhouses: To maintain optimal growing conditions by monitoring humidity and
temperature.
4. Industrial Applications: For environmental monitoring in factories and warehouses.
5. Healthcare: To maintain proper humidity and temperature levels in hospitals and clinics.
Code Example
#include<DHT.h>
#define dht_pin 15
#define dht_Type DHT11
DHT dht(dht_pin, dht_Type );
void setup() {
Serial.begin(115200);
dht.begin() ;
}
void loop()
{
float temperature= dht.readTemperature();
Serial.print("Temp: " );
Serial.print(temperature);
Serial.println("°C");
float Humidity= dht.readHumidity();
Serial.print("Hum: " );
Serial.print(Humidity);
Serial.println("%");
delay(1000);
}
30
SIMULATION
Copy code
Temperature: 25.60 C, Humidity: 60.20 %
Temperature: 25.70 C, Humidity: 60.10 %
Conclusion
The DHT11 sensor is a versatile and easy-to-use device for measuring temperature and humidity. Its low
cost and simplicity make it an excellent choice for beginners and hobbyists, while its reliable
performance suits various applications, from weather stations to home automation. Understanding how
to interface the DHT11 with a microcontroller and display the readings on an LCD provides a solid
foundation for more advanced environmental monitoring projects.
31
PROJECT 4
Using Edge Impulse
Introduction
Edge Impulse is a leading development platform for machine learning on edge devices. This project
leverages Edge Impulse and a smartphone to record data for developing a machine learning model. The
recorded data can be used for various IoT applications such as activity recognition, sound classification,
or environmental monitoring.
Objectives
• To understand the process of collecting data using a smartphone.
• To use Edge Impulse for building and training a machine learning model.
• To deploy the trained model on an edge device.
Data Collection
Steps to Record Data Using a Smartphone
1. Create an Edge Impulse Account: Sign up at Edge Impulse.
2. Create a New Project: Once logged in, create a new project for your data collection.
3. Install Edge Impulse App: Download and install the Edge Impulse app from the App Store (iOS) or
Google Play Store (Android).
4. Connect the Smartphone to Edge Impulse: Open the app and log in using your Edge Impulse
credentials. Connect your smartphone to your project.
Data Recording
1.Select Data Type: Choose the type of data you want to collect (e.g., accelerometer, microphone,
camera)
2. Record Data: Use the app to record data samples. For example, if you are collecting accelerometer
data, perform various activities (walking, running, sitting) while recording.
3. Label Data: Properly label each recorded data sample to ensure accurate training of the machine
learning model.
4. Upload Data: Once recorded, upload the data to the Edge Impulse Studio.
Data Preprocessing
1. Data Visualization: In Edge Impulse Studio, visualize the recorded data to understand its structure
and identify any anomalies.
2. Data Splitting: Split the data into training, validation, and test sets.
3. Feature Extraction: Use Edge Impulse's built-in feature extraction tools to convert raw data into
features that the machine learning model can use.
Model Training
32
1. Select Model Type: Choose a suitable machine learning model for your data (e.g., neural network,
decision tree).
2. Configure Model Parameters: Set the parameters and hyperparameters for the chosen model.
3. Train the Model: Train the model using the training dataset. Edge Impulse provides real-time
feedback on the training process, including accuracy and loss metrics.
4. Model Validation: Validate the model using the validation dataset to ensure it generalizes well to
unseen data.
Model Deployment
1. Export Model: Once satisfied with the model performance, export the trained model. Edge Impulse
supports various formats, including Arduino library, TensorFlow Lite, and ONNX.
2. Deploy on Edge Device: If you have an edge device, deploy the model and run inference on the
collected data. For instance, you can use an Arduino or ESP32 to integrate the model and perform real-
time classification or detection
Applications
Benefits
1. Ease of Use: Edge Impulse provides an intuitive interface for data collection, model
training, and deployment.
2. Real-Time Processing: Enables real-time data processing and decision-making on edge
devices.
3. Scalability: The platform supports various edge devices, making it scalable for
different IoT applications.
4. Cost-Effective: Utilizing a smartphone for data collection reduces the need for
specialized hardware, making it cost-effective.
Challenges
1. Data Quality: Ensuring the recorded data is of high quality and properly labeled is crucial
for accurate model training.
2. Device Compatibility: Ensuring the deployed model is compatible with the target edge
device.
3. Real-Time Constraints: Meeting real-time processing requirements on resource-
constrained edge devices.
Conclusion
Using Edge Impulse and a smartphone for data recording and machine learning model
development is a powerful approach for IoT projects. This method leverages accessible
technology to build sophisticated models that can be deployed on various edge devices,
enabling real-time, intelligent decision- making across numerous applications.
33
34
35
36
PROJECT 5
Using BMP280 Sensor and ESP32
Introduction
This project aims to measure temperature, pressure, and altitude using the BMP280 sensor
connected to an ESP32 microcontroller. The BMP280 is a barometric pressure sensor that can
also measure temperature and estimate altitude based on pressure readings. This report covers
the components used, circuit setup, code implementation, and expected outputs.
Components
Pin Connections
Here is the connection layout between the ESP32 and the BMP280 sensor:
37
Circuit Diagram
Copy code
BMP280 ESP32
+ + + +
| VCC |-------| 3.3V |
| GND |-------| GND |
| SCL |-------| GPIO22|
| SDA |-------| GPIO21|
+ + + +
void setup() {
// Start serial communication at 115200 baud rate Serial.begin(115200);
void loop() {
// Read temperature, pressure, and calculate altitude float
temperature = bmp.readTemperature();
float pressure = bmp.readPressure() / 100.0F; // Convert Pa to hPa float
altitude = bmp.readAltitude(1013.25); // Adjusted for sea
level pressure
Serial.print("Altitude: ");
Serial.print(altitude);
Serial.println(" m");
delay(2000);
}
38
Explanation of the Code
1. Include Libraries:
o The Wire.h library is for I2C communication.
o The Adafruit_Sensor.h and Adafruit_BMP280.h libraries are for
interacting with the BMP280 sensor.
2. Setup Function:
o Initializes serial communication at 115200 baud rate.
o Checks if the BMP280 sensor is connected and properly initialized.
3. Loop Function:
o Reads temperature in Celsius from the BMP280 sensor.
o Reads pressure in Pascals and converts it to hectopascals (hPa).
o Calculates altitude based on the pressure reading and standard sea level pressure
(1013.25 hPa).
o Prints the temperature, pressure, and altitude readings to the Serial Monitor.
o Delays for 2 seconds before taking the next reading.
Expected Output
When you upload the code to your ESP32 and open the Serial Monitor (set to 115200 baud), you
should see to the continuous readings of temperature, pressure, and altitude, similar
following output:
Copy code
Temperature: 24.58 *C
Pressure: 1012.45 hPa
Altitude: 25.67 m
Temperature: 24.57 *C
Pressure: 1012.46 hPa
Altitude: 25.65 m
...
39
Applications
Conclusion
This project demonstrates how to use the BMP280 sensor with the ESP32 microcontroller to measure
temperature, pressure, and altitude. By following the outlined steps, you can set up the hardware, write
the code, and visualize the sensor data on the Serial Monitor. This foundational project can be expanded
for more complex IoT applications involving environmental monitoring and data logging.
40
Uploading Sensor Data to the Cloud Using Blynk and ESP32
Introduction
This section explains how to upload temperature, pressure, and altitude data from the BMP280
sensor connected to an ESP32 to the Blynk cloud. Blynk is a platform that allows you to build
mobile and web applications for the Internet of Things (IoT) to control hardware remotely,
display sensor data, store data, and visualize it.
Setting Up Blynk
1. Create a Blynk Account: Download the Blynk app from the App Store or Google Play
Store and sign up for an account.
2. Create a New Project:
o Open the Blynk app and create a new project.
o Choose "ESP32" as the device.
o Choose "WiFi" as the connection type.
o Blynk will send an authentication token to your email. This token will be used to link
your hardware to the Blynk cloud.
3. Configure Widgets in Blynk App:
o Add three value display widgets for temperature, pressure, and altitude.
o Assign virtual pins to each widget (e.g., V0 for temperature, V1 for pressure, V2 for
altitude).
Circuit Diagram
Copy code
BMP280 ESP32
+ + + +
| VCC |-------| 3.3V |
| GND |-------| GND |
| SCL |-------| GPIO22|
| SDA |-------| GPIO21|
+ + + +
41
Code for ESP32
Below is the code to read data from the BMP280 sensor and send it to the Blynk cloud.
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_BMP280.h>
BlynkTimer timer;
int flag=0;
void sendSensor() {
float t=bmp.readTemperature();
float p=bmp.readPressure();
float a=bmp.readAltitude(1013.25);
// float h = dht.readHumidity();
Blynk.virtualWrite(V0, t);
Blynk.virtualWrite(V1, p);
Blynk.virtualWrite(V2, a);
digitalWrite(LED1,HIGH);
void sendSensor() {
float t=bmp.readTemperature();
float p=bmp.readPressure();
float a=bmp.readAltitude(1013.25);
// float h = dht.readHumidity();
Blynk.virtualWrite(V0, t);
Blynk.virtualWrite(V1, p);
Blynk.virtualWrite(V2, a);
digitalWrite(LED1,HIGH);
}
else if (t<=27 && flag==1){
digitalWrite(LED1,LOW);
flag=0;
}
}
void setup() {
pinMode(2,OUTPUT);
Serial.begin(9600);
while ( !Serial ) delay(100); // wait for native usb
Serial.println(F("BMP280 test"));
unsigned status;
status = bmp.begin(0x76);
timer.setInterval(1000L, sendSensor);
//status = bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID);
if (!status) {
Serial.println(F("Could not find a valid BMP280 sensor, check
wiring or "
"try a different address!"));
Serial.print("SensorID was: 0x");
Serial.println(bmp.sensorID(),16);
Serial.print(" ID of 0xFF probably means a bad address, a
BMP 180 or BMP 085\n");
Serial.print(" ID of 0x56-0x58 represents a BMP 280,\n");
Serial.print(" ID of 0x60 represents a BME 280.\n");
Serial.print(" ID of 0x61 represents a BME 680.\n");
43
while (1) delay(10);
}
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println(" Pa");
Serial.println();
delay(2000);
Blynk.run();
timer.run();
}}
44
Explanation of the Code
1. Include Libraries:
o Wire.h: For I2C communication.
o Adafruit_Sensor.h and Adafruit_BMP280.h: For interacting with the
BMP280 sensor.
o WiFi.h and BlynkSimpleEsp32.h: For connecting to Wi-Fi and the Blynk
cloud.
2. Global Variables:
o auth[]: The Blynk authentication token.
o ssid[] and pass[]: Wi-Fi credentials.
3. Setup Function:
o Initializes serial communication.
o Initializes the BMP280 sensor and checks if it's connected.
o Connects to the Wi-Fi network.
o Initializes Blynk with the authentication token and Wi-Fi credentials.
4. Loop Function:
Expected Output
Once the code is uploaded to the ESP32 and the device is connected to Wi-Fi and Blynk, you
should see the sensor readings displayed in real-time on the Blynk app.
Copy code
Temperature: 24.58 *C
Pressure: 1012.45 hPa
Altitude: 25.67 m
Temperature: 24.57 *C
Pressure: 1012.46 hPa
Altitude: 25.65 m
...
Blynk App Output
The Blynk app will display the temperature, pressure, and altitude values updated every 2
seconds on the corresponding widgets.
Conclusion
By following the steps outlined in this report, you can successfully collect temperature, pressure, and
altitude data using the BMP280 sensor and ESP32, and upload the data to the Blynk cloud. This project
demonstrates the integration of hardware and cloud services to build an IoT application capable of real-
time data monitoring and visualization.
45
PROJECT 6
This project involves the use of ESP32 LoRa modules to detect and transmit temperature and
humidity data wirelessly. The ESP32 LoRa combines the functionalities of the ESP32 microcontroller
with LoRa (Long Range) communication, making it ideal for IoT applications that require low power
and long-range data transmission. In this project, we use a DHT22 sensor to measure temperature and
humidity.
Objectives
1. ESP32 LoRa Modules: One for transmitting and one for receiving data.
2. DHT22 Sensor: For measuring temperature and humidity.
3. Jumper Wires: For making connections.
4. Breadboard: For prototyping.
5. Power Supply: To power the ESP32 LoRa modules and the sensor.
6. USB Cable: For programming the ESP32 LoRa modules and providing power.
Pin Connections
Transmitter ESP32 LoRa to DHT22 Sensor
46
Circuit Diagrams
Transmitter Setup
Copy code
DHT22 ESP32 LoRa
+-------+ + ------ +
| VCC |-------| 3.3V |
| GND |-------| GND |
| DATA |-------| GPIO4 |
+ + + +
Receiver Setup
Copy code
Only ESP32 LoRa required for receiving data
Code Implementation
Transmitter Code
cpp
Copy code
#include <LoRa.h>
#include <DHT.h>
void setup() {
Serial.begin(115200);
dht.begin();
// Initialize LoRa with frequency 915E6
LoRa.begin(915E6);
}
void loop() {
float humidity = dht.readHumidity();
float temperature = dht.readTemperature();
if (isnan(humidity) || isnan(temperature)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
LoRa.print(data);
LoRa.endPacket();
47
Serial.println(data);
void setup() {
Serial.begin(115200);
// Initialize LoRa with frequency 915E6
LoRa.begin(915E6);
}
void loop() {
// Try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// Read packet
String receivedData = "";
while (LoRa.available()) {
receivedData += (char)LoRa.read();
}
// Print the received data
Serial.println("Received: " + receivedData);
}
}
Explanation of the Code
Transmitter Code
1. Include Libraries:
o LoRa.h: For LoRa communication.
o DHT.h: For interacting with the DHT22 sensor.
2. Define Pins and Initialize Sensor:
o Define the GPIO pin connected to the DHT22 data pin.
o Create an instance of the DHT sensor.
3. Setup Function:
o Initialize serial communication.
o Initialize the DHT22 sensor.
o Initialize the LoRa module with the frequency 915 MHz.
4. Loop Function:
o Read temperature and humidity from the DHT22 sensor.
o Check for sensor reading errors.
o Convert the sensor readings to a string.
o Send the data string via LoRa.
o Print the data to the Serial Monitor.
o Delay for 2 seconds before the next reading.
48
Receiver Code
1. Include Libraries:
o LoRa.h: For LoRa communication.
2. Setup Function:
o Initialize serial communication.
o Initialize the LoRa module with the frequency 915 MHz.
3. Loop Function:
o Check if a LoRa packet is received.
o Read and concatenate the received bytes into a string.
o Print the received data to the Serial Monitor.
Expected Output
Transmitter Serial Monitor Output
Copy code
Temperature: 25.60 C, Humidity: 60.20 %
Temperature: 25.70 C, Humidity: 60.10 %
...
Receiver Serial Monitor Output
yaml
Copy code
Received: Temperature: 25.60 C, Humidity: 60.20 %
Received: Temperature: 25.70 C, Humidity: 60.10 %
...
49
50
Applications
Conclusion
This project demonstrates the use of ESP32 LoRa modules to detect and transmit temperature
and humidity data wirelessly. The combination of the DHT22 sensor and LoRa communication
provides a low-power, long-range solution for various IoT applications. By following the
outlined steps, you can successfully set up the hardware, write the code, and visualize the
sensor data remotely.
51
Touch sensor inbuilt in ESP32
The ESP32 microcontroller includes a built-in touch sensor peripheral that allows it to detect touch
inputs without the need for external components like capacitive touch sensors. Here are some key
points about the inbuilt touch sensor in the ESP32:
Overall, the inbuilt touch sensor in the ESP32 enhances its versatility and usability for a wide range
of IoT and embedded projects that require touch- sensitive interfaces.
52
Chapter 4
Conclusion
The projects discussed encompass a range of applications utilizing the ESP32 microcontroller
in conjunction with various sensors and communication
technologies. Here’s a summary of the conclusions drawn from each project:
Overall Implications
In conclusion, the ESP32 microcontroller stands out as a powerful and flexible platform for IoT
development, empowering engineers and hobbyists to innovate in various domains including
environmental monitoring, smart agriculture, home automation, and beyond. Its integration
capabilities with sensors and communication technologies enable the creation of efficient, scalable,
and connected IoT solutions.
53
References
These resources provide a wealth of information ranging from basic tutorials to advanced technical
details, helping you explore, develop, and troubleshoot ESP32-based IoT projects effectively.
54
55