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
PPTX
Up and running with Raspberry Pi
PPTX
Raspberry pi : how to get started
PPTX
Pi Is For Python
ODP
Raspberry Pi and Amateur Radio
PPTX
Raspberry Pi (Introduction)
ODP
Connecting Hardware to the Web with the BeagleBone
PDF
Polstra 44con2012
Exploring the ABC's of Raspberry Pi with Python
Up and running with Raspberry Pi
Raspberry pi : how to get started
Pi Is For Python
Raspberry Pi and Amateur Radio
Raspberry Pi (Introduction)
Connecting Hardware to the Web with the BeagleBone
Polstra 44con2012

What's hot (20)

ODP
DigiPinguïns: demo Raspberry Pi (Koen De Smet)
PDF
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
ODP
Introduction to Raspberry Pi and GPIO
PPTX
Introduction to raspberry pi
ODP
Debian & the BeagleBone Black
PDF
Single Board Computers & Raspberry Pi Basics
PDF
Rapidly developing IoT (Internet of Things) applications - Part 2: Arduino, B...
PDF
BeagleBone Black Using Python
PPTX
Getting Started with Raspberry Pi
PDF
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
PDF
BeagleBone Workshop
PPSX
Low Cost HD Surveillance Camera using Raspberry PI
ODP
Thotcon2013
PPTX
Getting Started with Raspberry Pi and Arduino
PDF
Hands On Embedded Linux with BeagleBone Black
PPTX
Raspberry Pi Using Python
PDF
LCA2018 Open Hardware MiniConference: LoliBot Software
PDF
My presentation raspberry pi
PDF
Introduction to the rapid prototyping with python and linux for embedded systems
PDF
Raspberry Pi and Amateur Radio - 2020 update
DigiPinguïns: demo Raspberry Pi (Koen De Smet)
Taking the BeagleBone Cookbook recipes beyond BeagleBone Black
Introduction to Raspberry Pi and GPIO
Introduction to raspberry pi
Debian & the BeagleBone Black
Single Board Computers & Raspberry Pi Basics
Rapidly developing IoT (Internet of Things) applications - Part 2: Arduino, B...
BeagleBone Black Using Python
Getting Started with Raspberry Pi
Raspberry JAM 1 - Setup Raspberry Pi with Raspbian -Vick Nesh
BeagleBone Workshop
Low Cost HD Surveillance Camera using Raspberry PI
Thotcon2013
Getting Started with Raspberry Pi and Arduino
Hands On Embedded Linux with BeagleBone Black
Raspberry Pi Using Python
LCA2018 Open Hardware MiniConference: LoliBot Software
My presentation raspberry pi
Introduction to the rapid prototyping with python and linux for embedded systems
Raspberry Pi and Amateur Radio - 2020 update
Ad

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

PPTX
Unit 6 - PART2.pptx
PPTX
Unit 3 Complete.pptx
PPTX
Raspberry pi basics
PPTX
Raspberry Pi
PDF
Raspberry pi intro.
PPTX
Introduction To Raspberry Pi with Simple GPIO pin Control
PPTX
Raspberry pi
PDF
How to Hack Edison
PPTX
PPTX
Raspberry Pi Free Session - 20_09_2014
PPTX
2_RaspberryPi presentation.pptx
PPTX
Raspberry Pi Introductory Lecture
PPTX
Got Python I/O: IoT Develoment in Python via GPIO
ODP
Raspberry Pi with Java
PDF
Iot lab manual new
PDF
Raspberry Pi 3 Tutorial | Raspberry Pi 3 Projects | IoT Projects | IoT Tutori...
PPTX
Raspberry Pi Session - 22_11_2014
PDF
Raspberry pi technical documentation
PPTX
Raspberry Pi ppt.pptx
PPTX
Raspberry Pi ppt.pptx
Unit 6 - PART2.pptx
Unit 3 Complete.pptx
Raspberry pi basics
Raspberry Pi
Raspberry pi intro.
Introduction To Raspberry Pi with Simple GPIO pin Control
Raspberry pi
How to Hack Edison
Raspberry Pi Free Session - 20_09_2014
2_RaspberryPi presentation.pptx
Raspberry Pi Introductory Lecture
Got Python I/O: IoT Develoment in Python via GPIO
Raspberry Pi with Java
Iot lab manual new
Raspberry Pi 3 Tutorial | Raspberry Pi 3 Projects | IoT Projects | IoT Tutori...
Raspberry Pi Session - 22_11_2014
Raspberry pi technical documentation
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
Ad

Recently uploaded (20)

PPTX
Sem-8 project ppt fortvfvmat uyyjhuj.pptx
PPTX
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
PDF
How NGOs Save Costs with Affordable IT Rentals
PPTX
PROGRAMMING-QUARTER-2-PYTHON.pptxnsnsndn
PPTX
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
PPTX
Operating System Processes_Scheduler OSS
PPT
Lines and angles cbse class 9 math chemistry
PPTX
title _yeOPC_Poisoning_Presentation.pptx
PDF
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
PDF
Core Components of IoT, The elements need for IOT
PPTX
Fundamentals of Computer.pptx Computer BSC
PDF
-DIGITAL-INDIA.pdf one of the most prominent
PPTX
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
PPTX
udi-benefits-ggggggggfor-healthcare.pptx
PPTX
Presentacion compuuuuuuuuuuuuuuuuuuuuuuu
PPTX
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
PDF
YKS Chrome Plated Brass Safety Valve Product Catalogue
DOCX
A PROPOSAL ON IoT climate sensor 2.docx
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
PDF
Prescription1 which to be used for periodo
Sem-8 project ppt fortvfvmat uyyjhuj.pptx
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
How NGOs Save Costs with Affordable IT Rentals
PROGRAMMING-QUARTER-2-PYTHON.pptxnsnsndn
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
Operating System Processes_Scheduler OSS
Lines and angles cbse class 9 math chemistry
title _yeOPC_Poisoning_Presentation.pptx
Layer23-Switch.com The Cisco Catalyst 9300 Series is Cisco’s flagship stackab...
Core Components of IoT, The elements need for IOT
Fundamentals of Computer.pptx Computer BSC
-DIGITAL-INDIA.pdf one of the most prominent
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
udi-benefits-ggggggggfor-healthcare.pptx
Presentacion compuuuuuuuuuuuuuuuuuuuuuuu
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
YKS Chrome Plated Brass Safety Valve Product Catalogue
A PROPOSAL ON IoT climate sensor 2.docx
"Fundamentals of Digital Image Processing: A Visual Approach"
Prescription1 which to be used for periodo

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)