FIoT Imps Part-2 ?
FIoT Imps Part-2 ?
• It was designed to promote computer science education and make computing accessible to
a broader audience.
• Since its introduction in 2012, the Raspberry Pi has become popular for a wide range of
applications, from educational projects and hobbyist experiments to professional prototypes
and even commercial products.
◦ It uses a microSD card for storage, which holds the operating system and les.
Some newer models also support USB storage devices.
5. Operating System:
1
fi
fi
fi
◦ The Raspberry Pi has a strong and active community, providing a wealth of
tutorials, forums, and resources. This makes it easier for both beginners and
experienced users to nd support and inspiration for their projects.
Common Uses of Raspberry Pi
Raspberry pi Diagram :
2
fi
Main Components of Raspberry Pi
1. Processor:
◦ Description: The Raspberry Pi uses the Broadcom BCM2835 system-on-chip
(SoC), which includes an ARM processor and a VideoCore GPU (Graphics
Processing Unit).
◦ Function: Acts as the central unit controlling operations and handling
computations for all connected devices.
2. HDMI Port:
3
fi
10. Display (DSI):
◦ Description: Display Serial Interface (DSI).
◦ Function: Connects an LCD display to the Raspberry Pi using a 15-pin ribbon
cable. DSI is used for high-resolution video output.
The Raspberry Pi is a compact, affordable single-board computer that’s about the size of a
credit card. It was created to make computing accessible and to encourage learning about
programming and electronics.
Key Features:
• Size: Small and portable, tting into various projects and enclosures.
• Processor: ARM-based CPU for general computing tasks.
• Memory: Models come with varying amounts of RAM, from 512MB to 8GB.
• Storage: Uses a microSD card for the operating system and le storage.
• Connectivity: Includes USB ports, HDMI for video output, GPIO pins for hardware
interfacing, and network interfaces such as Ethernet and Wi-Fi (on newer models).
• Power Supply: Powered through a micro USB or USB-C connector.
Operating Systems for Raspberry Pi
The Raspberry Pi typically runs Linux-based operating systems. Here are a few popular ones:
• Raspberry Pi OS: Formerly known as Raspbian, it’s the of cial operating system
designed speci cally for the Raspberry Pi. It’s based on Debian Linux and comes with
a range of pre-installed educational and development tools.
• Ubuntu: A popular Linux distribution that offers a version speci cally tailored for
Raspberry Pi.
Implementing IoT with Raspberry Pi
The Raspberry Pi is an excellent platform for IoT (Internet of Things) projects due to its
exibility and connectivity options.
1. Setup:
◦ Connect: Hook up a monitor, keyboard, and mouse. Insert a microSD card
with an OS.
◦ Power: Plug it into a power source.
2. Connect to the Internet:
4
fl
fi
fi
fi
fi
fi
◦ Wireless: Connect via Wi-Fi.
3. Install Software:
◦ Update: Make sure the OS is up-to-date.
◦ Tools: Install software for IoT, like MQTT for messaging or Python libraries
for hardware control.
4. Add Sensors and Devices:
◦ GPIO Pins: Connect sensors (e.g., temperature sensors) and devices (e.g.,
motors) to these pins.
◦ Camera: Attach a camera module if needed.
5. Communicate:
◦ Interfaces: Build web or mobile apps to control and monitor your project.
◦ Automation: Set rules for automatic actions based on sensor data.
8. Ensure Security:
The program uses the GPIO (General Purpose Input/Output) pins to control the LED.
Requirements
1. Hardware:
5
Wiring Diagram
• LED: Connect the long leg (anode) to a GPIO pin (e.g., GPIO17) and the short leg
(cathode) to a 220-ohm resistor. Connect the other end of the resistor to a ground
(GND) pin on the Raspberry Pi.
Python Code
while True:
Explanation
1. Import Libraries: RPi.GPIO for GPIO control and time for delays.
2. Setup GPIO: Set up the GPIO mode to use Broadcom pin numbering (GPIO.BCM).
3. Con gure Pin: Set GPIO pin 17 as an output pin (GPIO.OUT).
4. Blink LED:
◦ Turn On: Set the pin high (GPIO.HIGH), wait for 1 second, then turn off
the LED.
◦ Turn Off: Set the pin low (GPIO.LOW), wait for another 1 second.
Components Needed
6
fi
f
Wiring the Light Sensor
1. Photoresistor (LDR):
◦ LDR: Connect one leg of the LDR to a GPIO pin (e.g., GPIO18).
◦ Resistor: Connect the other leg of the LDR to one end of the resistor. Connect
the other end of the resistor to the ground (GND).
◦ Voltage Divider: Connect the junction between the LDR and resistor to an
analog-to-digital converter (ADC) if using an LDR (since Raspberry Pi has no
built-in ADC). Connect the ADC to the GPIO pins.
• Connecting the LDR to an ADC, and then the ADC to the Raspberry Pi.
• Enabling SPI communication.
• Installing necessary libraries for SPI.
• Writing and running a Python script to read and display light levels from the LDR.
This setup allows you to measure light intensity and use this data in various applications,
such as creating a light-sensitive device or environmental monitoring system.
SPI (Serial Peripheral Interface) and I2C (Inter-Integrated Circuit) are two popular
communication protocols used to connect and communicate with various peripheral devices
in electronics projects.
Both are supported by the Raspberry Pi and serve different purposes based on the
requirements of your project.
De nition:
SPI is a synchronous serial communication protocol that allows for fast, full-duplex data
transfer between a master device and one or more slave devices.
Key Characteristics:
7
fi
Typical Uses:
De nition:
Key Characteristics:
• Data Transfer: Half-duplex (data is sent and received but not simultaneously).
• Clocking: Uses a clock signal to synchronize communication.
• Speed: Typically slower than SPI, with standard speeds of 100 kHz or 400 kHz (some
versions go up to 1 Mbps).
• Pins: Requires two main lines:
◦ SDA (Serial Data Line): Data line for sending and receiving data.
◦ SCL (Serial Clock Line): Clock signal line.
Typical Uses:
Q.What are the basic peripherals that are interfacing with RPi
Basic Peripherals for Raspberry Pi
The Raspberry Pi can interface with a wide range of peripherals to expand its functionality.
Here are some of the basic peripherals commonly used:
8
fi
fl
1. Keyboard and Mouse
• Connection: Plug directly into the USB ports on the Raspberry Pi.
• Purpose: Provides input for controlling the Raspberry Pi and navigating its operating
system.
2. Monitor/Display
• Connection: Connects via HDMI or, for speci c models, via the Display Serial
Interface (DSI) port.
• Purpose: Displays the graphical user interface, applications, and output from the
Raspberry Pi.
3. SD Card
• Connection: Connected via the 3.5mm audio jack or USB for digital audio devices.
• Purpose: Outputs sound from the Raspberry Pi, including audio from applications,
media, and system alerts.
6. Network Interfaces
• Ethernet:
9
fi
•Purpose: Allows interaction with external hardware like sensors, actuators, LEDs,
and other electronic components. Useful for custom projects and automation tasks.
9. ADC/DAC (Analog-to-Digital Converter/Digital-to-Analog Converter)
UNIT 4
Q.
Software-De ned Networking (SDN) and Its Architecture
Software-De ned Networking (SDN) is a modern networking approach that separates the
network control plane from the data plane. This separation allows for more exible,
programmable, and ef cient network management compared to traditional networking
models.
◦ SDN uses a central controller to make decisions about how traf c should be
handled across the network. This centralization simpli es network
management and allows for more dynamic and automated responses to
network conditions.
3. Programmability:
◦ SDN often relies on open standards and APIs, such as OpenFlow, to enable
communication between the control plane and data plane. This fosters
interoperability and innovation.
10
fi
fi
fi
fi
fi
fl
fi
fl
SDN Architecture
1. Application Layer:
◦ Purpose: Provides network applications and services that use the network.
These applications make high-level decisions and policies for traf c
management, network optimization, and security.
◦ Examples: Network management tools, load balancers, rewalls, and
analytics platforms.
◦ Interaction: Communicates with the SDN controller via southbound APIs.
2. Control Layer:
◦ Purpose: Acts as the brain of the SDN architecture. It contains the SDN
controller, which manages the network's behavior by communicating with
both the application layer and the data plane.
◦ Function: Receives network policies from applications, makes forwarding
decisions, and updates the data plane with rules for packet forwarding.
◦ Examples: OpenDaylight, ONOS (Open Network Operating System), Ryu.
11
fi
fi
3. Data Plane (Infrastructure Layer):
◦ Purpose: Handles the actual forwarding of packets based on rules set by the
control layer. It includes physical and virtual network devices.
◦ Components: Switches, routers, and network appliances that process and
forward traf c according to the instructions received from the SDN controller.
◦ Interaction: Receives instructions from the SDN controller via northbound
APIs and executes packet forwarding based on those instructions.
Communication Between Layers
• Southbound APIs: These are used by the SDN controller to communicate with
network devices in the data plane. OpenFlow is a commonly used southbound API.
• Northbound APIs: These allow the application layer to interact with the SDN
controller. These APIs help applications request and modify network behavior and
policies.
Bene ts of SDN
1. Flexibility and Agility: Allows for dynamic adjustment of network con gurations
and policies to meet changing needs and conditions.
2. Centralized Management: Simpli es network management by providing a single
point of control for the entire network.
3. Cost Ef ciency: Reduces the need for specialized hardware by enabling software-
based network management and control.
4. Enhanced Security: Provides better visibility and control over network traf c,
allowing for more effective security policy enforcement.
• Software-De ned Networking (SDN) is a modern networking approach that separates the
network control plane from the data plane.
•
• This separation allows for more exible, programmable, and ef cient network
management compared to traditional networking models.
•
• Software-De ned Networking (SDN) introduces a more exible and programmable
network architecture by centralizing network control and abstracting the data plane.
12
fi
fi
fi
fi
fi
fl
fi
fi
fl
fi
fi
fi
provides a centralized point of control for con guring, monitoring, and managing the
entire network.
• Capabilities:
◦ Network Management: Handles network con guration, optimization, and
policy enforcement.
◦ Traf c Engineering: Optimizes the ow of traf c to ensure ef cient use of
network resources.
◦ Fault Tolerance: Provides mechanisms to detect and respond to network
failures or issues.
◦ Example Controllers: OpenDaylight, ONOS (Open Network Operating
System), Ryu.
• Role: Facilitate interaction between the SDN controller and network applications or
external systems.
• Function: Open APIs provide a standardized way for applications to communicate
with the SDN controller. They allow developers to programmatically control network
behavior, access network statistics, and implement custom network services.
• Types:
◦ Northbound APIs: These APIs allow applications to interact with the SDN
controller to request network con gurations and policies. They help in
creating network services and applications that can manage network resources
dynamically.
◦ Examples: RESTful APIs (Representational State Transfer), which use
standard HTTP methods to interact with the SDN controller.
◦ Southbound APIs: These APIs enable communication between the SDN
controller and network devices in the data plane. They de ne how the
controller installs, updates, or removes ow rules in network devices.
◦ Examples: OpenFlow, OVSDB (Open vSwitch Database), NETCONF.
• Role: Serves as the primary protocol for communication between the SDN controller
and network devices.
• Function: OpenFlow de nes how the SDN controller interacts with network switches
and routers to control packet forwarding and network behavior. It provides a
standardized way to manage and program network devices.
• Features:
◦ Flow Tables: OpenFlow uses ow tables in network devices to store rules for
packet forwarding. The controller installs, modi es, or deletes these rules
based on network policies and traf c conditions.
◦ Protocol Details: Includes commands for adding, updating, or deleting ow
entries, and supports various actions like packet forwarding, dropping, or
modifying.
◦ Compatibility: Ensures interoperability between different vendors' network
devices and the SDN controller.
◦ Evolution: OpenFlow has evolved over time, with multiple versions
introducing new features and improvements.
13
fi
fi
fl
fi
fi
fl
fl
fi
fi
fi
fi
fi
fi
fl
Q.Explain Role of Data Analytics in IoT
Role of Data Analytics in IoT
Data Analytics plays a crucial role in the Internet of Things (IoT) by transforming raw data
generated from IoT devices into actionable insights.
This process is essential for making informed decisions, optimizing processes, and creating
value from the vast amounts of data produced by IoT systems.
• Role: Collects and consolidates data from various IoT devices and sensors deployed
across different environments.
• Function: Aggregates data into a centralized repository or cloud storage where it can
be processed and analyzed. This includes data from sensors, devices, and user
interactions.
• Bene t: Enables comprehensive data analysis by providing a uni ed view of the
information gathered from diverse sources.
2. Real-Time Analytics
• Role: Forecasts future trends and potential issues based on historical data and
patterns.
14
fi
fi
fi
• Function: Uses machine learning algorithms and statistical models to predict future
events, such as equipment maintenance needs or demand uctuations.
• Bene t: Enables proactive actions and better planning, such as scheduling
maintenance before equipment fails or adjusting supply chain operations based on
predicted demand.
4. Descriptive Analytics
• Role: Provides insights into historical data to understand past events and performance.
• Function: Analyzes historical data to generate reports, identify trends, and evaluate
the effectiveness of past actions or strategies.
• Bene t: Helps in understanding what happened, why it happened, and how it impacts
current operations or decisions.
5. Prescriptive Analytics
• Role: Recommends actions based on data insights to optimize outcomes and achieve
speci c objectives.
• Function: Uses advanced algorithms and optimization techniques to suggest the best
course of action or decision based on data analysis.
• Bene t: Assists in making informed decisions by providing recommendations on how
to address issues, optimize processes, or enhance performance.
6. Anomaly Detection
• Role: Identi es unusual patterns or behaviors that deviate from normal operation.
• Function: Applies statistical techniques and machine learning models to detect
deviations or anomalies in IoT data, which may indicate issues or failures.
• Bene t: Enhances the ability to detect and address problems early, improving system
reliability and reducing downtime.
7. Data Visualization
• Role: Transforms complex data into visual formats for easier interpretation and
understanding.
• Function: Uses charts, graphs, dashboards, and other visualization tools to present
data in a user-friendly manner.
• Bene t: Makes it easier for stakeholders to understand trends, performance metrics,
and key insights, facilitating better decision-making.
8. Data Integration
• Role: Combines data from different sources to provide a comprehensive view of the
IoT ecosystem.
• Function: Integrates data from various IoT devices, applications, and external sources
to create a uni ed dataset for analysis.
• Bene t: Provides a holistic perspective on operations, enabling more accurate
analysis and insights.
15
fi
fi
fi
fi
fi
fi
fi
fi
fi
fl
UNIT 5
De nition:
Cloud Computing is a technology that allows users to access and use computing resources
(such as servers, storage, databases, and software) over the internet. Instead of owning and
maintaining physical hardware and infrastructure, users can rent these resources from a cloud
service provider. This model offers exibility, scalability, and cost-ef ciency.
Cloud computing services are typically categorized into three main types, each offering
different levels of control, exibility, and management:
• De nition: IaaS provides virtualized computing resources over the internet. Users
rent infrastructure components such as servers, storage, and networking from a cloud
provider.
• Features:
◦ Virtual Machines: On-demand virtualized computing power.
◦ Storage: Scalable storage solutions for data and applications.
◦ Networking: Virtual networks, load balancers, and VPNs.
• Examples: Amazon Web Services (AWS) EC2, Google Cloud Compute Engine,
Microsoft Azure Virtual Machines.
• Use Cases: Hosting websites, running enterprise applications, backup and recovery,
and disaster recovery.
16
fi
fi
fl
fl
fl
fi
2. Platform as a Service (PaaS)
17
fi
fi
fi
fi
Q.Explain Smart city architecture
Smart City Architecture is a framework designed to use technology and data to improve the
quality of life for residents, enhance the ef ciency of urban services, and promote
sustainability.
The architecture of a smart city integrates various technologies and systems to create a
cohesive and ef cient urban environment.
Smart City Architecture involves multiple layers working together to create an ef cient,
connected urban environment.
18
fi
fi
fi
Explanation of the key layers:
1. Street Layer
• What: This layer manages the connectivity and integration of smart devices across
the city.
• Function: Coordinates and communicates data between the street layer devices and
the higher-level systems.
• Components:
◦ Communication Networks: Infrastructure that enables data transmission
between devices and central systems.
◦ IoT Gateways: Intermediate devices that aggregate data from street sensors
and transmit it to the data center.
◦ City Management Systems: Platforms for managing and integrating data
from various sources.
• Examples:
◦ City-Wide Network: Connects various smart devices and sensors.
◦ Urban Management Systems: Platforms that provide city of cials with a
comprehensive view of data and system statuses.
3. Data Center Layer
19
fi
fi
fl
fi
fi
fl
fi
◦ Big Data Analytics Platforms: Systems for analyzing large datasets and
deriving insights.
4. Service Layer
• What: The top layer that provides services and applications based on the data
collected and processed.
• Function: Delivers various smart city applications and services to end-users,
including both residents and city administrators.
• Components:
◦ Applications: Software solutions that utilize data to offer services like traf c
management, public safety, and energy management.
◦ User Interfaces: Dashboards, mobile apps, and web interfaces that allow
users to interact with city services.
◦ Service Platforms: Integrated platforms that provide various smart city
functionalities and enable interactions between different services.
• Examples:
◦ Traf c Management Systems: Applications that optimize traf c ow and
provide real-time updates to drivers.
◦ Public Safety Apps: Platforms that enhance emergency response and crime
monitoring.
Smart city technologies aim to improve urban living through enhanced ef ciency,
sustainability, and convenience.
Explanation of three key smart city solutions: Smart Lighting, Smart Parking, and Smart
Traf c Control.
1. Smart Lighting
De nition: Smart lighting systems use advanced technology to manage and control
streetlights and other lighting infrastructure ef ciently.
Working:
• Sensors: Equipped with sensors to detect motion, ambient light levels, and
environmental conditions.
• Connectivity: Connected to a central control system or network for remote
management and monitoring.
• Control: Allows for automated adjustments of lighting based on factors like time of
day, weather conditions, and real-time traf c or pedestrian movement.
20
fi
fi
fi
fi
fi
fi
fl
fi
fi
Bene ts:
2. Smart Parking
De nition: Smart parking solutions optimize the use of parking spaces and make it easier for
drivers to nd available spots.
Working:
• Ef ciency: Reduces time spent searching for parking, which lowers traf c congestion
and emissions.
• Revenue: Helps cities manage parking resources better and can increase revenue
through dynamic pricing.
• User Convenience: Provides drivers with information on available spaces and can
even guide them to the nearest open spot.
Example:
• Smart Parking Meters: Accept payments via mobile apps and adjust pricing based
on demand.
De nition: Smart traf c control systems use technology to manage and optimize traf c ow
at intersections and throughout the city.
Working:
• Traf c Sensors: Monitor traf c ow, vehicle counts, and congestion levels.
• Traf c Signals: Adjust signal timings based on real-time data to improve traf c ow.
• Communication: Connects with central traf c management systems for coordinated
control and optimization.
21
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fl
fi
fi
fi
fl
fi
fi
fl
fi
fl
Bene ts:
•
Reduced Congestion: Minimizes traf c jams by optimizing signal timings and ow
management.
• Improved Safety: Reduces the likelihood of accidents by managing traf c more
effectively.
• Ef ciency: Enhances the ef ciency of public transportation systems by prioritizing
buses or trams.
Example:
22
fi
fi
fi
fi
fi
fi
fl
fi
fi
fl