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
Raspberry Pi Introductory Lecture
PPTX
Raspberry Pi ppt.pptx
PPTX
Raspberry Pi ppt.pptx
PDF
Interfacing the Raspberry Pi to the World
PPTX
Raspberry pi
PDF
4. GPIO Access
PDF
Introduction to Raspberry Pi
PDF
Exploring Raspberry Pi
DOCX
Raspberry pi, Summer $ Short Term Courses in waayoo.com
PDF
RaspberryPi_Workshop and Programming with python.
PPTX
Introduction To Raspberry Pi with Simple GPIO pin Control
PPTX
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
PDF
Intoduction to physical computing using Raspberry Pi, 18-02-2016
PDF
IoT Physical Devices and End Points.pdf
PPTX
Starting Raspberry Pi
PPTX
IOT notes ....,.........
PDF
Raspberry pi: Proyectos de robótica raspberry pi de richard grimmett.
PPTX
Python in raspberry pi
PDF
Raspberry Pi - Lecture 6 Working on Raspberry Pi
PPTX
Raspberry pi
Raspberry Pi Introductory Lecture
Raspberry Pi ppt.pptx
Raspberry Pi ppt.pptx
Interfacing the Raspberry Pi to the World
Raspberry pi
4. GPIO Access
Introduction to Raspberry Pi
Exploring Raspberry Pi
Raspberry pi, Summer $ Short Term Courses in waayoo.com
RaspberryPi_Workshop and Programming with python.
Introduction To Raspberry Pi with Simple GPIO pin Control
Raspberry-Pi, Developing on Raspberry Pi, Difference between Arduino & Raspbe...
Intoduction to physical computing using Raspberry Pi, 18-02-2016
IoT Physical Devices and End Points.pdf
Starting Raspberry Pi
IOT notes ....,.........
Raspberry pi: Proyectos de robótica raspberry pi de richard grimmett.
Python in raspberry pi
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry pi
Ad

Recently uploaded (20)

PPTX
New professional education PROF-ED-7_103359.pptx
PPT
FABRICATION OF MOS FET BJT DEVICES IN NANOMETER
PDF
Dynamic Checkweighers and Automatic Weighing Machine Solutions
PPTX
Lecture 3b C Library _ ESP32.pptxjfjfjffkkfkfk
DOCX
A PROPOSAL ON IoT climate sensor 2.docx
PDF
How NGOs Save Costs with Affordable IT Rentals
PPTX
Nanokeyer nano keyekr kano ketkker nano keyer
PDF
-DIGITAL-INDIA.pdf one of the most prominent
PPTX
Fundamentals of Computer.pptx Computer BSC
PPTX
Embedded for Artificial Intelligence 1.pptx
PPTX
Computers and mobile device: Evaluating options for home and work
PPTX
Embeded System for Artificial intelligence 2.pptx
PDF
PPT Determiners.pdf.......................
PPTX
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
PPT
Lines and angles cbse class 9 math chemistry
PPTX
02fdgfhfhfhghghhhhhhhhhhhhhhhhhhhhh.pptx
PPTX
Prograce_Present.....ggation_Simple.pptx
DOCX
fsdffdghjjgfxfdghjvhjvgfdfcbchghgghgcbjghf
PPTX
Operating System Processes_Scheduler OSS
PPT
chapter_1_a.ppthduushshwhwbshshshsbbsbsbsbsh
New professional education PROF-ED-7_103359.pptx
FABRICATION OF MOS FET BJT DEVICES IN NANOMETER
Dynamic Checkweighers and Automatic Weighing Machine Solutions
Lecture 3b C Library _ ESP32.pptxjfjfjffkkfkfk
A PROPOSAL ON IoT climate sensor 2.docx
How NGOs Save Costs with Affordable IT Rentals
Nanokeyer nano keyekr kano ketkker nano keyer
-DIGITAL-INDIA.pdf one of the most prominent
Fundamentals of Computer.pptx Computer BSC
Embedded for Artificial Intelligence 1.pptx
Computers and mobile device: Evaluating options for home and work
Embeded System for Artificial intelligence 2.pptx
PPT Determiners.pdf.......................
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
Lines and angles cbse class 9 math chemistry
02fdgfhfhfhghghhhhhhhhhhhhhhhhhhhhh.pptx
Prograce_Present.....ggation_Simple.pptx
fsdffdghjjgfxfdghjvhjvgfdfcbchghgghgcbjghf
Operating System Processes_Scheduler OSS
chapter_1_a.ppthduushshwhwbshshshsbbsbsbsbsh

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)