Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
33 views

IoT Using Arduino and Raspberry Pi

The Document gives an Introduction to Internet of Things, Arduino and Raspberry Pi. The Characteristics, Architecture, Components and Advantages of Arduino and Raspberry Pi is described. The simple program on Arduino and Raspberry Pi is illustrated in Python.

Uploaded by

vdjohn
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

IoT Using Arduino and Raspberry Pi

The Document gives an Introduction to Internet of Things, Arduino and Raspberry Pi. The Characteristics, Architecture, Components and Advantages of Arduino and Raspberry Pi is described. The simple program on Arduino and Raspberry Pi is illustrated in Python.

Uploaded by

vdjohn
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 85

IoT using Arduino and

Rasberry Pi

Dr.S.Veena,
Professor/CSE,
SRMIST,
Ramapuram
Internet of Things(IoT)
• The Internet of Things (IoT) refers to a network of physical
devices embedded with sensors, software, and other
technologies that connect to the internet to collect,
exchange, and act on data.

• These "things" can range from everyday household objects


like smart thermostats and light bulbs to industrial
equipment and healthcare devices.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 2


Key Characteristics of IoT
1.Connectivity: IoT devices communicate through Wi-Fi, Bluetooth,
Zigbee, or other protocols to share data.
2.Data Collection and Processing: Sensors collect data like
temperature, motion, or pressure, which is then processed to enable
intelligent decision-making.
3.Automation and Control: IoT enables remote monitoring and
automation of devices, such as controlling home appliances via a
smartphone.
4.Interoperability: Devices often interact with each other to create a
seamless experience, such as a smart home system integrating
security cameras and lights.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 3
Examples of IoT Applications
1. Smart Homes: Devices like Amazon Alexa, Google Nest, and Ring
doorbells provide convenience, security, and energy efficiency.
2. Healthcare: Wearable devices like Fitbit and smart glucose
monitors track patient health in real-time.
3. Industrial IoT (IIoT): Sensors monitor machinery in factories to
optimize operations and prevent breakdowns.
4. Agriculture: IoT systems manage irrigation, monitor soil
conditions, and track livestock health.
5. Transportation: IoT is critical for autonomous vehicles, smart
traffic lights, and logistics management.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 4


Benefits of IoT

1. Efficiency: Automates repetitive tasks, saving time and


energy.
2. Cost Savings: Optimizes resource use, such as reducing
energy consumption.
3. Enhanced Decision-Making: Provides actionable insights
through data analytics.
4. Improved Quality of Life: Offers convenience, such as
remote home control.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 5


Challenges
1. Security Risks: IoT devices are susceptible to hacking if not
properly secured.

2. Data Privacy: Massive data collection raises concerns about


misuse of personal information.

3. Interoperability Issues: Ensuring that devices from different


manufacturers work together seamlessly can be difficult

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 6


IoT Device
• An IoT device is a physical object embedded with
sensors, software, and connectivity capabilities that
allow it to collect, send, and receive data over the
internet.

• These devices enable automation, remote control, and


monitoring, often integrating with other devices and
systems to provide insights and improve efficiency.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 7
Examples of IoT Devices
1.Smart Home Devices:
• Smart Thermostats (e.g., Nest): Adjust home temperatures based on user
preferences or weather conditions.
• Smart Lights (e.g., Philips Hue): Allow remote control of lighting and
customization via apps.
• Voice Assistants (e.g., Amazon Echo, Google Nest): Enable voice control for
various devices and provide information.

2.Healthcare Devices:
• Wearable Fitness Trackers (e.g., Fitbit, Apple Watch): Monitor heart rate,
steps, and sleep patterns.
• Smart Medical Equipment: Devices like insulin pumps and heart monitors
that send health data to doctors in real-time.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 8
Examples of IoT Devices:
3.Industrial IoT (IIoT):
• Predictive Maintenance Sensors: Monitor machinery for potential failures in
factories.
• Smart Energy Meters: Help industries track energy usage and reduce waste.
4.Agriculture:
• Smart Irrigation Systems: Use soil moisture data to optimize water usage.
• Livestock Trackers: Monitor animal health and location.
5.Automotive:
• Connected Cars: Vehicles equipped with GPS, diagnostics, and smart
infotainment systems.
• Autonomous Drones: Used for delivery, surveillance, or crop monitoring.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 9
Basic Building blocks of IoT
Device

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 10


Basic Building blocks of IoT Device
• The basic building blocks of an IoT device are the essential components that enable its

functioning as part of the Internet of Things. These include hardware, software, connectivity, and

data management systems.

1. Sensors and Actuators

2. Microcontrollers or Microprocessors

3. Connectivity Modules

4. Power Supply

5. Embedded Software/Firmware

6. Cloud Services and Data Storage

7. User Interfaces

8. Security and Encryption Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 11


Basic Building blocks of IoT
1.Sensors and Actuators Device
• Sensors: Collect data from the environment, such as temperature,
humidity, light, motion, or pressure.
Example: Temperature sensors in smart thermostats.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 12


Basic Building blocks of IoT
1.Sensors and Actuators Device
• Actuators: Perform actions based on processed data, such as turning on a
fan or locking a door.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 13


Basic Building blocks of IoT
Device
2. Microcontrollers or Microprocessors
• Microcontrollers (MCUs): Compact chips (e.g., Arduino) that combine
processing power, memory, and input/output controls. Ideal for simple IoT
devices.
• Microprocessors (MPUs): More powerful processors (e.g., Raspberry Pi)
used for complex applications requiring advanced computing.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 14


Basic Building blocks of IoT
Device
3. Connectivity Modules
• Enable communication between devices and the cloud
a. Wireless Connectivity: Wi-Fi, Bluetooth, Zigbee, or LoRa for short-to-
medium distances.
b. Cellular Networks: 3G, 4G, LTE, or 5G for long-range communication.
c. Ethernet: Wired communication for high-speed, stable connections.

4. Power Supply
• IoT devices require reliable power sources:
a. Batteries: For portable devices.
b. Direct Power: Plugged-in devices like smart TVs.
c. Energy Harvesting: Solar panels or kinetic energy for remote sensors.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 15
Basic Building blocks of IoT
Device
5. Embedded Software/Firmware
• Software manages the sensors, processes data, and controls
actuators.
• Real-time operating systems (RTOS) ensure that devices operate
efficiently.

6. Cloud Services and Data Storage


• Cloud Platforms: Process, store, and analyze data collected by devices
(e.g., AWS IoT, Microsoft Azure IoT).
• Edge Computing: Data processing closer to the device, reducing
latency and bandwidth usage.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 16


Basic Building blocks of IoT Device
7. User Interfaces
• Mobile Apps: Allow users to control devices remotely.
• Web Dashboards: Provide analytics and insights.

8. Security and Encryption


• Ensures data privacy and device protection.
• Includes secure protocols (e.g., HTTPS, MQTT) and authentication mechanisms.

Note : Message Queuing Telemetry Transport (MQTT) is designed for connecting


devices with limited network bandwidth or resource constraints, such as those in
the Internet of Things (IoT)

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 17


Working of IoT Devices
The working of IoT (Internet of Things) devices involves the interaction
between sensors, hardware, communication networks, and software to
perform specific tasks.
1.Data Collection
IoT devices are equipped with sensors and actuators to collect data
from the environment or perform actions. For instance:
a. Sensors like temperature, humidity, or motion detect changes in the
environment.
b. Actuators respond by performing actions, such as turning on a fan
or locking a door.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 18
Working of IoT Devices
2. Data Processing
The collected data is sent to a microcontroller or processor in the IoT
device, such as an Arduino or Raspberry Pi. The microcontroller:
a. Processes the raw sensor data.
b. May act on the data immediately (e.g., turning on a light if motion is
detected).

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 19


Working of IoT Devices
3. Connectivity
• IoT devices use communication protocols to transmit data to other
devices, cloud servers, or applications. Common connectivity
methods include:
• Wi-Fi: Home automation systems.
• Bluetooth: Wearable devices.
• Cellular: Devices in remote locations (4G/5G).
• LoRaWAN: Long-range, low-power applications.
• MQTT/HTTP: For sending data to the cloud.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 20
Working of IoT Devices
4. Cloud Storage and Processing
The data collected is often sent to a cloud server for storage and
analysis. Cloud platforms (e.g., AWS IoT, Microsoft Azure, Google Cloud
IoT) enable:
• Data Storage: Long-term storage of IoT data.
• Data Processing: Machine learning algorithms analyze patterns and
trends.
• Remote Control: Users control IoT devices via mobile apps or
dashboards.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 21


Working of IoT Devices
5. Action and Feedback
Based on the processed data, the IoT device or user application can:
• Perform actions, such as triggering alarms, sending notifications, or
adjusting settings.
• Provide feedback to the user through dashboards or apps.
6. Continuous Learning and Updates
• IoT devices may use machine learning to improve performance over
time by analyzing data patterns. Additionally, devices can receive
over-the-air (OTA) updates for software enhancements and bug fixes.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 22


Popular IoT Platforms
• IoT (Internet of Things) platforms are essential for connecting, managing, and analyzing data from IoT
devices.
• They provide the infrastructure and tools necessary for developing and deploying IoT applications.
• When selecting an IoT platform, consider factors such as scalability, security, integration capabilities,
and the specific requirements of IoT project to ensure it aligns with your business objectives.
• The most popular IoT platforms are
1. AWS IoT Core
2. Microsoft Azure IoT
3. Google Cloud IoT Core
4. ThingWorx IIoT Platform
5. IBM Watson IoT
6. Oracle IoT Cloud
7. Cisco IoT Cloud Connect
8. Salesforce IoT Cloud Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 23
Popular IoT Platforms
1.AWS IoT Core
Amazon Web Services offers a scalable platform for connecting devices to the
cloud, enabling secure communication, data processing, and integration with
other AWS services
2. Microsoft Azure IoT
Azure provides a suite of IoT services, including IoT Hub and IoT Central, for
device connectivity, monitoring, and management, along with advanced
analytics and integration with Azure's cloud ecosystem
3.Google Cloud IoT Core
Google's fully managed service allows for secure connection and management
of IoT devices, with real-time data analysis using Google's cloud services.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 24


Popular IoT Platforms
4. ThingWorx IIoT Platform
Developed by PTC, ThingWorx offers tools for building industrial IoT
applications, including device management, analytics, and augmented
reality capabilities.
5. IBM Watson IoT
IBM's platform focuses on connecting devices and applying advanced
analytics, machine learning, and AI to IoT data for actionable insights.
6. Oracle IoT Cloud
Oracle provides a platform for integrating IoT data with enterprise
applications, offering real-time analytics and comprehensive device
management.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 25
Popular IoT Platforms
7. Cisco IoT Cloud Connect
Cisco's platform delivers secure IoT connectivity solutions, focusing on
network management and data analytics for various industries
8. Salesforce IoT Cloud
Salesforce offers an IoT platform that integrates device data with
customer relationship management (CRM) systems, enabling
personalized customer experiences.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 26


Arduino
• Arduino is an open-source electronics platform based on easy-to-use
hardware and software.
• It is designed for creating interactive projects that integrate sensors,
actuators, and microcontrollers.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 27


Key Features of Arduino
Open Source:
• Arduino hardware designs and software are open-source, enabling customization.
Microcontroller-Based:
• Arduino boards feature microcontrollers such as ATmega328 (on Arduino Uno).
Arduino IDE:
• The Arduino Integrated Development Environment allows programming in a simplified
C/C++ language.
Pin Compatibility:
• Boards have digital and analog pins to connect to sensors, motors, and other
components.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 28


Key Features of Arduino

5. Versatility:
Compatible with various shields, modules, and libraries.

6. Wide Range of Boards:


Includes options like Arduino Uno, Nano, Mega, and MKR series, catering to
diverse projects.

7. Community Support:
Large global community offering tutorials, libraries, and troubleshooting support

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 29


Types of Arduino Board
1. Arduino Uno
• Features: ATmega328P microcontroller, 14 digital I/O pins, 6 analog inputs, USB port
for programming, 16 MHz clock speed.
• Use Case: Ideal for beginners and general-purpose projects.
• Why Popular: Simple, affordable, and supported by an extensive community.

2. Arduino Mega 2560


• Features: ATmega2560 microcontroller, 54 digital I/O pins, 16 analog inputs, 256 KB
flash memory.
• Use Case: Suitable for projects requiring multiple I/O pins, like robotics or automation.
• Why Popular: High pin count and memory capacity.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 30


Types of Arduino Board
3. Arduino Nano
• Features: Compact design, ATmega328 microcontroller, 8 analog inputs, 14
digital I/O pins.
• Use Case: Best for breadboard projects and wearable electronics.
• Why Popular: Small size and versatility.

4. Arduino Leonardo
• Features: ATmega32U4 microcontroller, built-in USB communication.
• Use Case: Human-computer interaction projects like custom keyboards and
mice.
• Why Popular: Can emulate USB devices directly.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 31
Types of Arduino Board
5. Arduino Due
• Features: SAM3X8E ARM Cortex-M3 processor, 84 MHz clock speed,
54 digital I/O pins, 12 analog inputs.
• Use Case: Advanced projects needing higher computational power.
• Why Popular: 32-bit processing capabilities.

6. Arduino MKR Series


• Features: Small size, SAMD21 Cortex-M0+ processor, built-in
connectivity (Wi-Fi, GSM, LoRa).
• Use Case: Designed for IoT and cloud-connected projects.
• Why Popular: Tailored for IoT with energy-efficient design.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 32
Types of Arduino Board
7. Arduino Pro Mini
• Features: ATmega328P, compact design, operates at 3.3V or 5V.
• Use Case: Battery-powered and space-constrained projects.
• Why Popular: Lightweight and low-power usage.

8. Arduino Zero
• Features: ATSAMD21G18 microcontroller, 32-bit ARM Cortex-M0+
processor.
• Use Case: Ideal for IoT and wearable technology requiring better
performance.
• Why Popular: More processing power than 8-bit Arduino boards.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 33
Types of Arduino Board
9. Arduino Yun
• Features: Combines ATmega32U4 microcontroller with an Atheros
AR9331 processor for Linux-based applications.
• Use Case: Networking and IoT projects.
• Why Popular: Combines microcontroller and Linux functionality.

10. Arduino LilyPad


• Features: Designed for e-textiles and wearables, with sewable connectors.
• Use Case: Projects integrating electronics into clothing or fabrics.
• Why Popular: Unique form factor for wearable applications.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 34
Popular Arduino Boards
1.Arduino Uno:
Entry-level board; ideal for beginners.
2.Arduino Nano:
Compact version for space-constrained projects.
3.Arduino Mega:
Additional I/O pins for advanced applications.
4.Arduino MKR Series:
Boards with Wi-Fi, LoRa, or GSM modules for IoT applications.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 35


Applications of Arduino
1.IoT Projects:
Smart homes, weather stations, and more.
2.Robotics:
Automated robots, drones, etc.
3.Wearables:
Health monitors, fitness trackers.
4.Educational Tools:
Teaching electronics and programming basics.
5.Prototyping:
Rapid hardware and software prototyping.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 36
Diagram of Arduino Uno board

The essential components are the microcontroller (ATmega328P), USB port, power jack, digital I/O pins, analog
input pins, and reset button. It is designed to help beginners understand the layout and functions of the board
components. Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 37
Arduino board and Features
• Arduino boards are microcontroller-based platforms designed for
building electronics projects.
• They come in various models to cater to different needs, from basic
learning to complex IoT or robotics projects.
• An Arduino board is composed of several key components that work
together to facilitate programming, sensing, and controlling physical
devices.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 38


Components of an Arduino
Board
• An Arduino board consists of several essential components that enable it to interact with the
physical world. Here's an overview of the key components and their functions:
1. Microcontroller
• Description: The brain of the Arduino board, usually an ATmega series microcontroller.
• Function: Executes the program uploaded to the board and processes inputs/outputs.
• Example: ATmega328P (Arduino Uno).

2. Power Source
• Description: Provides power to the Arduino board.
• Types:
• USB Connection: Supplies power when connected to a computer.
• DC Jack: For external power supply (7–12V).
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 39
Components of an Arduino
Board
3. Voltage Regulator
•Description: Regulates the voltage supplied to the microcontroller and other components.
•Function: Prevents voltage spikes and ensures safe operation.

4. Input/Output Pins (I/O Pins)


•Types:
• Digital Pins:
• Usually 0 to 13 on Arduino Uno.
• Can be configured as inputs or outputs.
• Analog Pins:
• Typically labeled A0 to A5.
• Used to read analog signals (e.g., from sensors).

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 40


Components of an Arduino
Board
5. Reset Button
• Description: Resets the microcontroller.
• Function: Restarts the program running on the Arduino without disconnecting the power

6. USB Interface
• Description: A USB Type-B connector on most boards.
• Function: Allows programming of the microcontroller and provides power to the board.

7. Oscillator (Crystal Oscillator)


• Description: Provides a clock signal to the microcontroller for timing operations.
• Frequency: Typically 16 MHz for Arduino Uno.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 41
Components of an Arduino
Board
8. LEDs
• Description:
• Power LED: Indicates that the board is powered.
• TX/RX LEDs: Indicate data transmission (TX) and reception (RX) during
communication.
• Built-In LED (Pin 13): Used for testing and debugging.

9. ICSP Header
• Description: In-Circuit Serial Programming header.
• Function: Allows programming of the microcontroller directly using an
external programmer.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 42
Components of an Arduino
10. Voltage Pins
Board
• Types:
• 5V Pin: Supplies 5V to external components.
• 3.3V Pin: Supplies 3.3V to external components.
• GND Pins: Ground pins for completing circuits.

11. Serial Communication Interface


• Description: Enables communication between the Arduino and other devices.
• Types: UART (via TX/RX pins), I2C, SPI.

12. EEPROM (Non-Volatile Memory)


• Description: Stores data even when the Arduino is powered off.
• Function: Useful for saving settings or other information

13. Headers
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 43
• Description: Female connectors for attaching external components or shields.
Components of ARDUINO UNO
Board

• ATmega328P microcontroller, USB port, power jack, digital I/O pins, analog
input pins, PWM pins, reset button, crystal oscillator, and power LED.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 44


Raspberry Pi
Raspberry Pi:
What is Raspberry Pi?
• The Raspberry Pi is a small, affordable, and powerful single-board
computer (SBC) developed by the Raspberry Pi Foundation.
• It is widely used for educational purposes, DIY projects, and as a
development platform for IoT and embedded systems.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 46


Key Features of Raspberry Pi
1.Compact Size:
•Small and portable design for easy integration into projects.

2. Powerful Processor:
•Equipped with Broadcom processors for efficient computing.

3. Operating System:
•Runs on Linux-based systems like Raspberry Pi OS (formerly Raspbian).

4. GPIO Pins:
•General-purpose input/output pins for connecting sensors, motors, and other
peripherals.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 47


Key Features of Raspberry Pi
5. Connectivity:
•Includes Wi-Fi, Bluetooth, Ethernet, USB, and HDMI ports depending on the
model.

6. Storage:
•Uses microSD cards for operating system and file storage.

7. Affordable:
•Cost-effective solution for learning and prototyping.

8. Community Support:
•Backed by a large and active community providing extensive resources and
tutorials.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 48
Applications of Raspberry Pi
1. IoT Projects:
•Smart home devices, environmental monitoring, etc.

2. Media Center:
•Used with software like Kodi to create home media centers.

3.Educational Tools:
•Teaches coding and hardware interaction to students.

4. Robotics:
•Powers robots with advanced capabilities.

5.Edge Computing:
•Used for data processing at the edge in IoT systems.

6. Networking:
•Acts as a server or network monitoring tool.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 49


Popular Raspberry Pi Models
1. Raspberry Pi 4 Model B
• High performance with up to 8GB RAM.
• Dual micro-HDMI ports and Gigabit Ethernet.

2. Raspberry Pi 3 Model B+
• Integrated Wi-Fi and Bluetooth.
• Suitable for IoT and lightweight computing tasks.

3. Raspberry Pi Zero Series


• Ultra-compact and cost-effective.
• Ideal for small, portable projects.

4. Raspberry Pi 400
• Built into a compact keyboard with GPIO pins on the back.
• Great for desktop computing and education.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 50
Diagram of Raspberry Pi 4 Model
board

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 51


Key Components of Raspberry Pi board
1.Processor: The CPU and GPU for processing tasks.

2.RAM: Memory for handling running applications.

3.GPIO Pins: For connecting hardware components.

4.USB Ports: Connects peripherals like keyboards and mice.

5.Ethernet Port: For wired internet connectivity (on some models).

6.HDMI Port: For connecting displays.

7.Camera Interface (CSI): For attaching a camera module.

8.Display Interface (DSI): For connecting LCD screens.

9.MicroSD Card Slot: For storage and OS.


Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 52
10.Power Supply: Typically powered via a USB-C or micro-USB port.
Applications of Raspberry Pi
• The Raspberry Pi is a versatile single-board computer used across a
wide range of fields due to its affordability, compact size, and robust
capabilities. Below are its key applications:
• 1. IoT and Smart Home Applications
• Examples:
• Home automation systems: Control lights, appliances, and security cameras.
• Environmental monitoring: Track temperature, humidity, and air quality.
• Use Cases:
• Connect to sensors and actuators for creating intelligent IoT devices

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 53


Applications of Raspberry Pi
2. Education and Learning
• Examples:
• Teaching coding skills using programming languages like Python, Scratch, and
Java.
• Learning hardware-software integration through practical projects.
• Use Cases:
• Used as an affordable platform for STEM education

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 54


Applications of Raspberry Pi
• 3. Robotics
• Examples:
• Powering autonomous robots, drones, or robotic arms.
• Integration with sensors and cameras for navigation and interaction.
• Use Cases:
• Ideal for prototyping robotic systems.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 55


Applications of Raspberry Pi
4. Media Center
• Examples:
• Transform into a media center using software like Kodi.
• Stream movies, play music, and manage media libraries.
• Use Cases:
• Cost-effective home entertainment systems

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 56


Applications of Raspberry Pi
• 5. Network Applications
• Examples:
• Network-attached storage (NAS) server for file sharing.
• Ad-blocking servers like Pi-hole.
• Use Cases:
• Monitor network performance or set up personal servers

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 57


Applications of Raspberry Pi
6. Retro Gaming
• Examples:
• Build retro gaming consoles with emulators like RetroPie or Lakka.
• Use Cases:
• Play classic games from systems like NES, SNES, and PlayStation

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 58


Applications of Raspberry Pi
7. AI and Machine Learning
• Examples:
• Use frameworks like TensorFlow Lite for running AI models.
• Image and speech recognition tasks.
• Use Cases:
• Create smart AI-powered devices or educational projects.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 59


Applications of Raspberry Pi
8. Industrial Automation
• Examples:
• Monitor and control industrial machines.
• Collect data from industrial sensors.
• Use Cases:
• Affordable solution for small-scale industrial IoT system

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 60


Applications of Raspberry Pi
9. Web Server Hosting
• Examples:
• Host lightweight websites or web applications.
• Use Cases:
• Experiment with web development and server configurations.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 61


Applications of Raspberry Pi
10. Security Systems
• Examples:
• DIY surveillance systems with cameras.
• Motion detection and intruder alerts.
• Use Cases:
• Affordable and customizable home security solutions.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 62


Arduino Programming
Step-by-Step Working of an Arduino

1. Powering the Board:


•The Arduino board is powered either via a USB cable or an external
power supply (through the DC jack or battery).
•A voltage regulator ensures a stable power supply to the
microcontroller.

2.Programming the Microcontroller:


•The Arduino board is programmed using the Arduino IDE (Integrated
Development Environment).
•Programs (called "sketches") are written in a simplified version of
C/C++.
•The code is uploaded to the board through a USB connection.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 64
Step-by-Step Working of an
Arduino
3. Input Signals:
•The Arduino board receives input signals from external devices
such as sensors, buttons, or switches connected to its input pins.
•Sensors convert physical phenomena (e.g., temperature, light) into
electrical signals for the Arduino to read.

4.Processing Signals:
•The microcontroller processes the input data based on the program
logic uploaded earlier.
•For instance, it can compare sensor values, execute conditional
statements, or perform calculations
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 65
Step-by-Step Working of an Arduino
5. Generating Outputs:
•Based on the processed data, the Arduino sends output signals to actuators, LEDs,
motors, displays, or other connected devices through output pins.
•Outputs can include lighting up an LED, rotating a motor, or displaying information
on an LCD.

6.Serial Communication:
•Arduino can communicate with a computer or other devices via serial
communication (UART, I2C, or SPI).
•This allows data to be sent or received, enabling debugging or data logging

7.Continuous Loop:
• The Arduino program continuously runs in a loop, allowing it to repeatedly check
inputs, process data, and update outputs.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 66
Example -Turning on an LED when a button is pressed
1. Setup:
•Connect a button to a digital input pin and an LED to a digital output pin.

2. Code:
•Upload a program to check if the button is pressed and, if so, turn on the LED.

3. Input:
•When the button is pressed, it sends a HIGH signal to the input pin.

4. Processing:
•The microcontroller processes the input and decides to light the LED.

5. Output:
•The microcontroller sends a HIGH signal to the output pin connected to the LED,
turning it on Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 67
Project: Turn an LED On/Off Using a
Button
Components Required
1. Arduino board (e.g., Arduino Uno)
2. LED
3. Push button
4. Resistors (220Ω for LED and 10kΩ for button)
5. Breadboard and jumper wires

Circuit Diagram
The circuit includes:
• An LED connected to digital pin 9 with a 220Ω resistor.
• A button connected to digital pin 2 with a pull-down
resistor of 10kΩ.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 68
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 69
Raspberry Pi
Programming
Step by Step working of
Raspberry Pi
1. Powering Up the Raspberry Pi
• Connect the power supply: The Raspberry Pi requires a 5V power supply (usually
via a micro-USB or USB-C connector, depending on the model).
• Insert an SD card: The SD card (usually 8GB or higher) stores the operating
system (typically Raspberry Pi OS, but others can be used). It is inserted into the
microSD card slot.
2. Booting the Raspberry Pi
• When powered on, the Raspberry Pi starts its boot sequence.
• It reads the bootloader from the SD card, which loads the operating system.
• The Raspberry Pi doesn't have a built-in hard drive, so it relies on the SD card to
store the OS and any files you work with
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 71
Step by Step working of
Raspberry Pi
3. Loading the Operating System
• The Raspberry Pi OS (formerly Raspbian) or any compatible OS starts loading from the SD card.
• If you’re using the Raspberry Pi for the first time, you might be guided through an initial setup
process, such as setting up your Wi-Fi, choosing your language, and configuring the system.

4. Running Software
• Once the OS is loaded, you can access the desktop or command-line interface (CLI).
• You can run various programs, from text editors and web browsers to coding environments
(like Python, Scratch, etc.).
• The Pi runs like a regular computer, with all the capabilities of a desktop system, including
multitasking, access to the internet, and hardware control.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 72


Step by Step working of
Raspberry Pi
5.Using Input/Output Ports
• USB Ports: You can connect peripherals like a keyboard, mouse, or external hard drive.
• GPIO Pins: The General Purpose Input/Output (GPIO) pins are a key feature of the
Raspberry Pi. These pins allow you to interact with external hardware like sensors,
LEDs, motors, and other electronic components.
• You can write code to control these pins and create interactive hardware projects.
• HDMI: The Raspberry Pi can output video and audio through the HDMI port, allowing
you to connect it to a monitor or TV for display.
• Audio: The Pi supports audio output either through HDMI or a 3.5mm jack (depending
on the model).
• Network Ports: For models with Ethernet ports, you can connect the Raspberry Pi to a
wired network. Alternatively, newer models have built-in Wi-Fi
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 73
Step by Step working of
Raspberry Pi
6.Storage and File System
• The Raspberry Pi uses an SD card or an external USB drive for storage. When you save files or
install software, it's stored on the SD card.
• The operating system manages the file system, similar to how Windows or macOS handles
file storage.

7.Using Software to Program and Control Hardware


• Programming languages like Python are widely used with the Raspberry Pi for creating
software and interacting with hardware
• Libraries and modules RPI.GPO for controlling the GPIO pins, picamera for controlling a
camera module) are available to make it easier to work with external components
• You can also use tools like Scratch to build projects using a visual programming interface,
which is ideal for beginners
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 74
Step by Step working of
Raspberry Pi
8. Internet Connectivity
• The Raspberry Pi can connect to the internet using Ethernet or Wi-Fi (depending on
the model). This allows you to browse the web, download software, or even control
the Pi remotely using tools like SSH (Secure Shel
9. Running Tasks and Projects
• You can run a variety of projects on the Raspberry Pi:
• Home Automation: Control smart devices like lights or temperature using GPIO pins or
external sensors.
• Media Center: Turn your Pi into a media center with software like Kodi.
• Learning to Program: Learn coding with various programming languages like Python, C++,
Java, or JavaScript.
• Robotics: Build robots using GPIO pins to control motors, sensors, and cameras.
• Server Hosting: Use the Pi as a web server, file server, or even a game server
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 75
Step by Step working of
Raspberry Pi
10. Shutting Down the Raspberry Pi
• It's essential to shut down the Raspberry Pi properly to avoid
corrupting the SD card.
• ou can either shut it down from the command line by typing sudo
shutdown –h now or click the shutdown option in the desktop
environment.
• After the shutdown process completes, you can safely disconnect the
power

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 76


Example -Blink an LED connected
to one of the GPIO pins
Components
1. Raspberry Pi (with Raspbian OS installed)
2. LED
3. 220-ohm resistor
4. Breadboard and jumper wires

Wiring the LED to GPIO:


5.Connect the long leg (anode) of the LED to a GPIO pin, such as GPIO17 (pin 11 on
the header).
6.Connect the short leg (cathode) of the LED to a ground pin (GND, e.g., pin 6).
7.Use a 220-ohm resistor in series with the LED to limit the current
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 77
Python Program to Blink an LED
1. Open a terminal on your Raspberry Pi and make sure you have the
Rpi.GPIO library installed

2. Create a new Python file. For example, you can create a file called
blink_led.py

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 78


Python Program to Blink an LED
3. In the file, add the
following code
4. Save the file and exit
the editor by pressing
CTRL+X then Y to
confirm saving and
Enter.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 79


Python Program to Blink an LED
Explanation of the Code:

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 80


Running the Program
1. Open the terminal and run the program with
python3 blink_led.py

2. You should see the LED blinking on and off every second. The
terminal will display "LED is ON" and "LED is OFF" as it runs

3. To stop the program, press CTRL +C in the terminal

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 81


Comparison between Arduino and
Feature
Raspberry
Arduino
Pi Raspberry P
Type of Device Microcontroller Development Board Single-Board Computer

Processing Power 16 MHz to 48 MHz 1 GHz to 1.5 GHz (multi-core)


Operating System None (bare-metal programming) Full OS (Raspberry Pi OS, Linux)

Memory (RAM) 2 KB to 8 KB 2 GB to 8 GB
Connectivity Limited (requires shields for Built-in Ethernet, Wi-Fi, Bluetooth, US
networking)
I/O Digital/Analog I/O pins GPIO pins, USB, HDMI, Audio, Camera
ports
Power Consumption Very low (50 mA) Moderate to High (2.5 W to 15 W)
Programming Language Arduino IDE (C/C++) Python, C++, Java, Scratch, etc.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 82


Comparison between Arduino and
Raspberry Pi
Feature Arduino Raspberry P
Cost $5 to $30 $10 to $75

Applications Embedded systems, robotics, simple Multimedia, web servers, data processing,
hardware robotics

Real-Time Control Excellent for real-time tasks Not ideal for real-time applications

Ease of Use Very beginner-friendly Beginner-friendly, but more complex due to


OS
Storage Flash memory SD card or USB storage

Multitasking No multitasking Supports multitasking

Expansion Shields for additional functions HATs for more complex tasks, USB devices,
etc.
Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 83
Tools used in Arduino
1.Smart Home Automation:
1. Use Blynk or Cayenne to control lights, fans, and appliances via Arduino and a
smartphone.
2.Weather Station:
1. Collect temperature, humidity, and air pressure data using ThingSpeak or
Adafruit IO.
3.Health Monitoring System:
1. Transmit heartbeat and temperature sensor data to Firebase or Ubidots.
4.Remote Monitoring:
1. Monitor soil moisture and water levels using Arduino Cloud or Freeboard.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 84


Tools used in Raspberry Pi
• Example Use Cases for IoT Projects:
1.Smart Home Automation: Use Node-RED with MQTT to control
lights, fans, or appliances from your Raspberry Pi.
2.Weather Monitoring Station: Collect weather data with sensors and
log it to ThingSpeak or Adafruit IO.
3.IoT Dashboard: Visualize data from multiple Raspberry Pi devices
using Freeboard or Grafana Cloud.
4.Remote Device Control: Use Dataplicity or Remote.it for secure, web-
based control over IoT devices.

Dr.S.Veena, Professor/CSE, SRMIST, Ramapuram 85

You might also like