0% found this document useful (0 votes)
48 views

Irsa Jan Lab 7

The document provides instructions for installing an operating system on a Raspberry Pi single board computer. It includes a list of required components, describes the Raspberry Pi's GPIO pins and their functions, and outlines the steps to install an OS which includes downloading NOOBS, copying it to an SD card, inserting the SD card into the Raspberry Pi, and following the installation process on a connected monitor. It then provides sample code to blink an LED connected to GPIO pin 8 and questions to write and compare code on an ESP-32 and Raspberry Pi.

Uploaded by

irsajanjan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Irsa Jan Lab 7

The document provides instructions for installing an operating system on a Raspberry Pi single board computer. It includes a list of required components, describes the Raspberry Pi's GPIO pins and their functions, and outlines the steps to install an OS which includes downloading NOOBS, copying it to an SD card, inserting the SD card into the Raspberry Pi, and following the installation process on a connected monitor. It then provides sample code to blink an LED connected to GPIO pin 8 and questions to write and compare code on an ESP-32 and Raspberry Pi.

Uploaded by

irsajanjan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab Handout #7: Introduction to Raspberry Pi and its Installation

Instructor: Triss

Name: IRSA JAN


CMS ID: 033-19-0046
Semester: VII

Department of Electrical Engineering


TEL-413: Introduction to Robotics
Rubrics for Lab Task Assessment

Rubrics for Marks Breakdown


Demonstration
Design Manual Total (Out of 100)
Manual

Criteria 100% 70% 30% 0%


Design (40%) Designed as per Partially designed Not designed as Code not
instructions. as per instructions. per instructions. submitted.
Demonstration Successfully Successfully Demonstrated Failed to
(40%) demonstrated the demonstrated with with Major demonstrate the
task as intended. minor mistakes. mistakes. project.
Manual (20%) The manual The manual The manual not The manual not
submitted on time submitted on time submitted on time submitted.
with proper without proper but with proper
solution code. solution code. solution.
Lab Objective: Install OS on Raspberry Pi and Write a program to access the GPIOs

Required Components:
1. Raspberry Pi
2. Micro SD card
3. USB Card reader
4. HDMI Cable
5. Monitor with HDMI port
6. Keyboard
7. Mouse
8. USB-Micro USB cable
9. Mobile Robot Chassis with motors
10. Battery
11. Motor Driver circuit board
12. LED and a resistor
13. Connecting wires

Raspberry Pi is low-cost single-board Linux computer developed by Raspberry foundation(UK). It


is a ARM11 (Broadcom 2835) based development board or a computer which is able to perform
operations similar to a PC as well as a controller. The graphics capabilities and HDMI video output
make it suitable for multimedia applications. With access to the internet, through Ethernet or Wi-Fi
(with a USB dongle in some cases) and a high definition output, the Raspberry Pi is an incredibly
versatile piece of computing kit. The Raspberry Pi 3 is based on a Broadcom BCM2835 chip that is
based on ARMv6 architecture. It does not have built-in hard disk or solid-state drive, instead a
micro SD card is used booting and long-term storage. This single board computer also comes with
digital I/O ports and enough CPU power to accomplish different projects. Programming language
Python can be used to access the digital I/O pins, referred to as General Purpose Input Output Pins
(GPIOs).
GPIOs:
Raspberry Pi GPIOs are digital pins that can be used for input and output purpose. It should be
noted that these GPIO deliver logic “HIGH “ at 3.3V rather than 5V. Similarly the GPIOs accept
3.3V as input logic “HIGH”. Apart from that, different pins have various functions as described
under.

 PWM (pulse-width modulation)


◦ Software PWM available on all pins
◦ Hardware PWM available on GPIO12, GPIO13, GPIO18, GPIO19
 SPI
◦ SPI0: MOSI (GPIO10); MISO (GPIO9); SCLK (GPIO11); CE0 (GPIO8), CE1 (GPIO7)
◦ SPI1: MOSI (GPIO20); MISO (GPIO19); SCLK (GPIO21); CE0 (GPIO18); CE1
(GPIO17); CE2 (GPIO16)
 I2C
◦ Data: (GPIO2); Clock (GPIO3)
◦ EEPROM Data: (GPIO0); EEPROM Clock (GPIO1)
 Serial
◦ TX (GPIO14); RX (GPIO15)

Operating System (OS) Installation:

As mention, Raspberry Pi is a single-board computer so it needs OS. To install an OS we need to


follow the steps given below:

1. Download NOOBs (New Out Of the Box Software) an straightforward way to install an
operating system on Pi from https://www.raspberrypi.org/downloads/noobs/.
2. Insert the USB card reader (with SD card) in the USB port of the PC.
3. Copy extracted contents of “NOOB.zip” file on SD card.
4. Insert the SD card in Raspberry Pi.
5. Connect HDMI cable between a monitor and the Raspberry Pi. Also connect a mouse and
keyboard with the Pi.
6. Power on Pi using USB-Micro USB cable.
7. Follow the installation process on Monitor to install the Raspbian OS.

________________________________________________________________________________

Practice Task: Write any program and test the running of Raspberry Pi.
LED Blink Code
import RPi.GPIO as GPIO

from time import sleep

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)
GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW)

while True:

GPIO.output(8, GPIO.HIGH)

sleep(1)

GPIO.output(8, GPIO.LOW)

sleep(1)

Exercise Tasks:
1. Write a program on ESP-32 and Raspberry Pi and analyse its performance.
ESP-32 LED Blinking Code
void setup() {

pinMode(18, OUTPUT);
}

void loop() {
digitalWrite(18, HIGH);
delay(500);
digitalWrite(18, LOW);
delay(500);
}

Raspberry Pi LED Blinking Code


import RPi.GPIO as GPIO

from time import sleep

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(8, GPIO.OUT, initial=GPIO.LOW)

while True:

GPIO.output(8, GPIO.HIGH)

sleep(1)

GPIO.output(8, GPIO.LOW)

sleep(1)

Exercise Question: How easy/difficult it is to work with a Raspberry Pi than an ESP board?
Answer. ESP is an easy and simpler than Raspberry Pi because Raspberry Pi based on Linux
operating system and it is a bit complex. For working on Raspberry Pi one should learn the interface
of Linux and python language.
Rubrics for Lab Task Assessment

Rubrics for Marks Breakdown


Task Completion Manual Submission Total (Out of 10)

80% 20 % 100 %

Criteria Accurately Partially None


Design (40%) Designed as per Designed as per Not designed as per
instructions instructions instructions
Demonstration (40%) Successfully Successfully Failed to demonstrate
demonstrated and demonstrated but failed the project.
answered the asked to answer the asked
questions during the questions during the
demonstration. demonstration.
Manual (20%) The manual submitted The manual submitted The manual not
on time with the on time without the submitted.
solution code. solution code.

You might also like