Irsa Jan Lab 7
Irsa Jan Lab 7
Instructor: Triss
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
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
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);
}
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
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
80% 20 % 100 %