introduction to raspberry pi and iot - faculty development program primer

24
www.potentiallabs.com Syed Anwaarullah [email protected] 06/12/2022 1 Introduction to Raspberry Pi and IoT Faculty Development Program Primer Siddharth Engineering College – Vijayawada, India 26 th Dec, 2016

Upload: anwaarullah

Post on 15-Apr-2017

239 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 1www.potentiallabs.com

Syed [email protected]

Introduction to Raspberry Pi and IoTFaculty Development Program Primer

Siddharth Engineering College – Vijayawada, India26th Dec, 2016

Page 2: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

www.potentiallabs.com

Agenda:•Introduction to Raspberry Pi•Raspberry Pi vs Arduino (uP vs uC)•Raspberry Pi OS Installation, Boot, GUI and SSH•Exploring the System, Text Editor (nano), SU, Shutdown, Restart•GPIO Pin Mapping•Introduction to Python• Creating and executing Python programs• H/W interfacing using Python•Building a Real Time Home Automation System

Page 3: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 3www.potentiallabs.com

Introduction to Raspberry Pi•Raspberry Pi is a fully-functional SBC (Single Board Computer)•Runs operating systems: Linux (Raspbian/Fedora/Arch/FreeBSD), Windows 10 (IoT Core), AndroidThings•Plug it into a monitor, keyboard & mouse You have a stand alone PC•Primarily designed to teach and promote Computer Science in Schools

Page 4: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 4www.potentiallabs.com

Tech Specs of Raspberry Pi 3•CPU: 1.2 GHZ quad-core ARM Cortex A53 (ARMv8 Instruction Set)•SoC: Broadcom BCM2837 (roughly 50% faster than the Pi 2)•1GB RAM•4 USB ports•40 GPIO pins•HDMI port•Network: 10/100 MBPS Ethernet, 802.11n Wireless LAN, Bluetooth 4.0•Combined 3.5mm audio jack and composite video•Camera interface (CSI)•Display interface (DSI)•Micro SD Card Slot•GPU: Broadcom VideoCore IV @ 400 MHz

Page 5: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 5www.potentiallabs.com

Page 6: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 6www.potentiallabs.com

Raspberry Pi vs Arduino (uP vs uC)

Page 7: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 7www.potentiallabs.com

Raspberry Pi OS Installation, Boot, GUI and SSH•Download OS from https://www.raspberrypi.org/downloads/•Flash the OS Image onto a SD Card using Win32DiskImager Image Writer•Powering it ON• Plug in the SD Card, Keyboard, Mouse and Micro-USB Cable•If prompted with a login screen:• Username: pi• Password: raspberry•sudo-raspi config – Initial config•Using Putty to remotely connect to a networked Raspberry Pi

Page 8: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 8www.potentiallabs.com

Exploring the System, Text Editor (nano), SU, Shutdown, Restart•Shell commands•File explorer•nano Text Editor•SU access•Shutdown, Restart

Page 9: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 9www.potentiallabs.com

Python Programming•Python Interpreter• Interpreter vs Shell•Creating Python Programs and executing them

Page 10: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 10www.potentiallabs.com

Hardware Interfacing with Python – Simple LED Blink

Page 11: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 11www.potentiallabs.com

GPIO Pin Mapping

Page 12: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 12www.potentiallabs.com

GPIO7

GPIO Pin Mapping

Page 13: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 13www.potentiallabs.com

Python Code

Page 14: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 14www.potentiallabs.com

Results

Page 15: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 15www.potentiallabs.com

Interfacing Relay to Pi

Page 16: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 16www.potentiallabs.com

Interfacing Relay to Pi – using GPIOZero Library

https://gpiozero.readthedocs.io/

Page 17: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 17www.potentiallabs.com

Interfacing Smoke Sensor to Pi

Caution: Use the 3.3V for VCC instead of 5V VCC

Page 18: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 18www.potentiallabs.com

More interfacing Examples:

https://www.raspberrypi.org/learning/physical-computing-with-python/worksheet/

Page 19: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

www.potentiallabs.com

Building a Web Controlled Home Automation System

Sensors, Actuators, etc

Web App(PHP)

Polling

http://potentiallabs.com/IoT/relay-status.txt Relay/Light Statushttp://potentiallabs.com/IoT/relay-control.php?status=1 Turn ONhttp://potentiallabs.com/IoT/relay-control.php?status=0 Turn OFF

Page 20: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 20www.potentiallabs.com

Page 21: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 21www.potentiallabs.com

WebIOPi – Raspberry Pi IoT Framework

Page 22: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 22www.potentiallabs.com

Page 23: Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

www.potentiallabs.com

Learning Resources•Raspberry Pi official website: https://www.raspberrypi.org•Learning Python: http://learnpythonthehardway.org/•Raspberry Pi Tutorials: https://learn.adafruit.com/category/learn-raspberry-pihttps://learn.sparkfun.com/tutorials/tags/raspberry-pihttp://elinux.org/RPi_Tutorials - Dozen of Computer Science Projects