SMART
TECHNOLOGY
ENG\ Abd Alsalam Aladawi
ENG\ Omar Dahy
abd_alsalam aladawi | LinkedIn
Omar Dahy | LinkedIn
LECTURE
1
• Internet of Things (IoT)
• Internet of Things (IoT)
The term IoT, or Internet of
Things, refers to the
collective network of
connected devices and the
technology that facilitates
communication between
devices and the internet, as
well as between the
devices themselves.
Why is IoT important?
IoT is important for business for several reasons. Here are the core benefits of IoT:
Improved efficiency:
By using IoT devices to automate and optimize processes, businesses can improve efficiency and
productivity. For example, IoT sensors can be used to monitor equipment performance and detect
or even resolve potential issues before they cause downtime, reducing maintenance costs and
improving uptime.
Data-driven decision-making:
IoT devices generate vast amounts of data that can be used to make better-informed
business decisions and new business models. By analyzing this data, businesses can gain
insights into customer behavior, market trends, and operational performance, allowing
them to make more informed decisions about strategy, product development, and
resource allocation.
Why is IoT important?
Cost-savings:
By reducing manual processes and automating repetitive tasks, IoT can help
businesses reduce costs and improve profitability. For example, IoT devices can be
used to monitor energy usage and optimize consumption, reducing energy costs and
improving sustainability.
Enhanced customer experience:
By using IoT technology to gather data about customer behavior, businesses can
create more personalized and engaging experiences for their customers. For example,
retailers can use IoT sensors to track customer movements in stores and deliver
personalized offers based on their behavior.
• IoT Technologies
Edge computing:
It is a distributed computing framework
that brings enterprise applications
closer to data sources such as IoT
devices or local edge servers. This
proximity to data at its source can
deliver strong business benefits,
including faster insights, improved
response times and better bandwidth
availability.
• Edge Computing use case
example of this is condition based monitoring. Today, remote assets are monitored but
this is often difficult and time-consuming, because they may span across vast areas and
failures can be disastrous (e.g. oil pipeline explosions, water pipeline leakages). IoT
sensors can be used to monitor the conditions of an asset (e.g. temperature, pressure,
vibrations etc.) which can alert owners of potential issues and ensure the asset is fixed
before failure.
Today, this occurs using connectivity to the centralized cloud. However, edge computing
can provide some real benefits. With potential risks on critical systems and safety of
those in near proximity, alarms need to be triggered immediately if an anomalous
reading is reported. Edge computing means processing of data can occur closer to the
location of detection, and doesn’t need to rely on the quality of the network connection.
On top of this, while devices are functioning as intended, raw monitoring data indicates
normal behavior and is not useful. Edge computing means that large volumes of data do
not need to be unnecessarily sent to the cloud. For condition-based monitoring, then,
edge computing is not required for the use case to be implemented, but can provide
some material benefits.
• Edge Computing use case
• Edge Computing benefits
1-Real-time Latency Reduction:
Many IoT applications are essentially advanced monitoring systems:
they collect data ,analyze the data and then trigger actions based on the
insights generated. In some cases, this is done on an hourly or daily basis,
or only when triggered by a specific interaction with the device. Edge
computing can provide a benefit to IoT when these insights are needed in
real-time. By providing compute closer to the IoT device, data collection
and analytics take place at a physically closer location (i.e. often within the
same country or region, perhaps even on the premises, rather than in a
large centralized data centre). In doing this, network latency is reduced as
the round trip to the data centre and back is shorter. In this way, edge
computing can optimize IoT applications that require real-time actions
(e.g. cooling systems turned on as soon as a sensitive piece of machinery
starts to overheat).
• Edge Computing benefits
2-Optimizing Bandwidth Usage
Many IoT devices will send very small packets of data back to a data
management platform that runs analytics to derive insights. At the
moment, this functions well with data being streamed to a platform
running in a centralized (often private) cloud. In the future, with an
explosion in the number of connected devices, this may lead to a
significant strain on operators’ backhaul network. Even if individual
data packets are only a few bytes, when this is being streamed real-
time from very many devices in a relatively small geographic area, e.g.
a manufacturing plant or a metro center, the culminative effect could
be very large. Edge computing can enable processing and filtering of
IoT generated data closer to the devices, optimizing bandwidth by
ensuring that only data needed for longer term storage or analysis is
streamed to a centralized management platform.
• Edge Computing benefits
3-Enhancing IoT Security:
A major headache for many with the IoT ecosystem is how to
manage security as more and more devices are connected.
Malware can be used to harness IoT devices to perform DDoS
attacks, for example. While edge computing is unlikely to be, in and
of itself, more secure than a private cloud, it does have the benefits
of being more local. For companies concerned about storing data in
locations which, for example, have different data protection laws
than where the data is being generated, edge computing can
provide some security benefits. Particularly if the edge servers are
located on the premises, companies can be sure that data never
leaves their own local perimeter and can control all access to the
servers storing the information.
• IoT Technologies
Cloud Computing:
Cloud Computing is a way to use computer services, like
storing information or running programs, over the internet
without using our machines or equipment. It makes it easy
for people to access data from anywhere in the world.
One example of cloud computing is online storage services
like Dropbox or Google Drive. They let us save files in a
different place and open them on any device with internet
access.
Cloud computing services are of three main types:
•Infrastructure as a Service (IaaS) - Companies rent
virtualized hardware for processing power
•Platform as a Service (PaaS) - Allows developers to create
apps using specific platform-provided tools.
•Software as a Service (SaaS) - Gives users access to software
applications via subscription models.
• IoT & Cloud Relationship
IoT and Cloud Computing are closely linked technologies, with cloud-based IoT data
storage and management and cloud computing playing a pivotal role in enabling IoT.
The massive amount of data generated daily by IoT devices like smart thermostats and
fitness bands can be stored and managed in the cloud. This takes advantage of the
cloud's scalability, flexibility, and low cost. With AI-driven analytics tools, valuable insights
can be extracted from this raw data, all in the cloud.
For example, IoT devices sending data to the cloud can monitor and study a city's traffic
patterns. It helps city planners find ways to reduce traffic congestion and improve city
life.
Cloud computing helps IoT by providing storage and computing power for IoT
applications. Companies can store their data on remote servers, accessed anytime and
anywhere. It makes it easier for devices to stay connected and ensure real-time data
exchange.
Developers can also create custom IoT solutions using cloud services without needing
lots of hardware or programming knowledge.
• IoT & Cloud Applications
IoT and Cloud Computing are used in many areas like smart
cities, healthcare, agriculture, manufacturing, and retail.
• IoT & Cloud Applications
1. Smart Cities
IoT and Cloud Computing are helping to build smart cities. 3. Manufacturing
Cities can collect real-time data about traffic, pollution, energy IoT devices and cloud computing are improving
use, and more through connected devices and cloud platforms. manufacturing processes by monitoring machines in
real time and using cloud-based data storage for
For example, Barcelona uses IoT and Big Data to improve its efficiency and collaboration. Sensors send data to
transportation system and reduce air pollution. Sensor- the cloud for analysis, helping manufacturers spot
equipped traffic systems and AWS cloud infrastructure work problems before they happen.
together, helping the city cut pollution and save money.
4. Retail Transformation
IoT and Cloud Computing are upgrading retail
2. Healthcare businesses. Customers have a better shopping
IoT and cloud computing technologies are changing healthcare. experience with improved operations, inventory
Wearable devices track patients' health, and the data is management, and logistics.
securely stored in the cloud for analysis and treatment.
Retailers can collect data on stock levels and
Health risks can be spotted early using machine learning and customer habits through IoT devices and cloud
AI, leading to better treatment and lower costs. analytics, leading to faster decision-making and
better results.
• IoT & Cloud Merge benefits
1. Scalability and Flexibility for IT Infrastructure
One significant advantage of combining IoT and cloud technology is scalability and flexibility.
Businesses today generate massive amounts of data through IoT devices, requiring a reliable and
robust system to manage this data effectively without causing downtime or delays.
Businesses can quickly scale resources up or down using cloud solutions based on their needs.
Cloud computing also offers more flexibility, allowing access to data and applications from
anywhere.
Companies can use the "as-a-service" model (IaaS, PaaS, SaaS) to easily access software tools and
services. It might be challenging to manage in-house due to cost constraints or technical
limitations.
• IoT & Cloud Merge benefits
2. Cost-Effectiveness
Merging IoT and cloud computing can help businesses save money. By using cloud-based
solutions, companies can significantly reduce infrastructure costs while ensuring access to
scalable data storage and analytics capabilities.
It means lower initial investment costs and higher operational efficiency through
automated workflows. For example, a business can improve decision-making by using IoT
devices to track real-time inventory and reduce waste through predictive maintenance.
IoT sensors collect large amounts of data from multiple locations. This data is processed
on central cloud platforms for analysis. Organizations can track various metrics, like
energy consumption levels and temperature control systems' performance. They don't
need to install local hardware, leading to cost-saving benefits.
• IoT & Cloud Merge benefits
3. Better Data Security
Combining IoT and cloud technologies can strengthen data security, which is crucial in today's digital
world. Companies must protect their valuable data from un authorized access or hacking attempts.
Encryption protocols like Transport Layer Security (TLS) can secure sensitive data transmitted between
devices over the network. Additionally, implementing role-based access control policies and multi-
factor authentication mechanisms can reduce risks related to privileged access misuse or insider
threats.
4. Improved Performance and Reliability
Merging IoT and cloud computing can significantly enhance performance and reliability for businesses.
This combination allows faster access to real-time data, which can be swiftly analysed, providing
actionable insights for better decision-making.
For instance, a logistics company can use IoT sensors to track goods in transit. IoT devices need fast and
reliable connectivity to transmit accurate data without interruption. Cloud computing provides scalable
storage capacity and high-speed access to this information, making data available when needed.
• Machine Learning in IoT
IoT and machine learning deliver
insights otherwise hidden in data for
rapid, automated responses and
improved decision making. Machine
learning for IoT can be used to project
future trends, detect anomalies, and
augment intelligence by ingesting
image, video and audio.
Machine learning can help
demystify the hidden patterns in
IoT data by analyzing massive
volumes of data using
sophisticated algorithms. Machine
learning inference can supplement
or replace manual processes with
automated systems using
statistically derived actions in
critical processes.
• Machine Learning in IoT use cases
Companies are utilizing machine learning for IoT
to perform predictive capabilities on a wide
variety of use cases that enable the business to
gain new insights and advanced automation
capabilities.
With machine learning for IoT, you can:
•Ingest and transform data into a consistent
format
•Build a machine learning model
•Deploy this machine learning model on cloud,
edge and device
For example, using machine learning, a company
can automate quality inspection and defect
tracking on its assembly line, track activity of
assets in the field and forecast consumption &
demand patterns.
• Machine Learning IoT benefits
1.Predictive Maintenance: 3. Enhanced Energy Efficiency:
Machine learning algorithms can analyze IoT sensor data Machine learning algorithms can
to predict equipment failures before they occur, optimize energy usage in IoT-enabled
enabling proactive maintenance and minimizing devices and systems by analyzing
downtime. historical data and adjusting settings in
real-time based on current conditions,
leading to significant energy savings.
2. Anomaly Detection: 4.Optimized Resource Allocation:
By continuously monitoring IoT sensor data, machine Machine learning algorithms can optimize
learning models can identify abnormal patterns or resource allocation in IoT networks by
behavior, helping to detect security breaches, faults, or dynamically reallocating resources based on
unusual events in real-time. demand, traffic patterns, or environmental
conditions, leading to more efficient utilization
of network resources and improved
performance.
• How does IoT work ?
Typical IoT system has three components:
Smart devices:
this is a device, like a television, security camera, or exercise equipment that has been
given computing capabilities. It collects data from its environment, user inputs, or usage
patterns and communicates data over the internet to and from its IoT application.
IoT application:
An IoT application is a collection of services and software that integrates data received from
various IoT devices. It uses machine learning or artificial intelligence (AI) technology to
analyze this data and make informed decisions. These decisions are communicated back to
the IoT device and the IoT device then responds intelligently to inputs
A graphical user interface:
The IoT device or fleet of devices can be managed through a graphical user interface.
Common examples include a mobile application or website that can be used to register and
control smart devices.
• ESP32 Development board
• The ESP32 is a popular family of wireless
microcontroller chips developed by the
Chinese chip maker ESPRESSIF.
• offers a powerful combination of features
and capabilities for IoT applications.
• a dual-core processor
• integrated Wi-Fi and Bluetooth connectivity
• a large number of general purpose
input/output (GPIO) pins
• low power consumption
• ESP32 PIN CONFIGURATION
• ESP32 PIN CONFIGURATION
There is two types of pin in ESP32 DEV Boards:
GPIO Pins: The ESP32 WROOM-DA module has Special Purpose Pins: each serving a distinct
numerous General Purpose Input/Output (GPIO) pins function. These pins are typically denoted by specific
that can be configured for various purposes, labels and may have dedicated functionalities.
including digital input/output, PWM output, ADC Including EN (Enable), BOOT (Bootstrapping), VIN
input, etc. (Voltage Input), GND (Ground), 3V3 (3.3V Output)
• GPIO PINS
All of GPIO pins can be used as digital input/output, and some of them has an alternative functions such
as:
SPI Interface: (there’re two SPI interfaces in ESP32)
•MOSI (Master Out Slave In): Usually mapped to GPIO pin 23.
•MISO (Master In Slave Out): Usually mapped to GPIO pin 19.
•SCK (Serial Clock): Usually mapped to GPIO pin 18.
•SS/CS (Slave Select/Chip Select): Usually mapped to GPIO pin 5.
I2C Interface:
•SDA (Serial Data): Usually mapped to GPIO pin 21.
•SCL (Serial Clock): Usually mapped to GPIO pin 22.
UART Interface: (there’re three UART interfaces ins ESP32)
•TX0 (Transmit): Usually mapped to GPIO pin 1.
•RX0 (Receive): Usually mapped to GPIO pin 3.
ADC Pins: (there’re two ADC interfaces)
Analog input pins: most GPIO pin can typically be configured as an ADC input.
(32 – 39, 0, 2, 4, 12 - 15 and 25 - 27).
• GPIO PINS
DAC Pins:
•DAC1: Usually mapped to GPIO pin 25.
•DAC2: Usually mapped to GPIO pin 26.
PWM Pins: (16 channel)
Any GPIO pin can typically be configured for PWM
output except (34-39)
ledcAttachPin(GPIO, channel);
Touch Sensors:
Touch sensor inputs: Dedicated GPIO pins for touch sensing.
(32,33,27,14,12,13,4,0,2,15)
External Interrupts:
GPIO pins can be configured to trigger interrupts.
• Special Purpose pins
VDD (Voltage Input): This pin is used to provide the supply
voltage to the internal circuits of the ESP32 module.
EN (Enable): This pin is used to enable or disable the ESP32
module. Pulling this pin HIGH enables the chip, while pulling it 3V3 (3.3V Output): This pin provides a regulated 3.3V
LOW disables it. output voltage, which can be used to power external
components that require 3.3V.
BOOT (Bootstrapping): This pin determines the boot mode of
the ESP32 during startup. It can be grounded or pulled HIGH to
select different boot modes, such as flashing firmware from
external memory or entering the bootloader. GND (Ground): These pins are connected to the ground
reference of the system and are used as common return
paths for electrical signals.
VIN (Voltage Input): This pin is used to provide external power
to the ESP32 module. It is connected to the input voltage
source, typically 5V or 3.3V, depending on the module's
specifications.
• Install ESP32 in Arduino IDE
In the (Additional Board Manager URLs)
Open file menu then Enter this: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
select preferences
1 2
• Install ESP32 in Arduino IDE
3
Open Tools menu
then select Board
and select Boards
Manager
• install ESP32 in Arduino IDE
Search for ESP32
and press install
button for the
“ESP32 by 4
Espressif Systems“:
• Test ESP32 installation
• Plug the ESP32 TO your
Device via USB Cable
• Open start menu
• Open Device Manager
• Test ESP32 installation
• Select Ports
• The ESP should
appear as following
• If it doesn’t you need
to update or
install CP210x USB ESP32
to UART Bridge
VCP Drivers
• Test ESP32 installation
• Open CP210x USB TO
UART BRIDGE VCP
Driver site
1
• Select
USB to
DOWNLOADS
• Choose the latest
version for your
operating system
• Download it and 2
install it
• Test ESP32 installation
Go to tools then board and select your ESP Board in our case it’s ESP32-WROOM-DA Module
You can choose your own board too
2
3
4
• Test ESP32 installation
• From tools select your
COM PORT which you
have checked in
Device Manager
2
3
• Test ESP32 installation
• Now we will upload code
to blink the built-in LED
in the ESP32 board
• Built-in LED is connected
to Digital pin 2
• Test ESP32 installation
• In some cases while uploading
the code you need to press
and hold the BOOT push
button on the ESP
• After uploading is done you
need to hit RESET (EN) push
button on the ESP
• Test ESP32 installation
• Signal Types
on on on
5V 5V
off off off
0V 0V
Digital signal Analog signal
• Some Digital
Digital SignalSignal app
Fire detection sensor
Movement
detection sensor
• Some Analog
Digital Signal app
Signal
Light Sensor
Variable resistance
Smoke Sensor
• ESP32 Interfacing
1. Make ESP32 OUTPUTs a digital signal on pin no. 7
void setup() {
pinMode(7,OUTPUT) ;
//OR pinMode(7,1);
}
2. Make ESP32 receives a digital INPUT signal
on pin no. 11
void setup() {
pinMode(11,INPUT) ;
//OR pinMode(7,O);
}
• ESP32 OUTPUT signal
1. Make ESP32 OUTPUTs a 5 volt signal on pin no. 4
void setup() {
pinMode(14,OUTPUT);
digitalWrite(14,HIGH);
//digitalWrite(14,1);
}
1. Make ESP32 OUTPUTs a 0 volt signal on pin
no. 4
void setup() {
pinMode(14,OUTPUT);
digitalWrite(14,LOW);
//digitalWrite(14,0);
}
• Blink code
int ledPin = 14;
void setup()
{
pinMode(ledPin , OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
• Another way of coding
int ledPin = 14;
int on = 1000;
int off = 1000;
void setup()
{
pinMode(ledPin , OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(on);
digitalWrite(ledPin, LOW);
delay(off);
}
int red = 9;
int yellow = 10;
int green = 11;
int ON = 1000;
int OFF = 1000;
void setup()
{
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}
void loop()
{
digitalWrite(red, HIGH);
delay(ON);
digitalWrite(red, LOW);
delay(OFF);
digitalWrite(yellow, HIGH); delay(ON); digitalWrite(yellow, LOW); delay(OFF);
digitalWrite(green, HIGH); delay(ON); digitalWrite(green, LOW); delay(OFF);
}
int red = 9;
int yellow = 10;
int green = 11;
int ON = 1000;
int OFF = 1000;
void setup()
{
pinMode(red, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(green, OUTPUT);
}
void loop()
{
digitalWrite(red, HIGH);
digitalWrite(yellow,HIGH)
digitalWrite(green, HIGH);
delay(ON);
digitalWrite(red, LOW);
digitalWrite(yellow, LOW);
digitalWrite(green, LOW);
delay(OFF);
}
• Task