Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

Post on 15-Apr-2017

241 views 0 download

Transcript of Introduction to Raspberry Pi and IoT - Faculty Development Program Primer

05/03/2023 1www.potentiallabs.com

Syed Anwaarullahsyed@potentiallabs.com

Introduction to Raspberry Pi and IoTFaculty Development Program Primer

Siddharth Engineering College – Vijayawada, India26th Dec, 2016

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

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

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

05/03/2023 5www.potentiallabs.com

05/03/2023 6www.potentiallabs.com

Raspberry Pi vs Arduino (uP vs uC)

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

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

05/03/2023 9www.potentiallabs.com

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

05/03/2023 10www.potentiallabs.com

Hardware Interfacing with Python – Simple LED Blink

05/03/2023 11www.potentiallabs.com

GPIO Pin Mapping

05/03/2023 12www.potentiallabs.com

GPIO7

GPIO Pin Mapping

05/03/2023 13www.potentiallabs.com

Python Code

05/03/2023 14www.potentiallabs.com

Results

05/03/2023 15www.potentiallabs.com

Interfacing Relay to Pi

05/03/2023 16www.potentiallabs.com

Interfacing Relay to Pi – using GPIOZero Library

https://gpiozero.readthedocs.io/

05/03/2023 17www.potentiallabs.com

Interfacing Smoke Sensor to Pi

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

05/03/2023 18www.potentiallabs.com

More interfacing Examples:

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

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

05/03/2023 20www.potentiallabs.com

05/03/2023 21www.potentiallabs.com

WebIOPi – Raspberry Pi IoT Framework

05/03/2023 22www.potentiallabs.com

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

05/03/2023 24www.potentiallabs.com

Syed Anwaarullahsyed@potentiallabs.com

Thanks