SlideShare a Scribd company logo
Shahed Mehbub
President, Robo Mechatronics Association Bangladesh(RMABD)
Day 2
Setting up the Pi
6. USB TO POWER
SOURCE
5. TO MONITOR
4. TO MOUSE
3. TO
KEYBOARD
2. WI-FI
ADAPTER
1. SD CARD
Operating Systems for Pi
• Raspbian (Jessie, Jessie lite)
• Ubuntu (Snappy Ubuntu Core)
• Fedora
• Debian
• Archlinux ARM
• Windows 10 IoT Core
• Kali Linux
• OpenELEC
• RetroPIe
Preparing the SD card with an OS
• Step 1: Download bootable disk .iso's (raspbian jessie)
• Link:https://www.raspberrypi.org/downloads/raspbian
• Step 2: Write iso image to SD card
• For Windows/Mac/Linux
https://www.balena.io/etcher/
Let's boot it up!!!
• Plug in all the accessories
• Plug in the power cable
• Pi will start booting
automatically
(First boot may take a long
time)
• You may have to face a
configure window
(If it happens, follow it
through)
Default Credentials for a new user
• If you encounter for a
username and password:
• username: pi
• password: raspberry
• After login, type 'startx' to go to
the Desktop
Setup Completed!!!
Time for making it home!
▶▶ ▶▶
Wifi Configuration
Menu > Preferences > Wifi Configuration
OR
Click on the network icon on the top panel
Almoooooost Ready!!
Just one more step! :p
Do a system update
(It is important to function all the
apps working correctly)
• Open up the terminal:
• Write--> sudo apt-get update
• and--> sudo apt-get upgrade
** Reboot after completing the update process and we are
good to go!!! :D
GPIO Introduction
GPIO on Raspberry Pi
• 26 GPIO Header in Model A/B and 40 GPIO Header in Model B
• These pins are a physical interface between the Pi and the
outside world.
• Out of 26, 8 are dedicated IO Lines, 2 are for UART, 4 are for
SPI (+1 for Another Chip Select) , and another 2 for the I2C
Interface (Total 17 out of 26)
• Rest are Supply Rails.
• Model B+ has 9 additional GPIO including a extra SPI (Total 17
+ 9 = 26 out of 40)
• WiringPi : Easy to use C Library for accessing the GPIO Lines
via Programming (Arduino Style Programming)
Let's Do Blinky!!!
Making of a LED Blinker using Python
==> What you will need:
-> A raspberry pi
-> A LED
-> A 330Ω resistor to protect the LED
-> Jumper wires
Let's Do Blinky!!!
Step 1: Make sure if the LED is
okay
• Connect the jumper wires as
shown
• One wire on the short leg of
LED (Negative)
• Another one attached with the
resistor is
on the long leg (Positive)
LED
Let's Do Blinky!!!
Step 1: Make sure if the LED
is okay
• Connect the wires as shown
• One in the 3.3V pin (Positive
wire)
• Another one is in GND
** Check if the LED is on!
3.3V (Pin
1)
GND
Cathode
Anode
(longer leg)
Let's Do Blinky!!!
3.3V
Ground
GPIO (general purpose input
output)
Let's Do Blinky!!!
GPIO-4 (Pin 7)
5 functions to control GPIO’s
• GPIO.setmode()
• GPIO.setwarnings()
• GPIO.setup()
• GPIO.input()
• GPIO.output()
Let's Do Blinky!!!
->Programming the LED
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
LED = 4
GPIO.setup(LED,GPIO.OUT)
while True:
GPIO.output(LED,True)
time.sleep(1)
GPIO.output(LED,False)
time.sleep(1)
import RPi.GPIO libs
set LED pin as output
toggle light pin signal to
low/high to make it blink.
set pin type. use BCM, not pin
number
GPIO 4 pin (Pin 7)
Congrats!!!
You just finished your first Raspberry Pi project!
Button input - Wiring
Performing GPIO Input
#import RPi.GPIO as GPIO
import EmulatorGUI as GPIO
import time
GPIO.setmode(GPIO.BCM)
INPUTPIN= 23
GPIO.setup(INPUTPIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
if(GPIO.input(INPUTPIN) == True):
print(‘this’)
else:
print(‘that’)
Your Task!!
Write a program that pushing a button
will turn on an LED
Solution
import EmulatorGUI as GPIO
import time
GPIO.setmode(GPIO.BCM)
INPUTPIN= 23
led = 4
GPIO.setup(INPUTPIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
if(GPIO.input(INPUTPIN) == True):
led.on()
else:
led.off()
def led_on():
GPIO.output(led, True)
Def led_of():
GPIO.output(led, False)
Questions???

More Related Content

PPTX
Exploring the ABC's of Raspberry Pi with Python
Shahed Mehbub
 
PPTX
Up and running with Raspberry Pi
Shahed Mehbub
 
PPTX
Raspberry pi : how to get started
동호 손
 
PPTX
Pi Is For Python
Brad Fortner
 
ODP
Raspberry Pi and Amateur Radio
Kevin Hooke
 
PPTX
Raspberry Pi (Introduction)
Mandeesh Singh
 
ODP
Connecting Hardware to the Web with the BeagleBone
Frank Hunleth
 
PDF
Polstra 44con2012
Philip Polstra
 
Exploring the ABC's of Raspberry Pi with Python
Shahed Mehbub
 
Up and running with Raspberry Pi
Shahed Mehbub
 
Raspberry pi : how to get started
동호 손
 
Pi Is For Python
Brad Fortner
 
Raspberry Pi and Amateur Radio
Kevin Hooke
 
Raspberry Pi (Introduction)
Mandeesh Singh
 
Connecting Hardware to the Web with the BeagleBone
Frank Hunleth
 
Polstra 44con2012
Philip Polstra
 

What's hot (20)

ODP
DigiPinguïns: demo Raspberry Pi (Koen De Smet)
Avansa Mid- en Zuidwest
 
PDF
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
Drew Fustini
 
ODP
Introduction to Raspberry Pi and GPIO
Kris Findlay
 
PPTX
Introduction to raspberry pi
동호 손
 
ODP
Debian & the BeagleBone Black
Raju Vindane
 
PDF
Single Board Computers & Raspberry Pi Basics
Eueung Mulyana
 
PDF
Rapidly developing IoT (Internet of Things) applications - Part 2: Arduino, B...
Raul Chong
 
PDF
BeagleBone Black Using Python
Sai Viswanath
 
PPTX
Getting Started with Raspberry Pi
yeokm1
 
PDF
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
TE4P
 
PDF
BeagleBone Workshop
Chirag Nagpal
 
PPSX
Low Cost HD Surveillance Camera using Raspberry PI
Varun A M
 
ODP
Thotcon2013
Philip Polstra
 
PPTX
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
PDF
Hands On Embedded Linux with BeagleBone Black
Daniele Costarella
 
PPTX
Raspberry Pi Using Python
Seggy Segaran
 
PDF
LCA2018 Open Hardware MiniConference: LoliBot Software
Andy Gelme
 
PDF
My presentation raspberry pi
HusainBhaldar21
 
PDF
Introduction to the rapid prototyping with python and linux for embedded systems
Naohiko Shimizu
 
PDF
Raspberry Pi and Amateur Radio - 2020 update
Kevin Hooke
 
DigiPinguïns: demo Raspberry Pi (Koen De Smet)
Avansa Mid- en Zuidwest
 
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
Drew Fustini
 
Introduction to Raspberry Pi and GPIO
Kris Findlay
 
Introduction to raspberry pi
동호 손
 
Debian & the BeagleBone Black
Raju Vindane
 
Single Board Computers & Raspberry Pi Basics
Eueung Mulyana
 
Rapidly developing IoT (Internet of Things) applications - Part 2: Arduino, B...
Raul Chong
 
BeagleBone Black Using Python
Sai Viswanath
 
Getting Started with Raspberry Pi
yeokm1
 
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
TE4P
 
BeagleBone Workshop
Chirag Nagpal
 
Low Cost HD Surveillance Camera using Raspberry PI
Varun A M
 
Thotcon2013
Philip Polstra
 
Getting Started with Raspberry Pi and Arduino
Chad Mairn
 
Hands On Embedded Linux with BeagleBone Black
Daniele Costarella
 
Raspberry Pi Using Python
Seggy Segaran
 
LCA2018 Open Hardware MiniConference: LoliBot Software
Andy Gelme
 
My presentation raspberry pi
HusainBhaldar21
 
Introduction to the rapid prototyping with python and linux for embedded systems
Naohiko Shimizu
 
Raspberry Pi and Amateur Radio - 2020 update
Kevin Hooke
 
Ad

Similar to Exploring the abc's of raspberry pi and python(day 2) (20)

PPTX
Raspberry Pi Introductory Lecture
Syed Umaid Ahmed
 
PPTX
Raspberry Pi ppt.pptx
ushabharathisb1
 
PPTX
Raspberry Pi ppt.pptx
ushabharathisb1
 
PDF
Interfacing the Raspberry Pi to the World
Omer Kilic
 
PPTX
Raspberry pi
Pravesh Sahu
 
PDF
4. GPIO Access
Mayank Joneja
 
PDF
Introduction to Raspberry Pi
Isuru Jayarathne
 
PDF
Exploring Raspberry Pi
Lentin Joseph
 
DOCX
Raspberry pi, Summer $ Short Term Courses in waayoo.com
Praveen Pandey
 
PDF
RaspberryPi_Workshop and Programming with python.
gnanithanagula
 
PPTX
Introduction To Raspberry Pi with Simple GPIO pin Control
Pradip Bhandari
 
PPTX
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Megha Sharma
 
PDF
Intoduction to physical computing using Raspberry Pi, 18-02-2016
Sebin Benjamin
 
PDF
IoT Physical Devices and End Points.pdf
GVNSK Sravya
 
PPTX
Starting Raspberry Pi
LloydMoore
 
PPTX
IOT notes ....,.........
taetaebts431
 
PDF
Raspberry pi: Proyectos de robótica raspberry pi de richard grimmett.
SANTIAGO PABLO ALBERTO
 
PPTX
Python in raspberry pi
Sudar Muthu
 
PDF
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
PPTX
Raspberry pi
ABHIJITPATRA23
 
Raspberry Pi Introductory Lecture
Syed Umaid Ahmed
 
Raspberry Pi ppt.pptx
ushabharathisb1
 
Raspberry Pi ppt.pptx
ushabharathisb1
 
Interfacing the Raspberry Pi to the World
Omer Kilic
 
Raspberry pi
Pravesh Sahu
 
4. GPIO Access
Mayank Joneja
 
Introduction to Raspberry Pi
Isuru Jayarathne
 
Exploring Raspberry Pi
Lentin Joseph
 
Raspberry pi, Summer $ Short Term Courses in waayoo.com
Praveen Pandey
 
RaspberryPi_Workshop and Programming with python.
gnanithanagula
 
Introduction To Raspberry Pi with Simple GPIO pin Control
Pradip Bhandari
 
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Megha Sharma
 
Intoduction to physical computing using Raspberry Pi, 18-02-2016
Sebin Benjamin
 
IoT Physical Devices and End Points.pdf
GVNSK Sravya
 
Starting Raspberry Pi
LloydMoore
 
IOT notes ....,.........
taetaebts431
 
Raspberry pi: Proyectos de robótica raspberry pi de richard grimmett.
SANTIAGO PABLO ALBERTO
 
Python in raspberry pi
Sudar Muthu
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Mohamed Abdallah
 
Raspberry pi
ABHIJITPATRA23
 
Ad

Recently uploaded (20)

PPTX
cocomo-220726173706-141e08f0.tyuiuuupptx
DharaniMani4
 
PDF
Lifting Equipment Inspection Checklist with eAuditor Audits & Inspections
eAuditor Audits & Inspections
 
PPTX
Intro_S4HANA_Using_Global_Bike_Slides_SD_en_v4.1.pptx
trishalasharma7
 
PPTX
Chapter II - OS installation-Virtualization.pptx
ReyAngeloPagatpat1
 
PDF
YKS Chrome Plated Brass Safety Valve Product Catalogue
SudeYksel
 
PPT
L1-Intro.ppt nhfjkhghjjnnnmkkjhigtyhhjjj
MdKarimUllahEmon
 
PDF
Endalamaw Kebede.pdfvvbhjjnhgggftygtttfgh
SirajudinAkmel1
 
PDF
Core Components of IoT, The elements need for IOT
jeffinmathew654
 
PPTX
Mobile-Device-Management-MDM-Architecture.pptx
pranavnandwanshi99
 
PDF
ssrn-5257537 (1).pdffvndsvjfjkn bfjnbjsnvmsd
dieuquynhmailan
 
PPTX
Query and optimizing operating system.pptx
YoomifTube
 
PDF
DOC-20250802-WA0013._20250802_161719_0000.pdf
nidjin765
 
PDF
Colorful Illustrative Digital Education For Children Presentation.pdf
mydidiisawitch6789
 
PPTX
English grade 10 st augusitne eoeoknkklm
zeropoint101109
 
PPTX
dhcp concept.pptxfeegrvewfegrgerhtrhtrhredew
kebimesay23
 
PDF
Cableado de Controladores Logicos Programables
ssuserb7e1a9
 
PPT
3 01032017tyuiryhjrhyureyhjkfdhghfrugjhf
DharaniMani4
 
PDF
Chapter -24-By Dr Sajid Ali Ansari 2021.pdf
7h8p5krjwf
 
PPTX
sample 1mathssscpreprationfor basics.PPTX
yuyutsugupta3
 
PDF
Top 10 Client Success Story_ The Buy Snapchat Account Experience.pdf
Telegram Accounts
 
cocomo-220726173706-141e08f0.tyuiuuupptx
DharaniMani4
 
Lifting Equipment Inspection Checklist with eAuditor Audits & Inspections
eAuditor Audits & Inspections
 
Intro_S4HANA_Using_Global_Bike_Slides_SD_en_v4.1.pptx
trishalasharma7
 
Chapter II - OS installation-Virtualization.pptx
ReyAngeloPagatpat1
 
YKS Chrome Plated Brass Safety Valve Product Catalogue
SudeYksel
 
L1-Intro.ppt nhfjkhghjjnnnmkkjhigtyhhjjj
MdKarimUllahEmon
 
Endalamaw Kebede.pdfvvbhjjnhgggftygtttfgh
SirajudinAkmel1
 
Core Components of IoT, The elements need for IOT
jeffinmathew654
 
Mobile-Device-Management-MDM-Architecture.pptx
pranavnandwanshi99
 
ssrn-5257537 (1).pdffvndsvjfjkn bfjnbjsnvmsd
dieuquynhmailan
 
Query and optimizing operating system.pptx
YoomifTube
 
DOC-20250802-WA0013._20250802_161719_0000.pdf
nidjin765
 
Colorful Illustrative Digital Education For Children Presentation.pdf
mydidiisawitch6789
 
English grade 10 st augusitne eoeoknkklm
zeropoint101109
 
dhcp concept.pptxfeegrvewfegrgerhtrhtrhredew
kebimesay23
 
Cableado de Controladores Logicos Programables
ssuserb7e1a9
 
3 01032017tyuiryhjrhyureyhjkfdhghfrugjhf
DharaniMani4
 
Chapter -24-By Dr Sajid Ali Ansari 2021.pdf
7h8p5krjwf
 
sample 1mathssscpreprationfor basics.PPTX
yuyutsugupta3
 
Top 10 Client Success Story_ The Buy Snapchat Account Experience.pdf
Telegram Accounts
 

Exploring the abc's of raspberry pi and python(day 2)

  • 1. Shahed Mehbub President, Robo Mechatronics Association Bangladesh(RMABD) Day 2
  • 2. Setting up the Pi 6. USB TO POWER SOURCE 5. TO MONITOR 4. TO MOUSE 3. TO KEYBOARD 2. WI-FI ADAPTER 1. SD CARD
  • 3. Operating Systems for Pi • Raspbian (Jessie, Jessie lite) • Ubuntu (Snappy Ubuntu Core) • Fedora • Debian • Archlinux ARM • Windows 10 IoT Core • Kali Linux • OpenELEC • RetroPIe
  • 4. Preparing the SD card with an OS • Step 1: Download bootable disk .iso's (raspbian jessie) • Link:https://www.raspberrypi.org/downloads/raspbian • Step 2: Write iso image to SD card • For Windows/Mac/Linux https://www.balena.io/etcher/
  • 5. Let's boot it up!!! • Plug in all the accessories • Plug in the power cable • Pi will start booting automatically (First boot may take a long time) • You may have to face a configure window (If it happens, follow it through)
  • 6. Default Credentials for a new user • If you encounter for a username and password: • username: pi • password: raspberry • After login, type 'startx' to go to the Desktop
  • 8. Time for making it home! ▶▶ ▶▶
  • 9. Wifi Configuration Menu > Preferences > Wifi Configuration OR Click on the network icon on the top panel
  • 11. Do a system update (It is important to function all the apps working correctly) • Open up the terminal: • Write--> sudo apt-get update • and--> sudo apt-get upgrade ** Reboot after completing the update process and we are good to go!!! :D
  • 13. GPIO on Raspberry Pi • 26 GPIO Header in Model A/B and 40 GPIO Header in Model B • These pins are a physical interface between the Pi and the outside world. • Out of 26, 8 are dedicated IO Lines, 2 are for UART, 4 are for SPI (+1 for Another Chip Select) , and another 2 for the I2C Interface (Total 17 out of 26) • Rest are Supply Rails. • Model B+ has 9 additional GPIO including a extra SPI (Total 17 + 9 = 26 out of 40) • WiringPi : Easy to use C Library for accessing the GPIO Lines via Programming (Arduino Style Programming)
  • 14. Let's Do Blinky!!! Making of a LED Blinker using Python ==> What you will need: -> A raspberry pi -> A LED -> A 330Ω resistor to protect the LED -> Jumper wires
  • 15. Let's Do Blinky!!! Step 1: Make sure if the LED is okay • Connect the jumper wires as shown • One wire on the short leg of LED (Negative) • Another one attached with the resistor is on the long leg (Positive) LED
  • 16. Let's Do Blinky!!! Step 1: Make sure if the LED is okay • Connect the wires as shown • One in the 3.3V pin (Positive wire) • Another one is in GND ** Check if the LED is on! 3.3V (Pin 1) GND Cathode Anode (longer leg)
  • 17. Let's Do Blinky!!! 3.3V Ground GPIO (general purpose input output)
  • 19. 5 functions to control GPIO’s • GPIO.setmode() • GPIO.setwarnings() • GPIO.setup() • GPIO.input() • GPIO.output()
  • 20. Let's Do Blinky!!! ->Programming the LED import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) LED = 4 GPIO.setup(LED,GPIO.OUT) while True: GPIO.output(LED,True) time.sleep(1) GPIO.output(LED,False) time.sleep(1) import RPi.GPIO libs set LED pin as output toggle light pin signal to low/high to make it blink. set pin type. use BCM, not pin number GPIO 4 pin (Pin 7)
  • 21. Congrats!!! You just finished your first Raspberry Pi project!
  • 22. Button input - Wiring
  • 23. Performing GPIO Input #import RPi.GPIO as GPIO import EmulatorGUI as GPIO import time GPIO.setmode(GPIO.BCM) INPUTPIN= 23 GPIO.setup(INPUTPIN, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: if(GPIO.input(INPUTPIN) == True): print(‘this’) else: print(‘that’)
  • 24. Your Task!! Write a program that pushing a button will turn on an LED
  • 25. Solution import EmulatorGUI as GPIO import time GPIO.setmode(GPIO.BCM) INPUTPIN= 23 led = 4 GPIO.setup(INPUTPIN, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: if(GPIO.input(INPUTPIN) == True): led.on() else: led.off() def led_on(): GPIO.output(led, True) Def led_of(): GPIO.output(led, False)