WELCOME
UNIT 3
Programming of Raspberry Pi using Python
Points To Learn In This Unit
Setting up Raspberry Pi
1. Configuration of Raspberry Pi
2. Overview of Raspberian OS
3. Installation and different types of OS
4. Benefits of Operating systems
Basic Python Programming ( Script programming )
1. Variable & data types
2. Flow Control structures
3. Conditional statements ( If…Then…else)
4. Functions: I/O function ( GPIO, Digital)
5. Time functions ( Delays)
6. Library functions
7. Basic Arithmetic Programs ( ON-OFF)
Paspberry Pi Configuration
Ethernet Connector for internet
SD Card
Underneath
USB Connectors for Keyboard
and Mouse
Power supply HDMI Port 3.5 mm
Micro USB for Monitor Audio jack
Raspberry Pi OS (formerly Raspbian) is a Debian-based operating system for
Raspberry Pi. Since 2015, it has been officially provided by the Raspberry Pi
Foundation as the primary operating system for the Raspberry Pi family of
compact single-board computers.The first version of Raspbian was created by
Mike Thompson and Peter Green as an independent project. The initial build
was completed in June 2012.
Raspberry Pi OS is highly optimized for the Raspberry Pi line of compact single-
board computers with ARM CPUs. It runs on every Raspberry Pi except the Pico
microcontroller. Raspberry Pi OS uses a modified LXDE (Lightweight X11
Desktop Environment) as its desktop environment with the Openbox stacking
window manager, along with a unique theme. The distribution is shipped with a
copy of the algebra program Wolfram Mathematica and a version of Minecraft
called Minecraft Pi Edition, as well as a lightweight version of the Chromium
web browser.
Basic Features of Raspbian Operating System
OS family : Unix-like
APT Advanced Packaging Tool
Developer : Raspberry Pi Foundation
dgkp Linux Debian packages manager
Source model : Open source
LXDE
Latest release : Raspbian Buster / 2020-02-13
Lightweight X11 Desktop Environment
Marketing target : Raspberry Pi
Update method : APT
Package manager : dpkg
Platforms : ARM
Kernel type : Monolithic
Userland : GNU
Default user interface : PIXEL, LXDE
License : Free and open-source software licenses
(mainly GPL) Official website
https://www.raspberrypi.org/
2015-09-28
2015-11-24
2016-02-08
4.1
2016-02-09
2016-02-29
2016-03-18
2016-05-13
2016-05-31 8(Jessie) 4.9 1.0.9.8.1
4.4
2016-09-28
2016-11-29
2017-02-27
2017-03-03
2017-04-10
2017-06-23
2017-07-05 4.9
2017-08-17
2017-09-08 7.7
1.4.6
2017-11-29
2018-03-13
2018-04-18 9(Stretch) 6.3
2018-06-29
1.4.8
2018-10-09 4.14
2018-11-13
2019-04-08 1.4.9
2019-06-24
2019-07-10
2019-09-30
4.19
2020-02-07 1.8.2
2020-02-14
10(Buster) 8.3
2020-05-27
2020-08-20 5.4.51
2020-12-02 5.4.79 1.8.2.1
2021-01-11 5.4.83
1.8.2.2
2021-03-04 5.10.17
Debian
Release date Linux kernel GCC apt X Server Pi 1/1+ Pi 2 Pi 3 PiZero W Pi 3+ Pi 4
version
Installing Raspberry Pi OS on your SD card.
Now we will go through how to set up your Raspberry Pi using a Windows
machine, starting with how to set up the operating system on the microSD
card. Below steps explain process step-by-step.
Step 1. When you're setting up the microSD card, you may need to use a
microSD adapter. To begin setting this up, just slot the microSD card into the
back of the microSD card adapter. To install the operating system on the
microSD card, you'll need to use either an SD card reader/writer or you'll
have a slot on your laptop for an SD card. In this instance, you take the SD
card adapter and slot it into the reader. Then plug that reader into the
computer and install the OS onto the microSD card.
Step 2. Next, you'll need to download the operating system for your Pi. Go
to raspberrypi.org/downloads/. click on the Raspberry Pi Imager, which is
the official operating system installer. Using the Raspberry Pi Imager is the
easiest way to install Raspberry Pi OS on your SD card.
SD card inserted in card reader to download
raspberry Pi Imager
Click on the link for the Raspberry Pi Imager that matches your operating system
Using the Raspberry Pi Imager
Anything that’s stored on the SD card will be overwritten during formatting.
If your SD card currently has any files on it, e.g. from an older version of
Raspberry Pi OS, you may wish to back up these files first to prevent you
from permanently losing them. When you launch the installer, your
operating system may try to block you from running it. For example, on
Windows I receive the following message:
If this pops up, click on More
info and then Run anyway
Follow the instructions to
install and run the Raspberry Pi
Imager Insert your SD card into
the computer or laptop SD card
slot In the Raspberry Pi Imager,
select the OS that you want to
install and the SD card you
would like to install it on
Then simply click the WRITE button Wait for the
Raspberry Pi Imager to finish writing Once you get the
following message, you can eject your SD card
You will need to be connected to the internet the first time for the the Raspberry Pi
Imager to download the OS that you choose. That OS will then be stored for future
offline use. Being online for later uses means that the Raspberry Pi imager will always
give you the latest version.
Your Raspberry Pi needs an SD card to store all its files and the Raspberry Pi
OS operating system. You need a microSD card with a capacity of at least
8GB. Many sellers supply SD cards for Raspberry Pi that are already set up
with Raspberry Pi OS and ready to go.
Now get everything connected to your Raspberry Pi. It’s
important to do this in the right order, so that all your
components are safe.
Paspberry Pi Component connection sequence method
Ethernet Connector for internet
SD Card
Underneath
USB Connectors for Keyboard
and Mouse
Power supply HDMI Port 3.5 mm
Micro USB for Monitor Audio jack
You should see a red LED light up on the Raspberry Pi, which indicates that
Raspberry Pi is connected to power. As it starts up (this is also called booting), you
will see raspberries appear in the top left-hand corner of your screen.
After a few seconds the Raspberry Pi OS desktop will appear.
Raspberry Pi OS looks similar to many common
desktops, such as macOS and Microsoft Windows.
The menu bar is positioned at the top and contains
an application menu and shortcuts to
Terminal, Chromium, and File Manager. On the
right is a Bluetooth menu, a Wi-Fi menu, volume
control, and a digital clock.
Finishing the setup
When you start your Raspberry Pi for the first time, the Welcome to Raspberry
Pi application will pop up and guide you through the initial setup.
Click on Next to start the setup.
Set your Country, Language, and Timezone, then click on Next again.
Enter a new password for your Connect to your wireless network by
Raspberry Pi and click on Next. selecting its name, entering the password,
and clicking on Next. If your model of
Raspberry Pi doesn’t have wireless
connectivity, you won’t see this screen.
Click on Next, and let the wizard check for You will only need to reboot if that’s necessary to
updates to Raspberry Pi OS and install complete an update.
them (this might take a little while).
Raspberry Pi NOOBS: How to Set Up, Configure, and Use NOOBS
What is NOOBS?
NOOBS is an OS installation program created by Raspberry Pi. It comes pre-loaded with operating
systems that can run on the Raspberry Pi. You can also use it to download additional OS images
from the internet.
What does NOOBS stand for?
NOOBS is an acronym for New Out Of the Box Software.
How does NOOBS work?
The NOOBS software package is downloaded onto your computer and installed onto a MicroSD
card. When you load the SD card on your Raspberry Pi, an interface loads with a selection of
Operating Systems. You can use the NOOBS program to choose an OS, download additional ones
from the internet, and install them directly onto your Pi.
NOOBS saves you the trouble of tracking down individual OS packages online. It's like a one-stop-
shop for setting up an OS on your Pi.
How to download and install NOOBS
You can download NOOBS directly from the Raspberry Pi Foundation website. The default version
comes pre-loaded with Raspbian. They also offer a lite version without the Raspbian preload.
•Visit www.raspberrypi.org/downloads/
How to install NOOBS
The NOOBs package comes in a zip file. We need to copy
the contents of the zip file to put them on a blank
MicroSD card for the Raspberry Pi.
Connect the MicroSD card to your computer. Open the zip
file and extract the contents to the MicroSD card location.
Once the transfer is complete, safely eject your MicroSD
card, insert it into the Raspberry Pi, and connect the Pi's
power supply. Your Raspberry Pi will now boot into NOOBS.
Available software on NOOBS
You can find these operating systems on NOOBS for installation. Certain ones are built into the NOOBS SD
card installation while others will need to be downloaded before installing. Don't worry -- the NOOBS
installer will download them for you automatically!
Software Availability
Raspbian Full SD Card
LibreELEC RPi2 SD Card
Raspbian Lite Download
Lakka RPi2 Download
Raspbian Download
Data Partition Download
OSMC Pi2 Download
Screenly OSE Download
RISC OS Download
Windows 10 IoT Core Download
TLXOS Download
How to set up and use NOOBS
Your Pi should now boot into NOOBS. Connecting your Pi to the internet will give you more installation
options. You can use an Ethernet cable or click Wi-fi networks at the top to open Wi-fi options. This
will expand the list of available software you can install. For example, you should consider setting up
Pi-hole to browse the web pop-up free!
Scroll through the list to find the operating system you need. From there, just follow the prompts to
complete the installation process.
Congratulations! You're a NOOBS pro.
Thank You