PRPCOEM-IoT Lab-II Manual - Students
PRPCOEM-IoT Lab-II Manual - Students
To develop professionals with strong ethics and human values for the
betterment of society.
Vision
To achieve the excellent standard of quality education by using transcending the
process of integrating intelligence to Technology Products and Processes by
architectural and algorithmic solution building procedures resulting autonomous
entities which shall surpass collective human intelligence in society.
Mission
Engage learners to develop competency in Data centric algorithmic
approaches in resolving complexities of real time problems.
Help pupils to develop competency in creative and architectural solution
building processes for building efficiencies in artificial intelligence.
Scaling up the process of creating digital learning content in the realm of
AI & DS underpinning the theories of cognitive science and virtual /
Augmented reality techniques.
Program Educational Objectives (PEOs)
Graduates will have the capabilities to apply AI&DS knowledge to
develop feasible systems.
Graduates will be able to handle the challenges of rapidly changing
technology.
Equip the graduates with strong technical knowledge, competency
in soft skills, lifelong learning skills that allow them to contribute
ethically to the need of society.
Department of Artificial Intelligence & Data Science Engineering
Certificate
Mr./Ms…………………………………………………………...
curriculum.
Name of Student:
Sign of
Title of the Date of Date of Assessment Teacher
SN.
Practical / Experiment Performance Submission Marks (15) and
Remarks
Study Raspberry Pi and its
1
component.
Study Arduino and its
2
component.
3 Learn how to install Raspberry
Pi
Learn configuration settings of
4
Raspberry Pi
Start Raspberry Pi and learn
5 the basics of editor and
Raspberry Pi infrastructure
Start Raspberry Pi and try
various Linux commands in
command terminal window ,
6 Such as: ls, cd, touch, mv, rm,
man, mkdir, rmdir, tar, gzip,
cat, more, less, ps, sudo, cron,
chown, chgrp, ping etc.
Write a program to Read your
7 name and print Hello message
with name in python.
Write a program to Read two
8 numbers and perform all
arithmetic operations in python.
Write a program to do Word
9 and character count of a given
string in python
Write a program to calculate
Area of a given shape
10
(rectangle, triangle and circle)
in python
Control Raspberry Pi via
11
Telegram Messenger.
12
Signature of Faculty
INSTRUCTIONS FOR STUDENTS
Students shall read the points given below for understanding the theoretical concepts
and practical applications.
1 Listen carefully to the lecture given by teacher about importance of subject,
curriculum philosophy, learning structure, skills to be developed,
information about equipment, instruments, procedure, method of continuous
assessment, tentative plan of work in laboratory and total amount of works to
be done in a semester.
2 Student shall undergo study visit of the laboratory for types of equipment,
and material to be used, before performing experiments.
3 Read the write up of each experiment to be performed, a day in advance.
4
Organize the work in the group and make a record of all observations.
5
Understand the purpose of experiment and its practical implications.
6
Student should not hesitate to ask any difficulty faced during conduct of
practical /exercise.
7
Write the answers of the questions allotted by the teacher during practical
hours if possible or afterwards, but immediately.
8 The student shall study all the questions given in the laboratory manual and
practice to write the answers to these questions.
9 Student should develop the habit of pear discussion / group discussion
related to experiments / exercise so that exchanges of knowledge / skills
could take place.
10 Students shall attempt to develop related hands-on-skills and gain
confidence.
11 Student shall focus on development of skills rather than theoretical or
codified knowledge.
12 Student shall insist for the completions of recommended Laboratory Work,
answers to the given question etc.
13 Student shall develop the habit of evolving more ideas, innovations, skills
etc. that included in the scope of the manual.
14 Student shall refer technical magazines, proceedings of the Seminars, refer
website related to the scope of the subjects and update their knowledge and
skills.
15 Student should develop the habit of not depend totally on teachers but to
develop self-learning techniques.
16 Student should develop the habit to interact with the teacher without
hesitation with respect to academic involved.
17 Student should develop habit to submit the practical’s exercise continuously
and progressively on the schedule dates and should get the assessment
done.
18 Student should be well prepared while submitting the write up of the
exercise. This will develop the continuity of the studies and he will not be
overloaded at the end of the term.
LABORATORY INSTRUCTIONS
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Lab Course Outcomes
Outcomes
SN
1. Raspberry Pi and Arduino hardware/software
2. Raspberry Pi and Arduino hardware/software
3. Basic operations of handling data
4. Code to perform string and numeric operations on given user input
5. Describe IOT(Internet of things).
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 1
LEARNING OUTCOME:
HARDWARE/SOFTWARE REQUIRED:
SN Name of Software Tool Specification
1 Raspberry Pi Board Model B (1 GB RAM)
2 Micro SD Card, Card Reader & Adapter
INTRODUCTION:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
DIAGRAM:
Components of RASPBERRY-PI:
Micro-USB Power Supply: A 5V micro USB typically powers the Raspberry
Pi. But how much current (in milliamps or amps) the Pi requires to function
depends on your usage.
The recommended amount is between 700mA for a Raspberry Pi Model A,
and up to 2.5A for a Raspberry Pi 3 Model B.
The Raspberry Pi boards typically draw much lower amounts, between 200
and 500mA.
Usage depends on what you’re doing with the Pi. Playing video and
browsing the web draws more power than idling and booting. It also
depends on what devices you have connected; some keyboards and mice
draw more power than others.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
SD Card Slot: Secure Digital Card slot (SD Card) slot is a solid-state
removable storage device which is required to run operating systems on
Raspberry Pi as Raspberry Pi doesn’t have any onboard memory and data
storage functionality. Raspberry Pi supports both SDHC (Secure Digital High
Capacity) and SDXC (Secure Digital extended Capacity). The best suited
card for proper running of all sorts of operating systems without any hiccup
is Class 10 with speed @ 10MB/sec.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Video Out (RCA Cable): In addition to HDMI Connectivity which facilitates
HD connection, Raspberry Pi also has provision to be connected to standard
monitor or TV using RCA video cable. RCA cable is less expensive as
compared to HDMI but along with RCA cable, the user has to buy 3.5mm
stereo cable for audio facilitation.
The Pi Model B+, Pi 2, Pi 3 and Pi 4 features a 4-pole 3.5mm audio jack which
also includes the composite video signal. This has allowed for the removal of
the composite video socket found on the original Model B.
The new jack is a 4-pole socket which carries both audio and video signals.
It’s similar to sockets found on other multimedia devices such as iPods, MP3
players and smart-phones. It now used on the A+, B+, Pi 2, Pi 3 and Pi 4.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Status Led’s: Raspberry Pi comprise of 5 main LED’s performing the
following functions:
ACT: (Color-Green): The main function of ACT LED is to show card status.
Normally flashing during any SD Card activity performed by end user.
PWR: (Color-Red): The main function of PWR led is power. This led is
continuously ON when raspberry Pi is switched on and keep on till switched
off.
FDX: (Color-Orange): The main function of FDX led is full duplex. This Led
is powered on when Ethernet connection is of Full Duplex type.
LNK: (Color- Orange): The function performed by LNK led is Link. This LED
is powered on when Ethernet connection is established and packet transfer
starts taking place.
100: (Color-Orange): The 100 Led objective is to show 100 Mbps
connection. When any connection is established at Ethernet port, this LED
only gets on when connection is of 100 Mbps speed and gets powered off
when connection is at 10 Mbps.
GPIO (General Purpose Input Output): GPIO facilitates connecting all
sorts of peripheral devices to Raspberry Pi. Raspberry Pi has onboard GPIO
with 40 pins, 26 of which are used as digital inputs or outputs. More
importantly, 9 of the 14 new GPIO pins are dedicated inputs/outputs, it also
facilitates the onboard UART, I2C, SPI Bus and still large amount of free GPIO
pins are there for add-on attachments.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
System On Chip (SoC): Raspberry Pi (System on Chip) SoC is ARM Based
by Broadcom Technologies. The ARM processor runs from 700 Mhz to 1 Ghz.
The SoC also facilitates videocore 4 GPU, and is capable for fast 3D core,
openGL and supports Blueray and H.264 video playback.
RESULTS:
CONCLUSION:
ASSESSMENT SCHEME:
Pre-Lab In Lab Post Lab Record Total
Test performance Test (5) (15)
(2) (5) (3)
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 2
AIM: Study Arduino and its component.
LEARNING OBJECTIVE: -
LEARNING OUTCOME:
HARDWARE/SOFTWARE REQUIRED:
SN Name of Software Tool Specification
1 Arduino Board Uno
INTRODUCTION:
Arduino is a prototype platform (open-source) based on an easy-to-use
hardware and software. It consists of a circuit board, which can be
programed (referred to as a microcontroller) and a ready-made software
called Arduino IDE (Integrated Development Environment), which is used to
write and upload the computer code to the physical board.
Arduino provides a standard form factor that breaks the functions of the
micro-controller into a more accessible package.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
One can control your board functions by sending a set of instructions to
the microcontroller on the board via Arduino IDE (referred to as
uploading software).
Unlike most previous programmable circuit boards, Arduino does not
need an extra piece of hardware (called a programmer) in order to load a
new code onto the board. You can simply use a USB cable.
Additionally, the Arduino IDE uses a simplified version of C++, making it
easier to learn to program.
DIAGRAM:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
USB - B Socket
The USB socket on the UNO has two functions. One is for communication, to
connect with the computer through a USB port, and also to load the firmware
into the Arduino with the help of the bootloader. The second is to power the
Arduino.
ISCP Pins
In the UNO you can find two 6 pin connectors. One is near the USB – TTL
Chip and the other one is at the end of the board. These pins are used to
program those two microcontrollers. The USB – TTL chip on this board is an
ATMgega16U.
Reset Button
As the name indicates this tactile switch is used to reset the ATMega328
microcontroller. It’s connected to the PC6/Reset pin, which is pulled up
through a 10K. When the switch is pressed the pin is pulled to the ground
and the chip will reset.
USB-TTL Interface Chip
To communicate with the computer, the Arduino relies on a USB-TTL
interface. In UNO, ATMega16U with custom firmware act as a USB – TTL
interface chip.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Crystal Oscillator/ Ceramic resonator
For a microcontroller to work it needs a clock source. The clock circuit
determines the speed with which the microcontroller operates. How many
instructions per second it will execute is dependent on the clock frequency.
The ATMega series microcontrollers can use two types of clock sources. One
is an internal RC oscillator that is already built into the microcontroller.
Power Path control
an LM358. It’s used as a comparator to control the input power path. When
the input power is provided through the barrel jack or Vin pin the power
path control circuit will cut off the USB power pin from the circuit which in
fact will protect the USB port.
Voltage Regulator
The ATMega328 and ATmega16U2 have a maximum input voltage of around
5V and most modules or accessories work on either 5V or 3.3V. The Arduino
can accept 7-12V through the Vin pin or the DC barrel jack. So, to step it
down, there are two regulators onboard. One is a 5V regulator (marked as 1)
for the microcontrollers and the other one is a 3.3V regulator which is used
to provide 3.3V through 3.3V pin.
DC Barrel Jack
The DC barrel jack is used to supply power to the UNO. We can supply 7-
12V through it and hence we can use a 12V DC adapter or 9V DC adapter on
this Jack to power the Arduino board.
Digital and Analog I/O
The Arduino UNO has 14 digital I/O pins and 6 Analog inputs. The digital I/O
pins are 5V logic level and you can also use the Analog pins as digital I/O
too. Arduino UNO supports 6 channel 10-bit ADC inputs through A0-A5,
which can be sampled and analyzed using UNO.
Status LEDs and Inbuilt LED
Uno has 4 LEDs onboard. One is used as a power indicator and two are used
to show the activity of the Rx and Tx pin. The other one is tied to the Digital
pin 13, which can be used to test the Arduino board or simply as an indicator
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
ATMega328P – The Brain
UNO uses a 28Pin DIP version of ATMega328P. Atmega328P is pre-
programmed with a bootloader that allows you to directly upload the
program to Arduino through USB without the need for an external
programmer.
RESULT:
CONCLUSION:
ASSESSMENT SCHEME:
Pre-Lab In Lab Post Lab Record Total
Test performance Test (5) (15)
(2) (5) (3)
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 3
AIM: Learn how to install Raspberry Pi
LEARNING OBJECTIVE: -
To understand different software required for operating system
installation.
LEARNING OUTCOME:
Students will able to install different operating system for raspberry pi.
SOFTWARE/HARDWARE REQUIRED:
SN Name of Software Tool Specification
1 Operating system image file Rasbian
2 Raspberry pi imager
3 SD card formatter
4 SD Card 32 GB Class-10
5 SD Card Reader
THEORY:
The Raspberry Pi is a mini computer specifically created to make tech
learning easier. It has a lot of components for computer-based projects,
like USB ports, an Ethernet port, an SD card slot, Wi-Fi antenna ports, and
more. A single-board computer, Raspberry Pi can be used to perform
various computing tasks. Just like any other computer Raspberry Pi also
requires an operating system to perform different operations/tasks. There
are multiple operating systems that can be installed on Raspberry Pi such
as Raspberry Pi OS, tiny core Linux, RISC OS, and many others.
PROCEDURE:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
1. Put the SD card into the card reader and connect it to a laptop or PC.
2. Download the Raspberry Pi Imager from the link. Here, I have
installed the windows version, if you are using macOS or Linux, you
can download the respective version.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
4. Then click on the “CHOOSE OS” option.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
6. If your desired OS is not in the list then, you can click on the “Use
custom” option to load the image of the desired OS.
7. But before this, make sure to download the image of your required OS
from the official website.
https://www.raspberrypi.com/software/operating-systems/
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
8. Now click on the “CHOOSE STORAGE” option.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
10. Then finally click on the “WRITE” button to write the image of the OS
onto the SD card.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
The image writing process will start and it is going to take some time to
complete as it downloads the image and write it on the SD card.
12. After some time, a prompt will appear on the screen to inform you that
the process is completed and the USB device (card reader) can be
removed. Click on the “CONTINUE” button to safely remove the card
from the system.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Insert the SD card into the Raspberry Pi device and after some setup, the
RESULTS:
CONCLUSION:
ASSESSMENT SCHEME:
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 4
AIM: Learn configuration settings of Raspberry Pi.
LEARNING OBJECTIVE: -
To understand different raspberry pi configuration.
LEARNING OUTCOME:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
If you are running your Pi without the desktop enabled, an alternative
is to run the console based version of the tool by typing the following
command:
sudo raspi-config
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
You navigate the text-based menu of raspi-config using the cursor
keys: The up- and down-arrow keys move the red selection band
through the available options, and the left and right-arrow keys move
between the option list and the Select and Finish buttons below it.
Use the Enter key to activate an option when it is highlighted by the
red band. The default action is always Select; so if you’ve highlighted
an option in the menu, there’s no need to press the right-arrow key to
choose Select before pressing Enter.
The Raspberry Pi Configuration tool’s window is split into four tabs: System,
Interfaces, Performance, and Localisation. The default tab is System, which
provides a variety of utilities for configuring the Raspbian operating system
to your requirements. One can navigate the window using the mouse: click
on any button to execute that command, click on text boxes to change their
contents, or click on toggles to switch settings on and off.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Password
By default, Raspbian includes a single non-root user account named pi. This
account is used for the day-to-day operation of the Pi, and comes with the
default password raspberry.
Although this is fine for private use, if you have your Pi on a publicly
accessible network—including a Wi-Fi hotspot or other Internet connection
—it’s a good idea to change at least the password, if not also the username,
to improve security, especially given that Raspbian runs a Secure Shell (SSH)
server by default to allow remote logins from the local network.
Hostname
A system’s hostname is the name it uses to identify itself on the network.
When you use the console or terminal on the Pi, you see the hostname as
part of the prompt that accepts your command. Hostnames should be unique,
which can cause a problem if you have more than one Raspberry Pi on your
network. You can change a Pi’s hostname at any time using the Hostname
section of the Raspberry Pi Configuration tool.
When typing a new hostname into the text box in the Hostname section, you
need to be aware of the rules of a hostname. Because hostnames adhere to
an international standard, one of a group of standards known as a Request
for Comments or RFC, certain characters aren’t allowed—a hostname should
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
contain only letters and numbers, although it can include hyphens so long
as they aren’t at the beginning or end, and cannot include spaces.
You can opt for a descriptive hostname, such as living-room-pi, or name
the OK button, but the new hostname won’t come into effect until you reboot
the Pi.
Boot
Normally, Raspbian loads into the graphical user interface known as the
desktop. It does so to ensure that the Pi is ready to use as quickly as
possible. Many common uses of the Pi-including using it as a web server or
for recording video or still images with the Raspberry Pi Camera Module—
work fine at the text-based console, however, without the need to load
the desktop graphical user interface, speeding the time taken to load the Pi
and reducing the amount of memory wasted on software you’re not actively
using.
There are two options in the Boot section: To Desktop, and to CLI. Clicking
on the round radio button next to Desktop will have the Pi automatically boot
into the graphical user interface; clicking on the radio button next to To CLI
will have the Pi remain at the console until the desktop is manually loaded
with the startx command.
Auto Login
By default, Raspbian automatically logs you in as the user pi when the system
is powered on. This makes the Pi ready for use faster, as you don’t need to
log in; it also introduces a potential security concern if you use your Pi in a
shared environment.
Clicking in the box marked Login as user pi to remove the check mark
means that you’ll have to type the username and password in every time you
turn the Pi on or reboot it.
Network at Boot
To make the Pi ready for use as quickly as possible, Raspbian doesn’t wait
for a network connection to come up before continuing the boot process.
Normally, this is fine; if you’re using your Pi to provide certain network
services, though, it can cause issues with applications that load at startup and
expect a network connection that hasn’t yet been made ready.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
To solve this issue, simply click the box Wait for network to add a check
mark. Be aware, though, that this will delay the boot process if a network
isn’t available.
Overscan
Many TV sets feature overscan, which means the visible picture area is
slightly smaller than the transmitted picture. In broadcast TV, this is often
used to hide additional data such as time code information, but in
computing, it can result in the edges of the display becoming hidden. By
contrast, using a TV signal with a modern monitor can reveal the previously
hidden edges with their additional data.
One may need to adjust the overscan for one of two reasons: The image from
your Pi is surrounded by black bars, in which case the overscan needs to be
reduced or disabled altogether; or the image from your Pi extends beyond
the visible edges of your screen, in which case the overscan needs to be
increased.
DISPLAY TAB
The next tab in the Raspberry Pi Configuration tool, labelled Display
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Underscan
Old TV sets had a significant variation in the size of the picture they
produced; some had cabinets that overlapped the screen. TV pictures were
therefore given a black border so that none of the picture was lost; this is
called overscan. Modern TVs and monitors don’t need the border, and the
signal doesn’t allow for it. If the initial text shown on the screen disappears
off the edge, you need to enable overscan to bring the border back.
Resolution
Define the default HDMI/DVI video resolution to use when the system boots
without a TV or monitor being connected. This can have an effect on
RealVNC if the VNC option is enabled.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Camera
Enable this interface only if you have a Raspberry Pi Camera Module
attached to your system. If you remove the Camera Module from your
Raspberry Pi, you can disable it again using the same section of the
Raspberry Pi Configuration tool. Although, strictly speaking, this step isn’t
required—having the Raspberry Pi configured for a camera that isn’t
connected will do no harm—it can help to keep things tidy.
SSH
The Secure Shell (SSH) provides a way to use the Pi’s terminal over a
network, creating an encrypted connection between the Pi and any other
computer capable of running an SSH client. This can even be used to control
a Pi that does not have a monitor or keyboard attached—known as a
headless system—or to transfer files to and from the Pi’s storage.
By default, the SSH server on the Raspberry Pi is enabled. If you know you
aren’t going to use SSH, can disable it here to save a small amount of
memory and reduce the chance of your system being attacked on a shared
network. If you do keep the SSH server enabled, be sure to change your
password from the System tab to keep your Pi secure.
SPI
The serial peripheral interface (SPI) is a communications standard used by
the Pi to control or otherwise communicate with external hardware over the
GPIO port. Many add-on boards for the Raspberry Pi require SPI support;
check the documentation included with your hardware to see if you need to
enable SPI support manually through the Raspberry Pi Configuration tool or
whether the vendor has an installation script that will do it for you
automatically.
I2C
The inter-integrated circuit (I2C) interface is similar to SPI, in that it is used
to control or communicate with external hardware via the GPIO port. Add-on
boards that don’t use SPI typically use I2C instead. As with SPI, check the
documentation included with your hardware to see if you need to enable I2C
support manually through the Raspberry Pi Configuration tool or whether
the vendor has an installation script that will do it for you automatically.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Serial
By default, the Raspberry Pi uses the serial connection on the GPIO header
to provide a terminal into which you can log in and control the Pi without a
monitor attached. Some add-on boards use this serial connection for other
purposes, such as driving an external display, in which case the serial
interface needs to be disabled. Before disabling it here, however, check the
documentation for your hardware; some boards need the interface disabled
completely, but others require you to make changes to its configuration
instead.
1-Wire
The 1-Wire interface is yet another alternative to I2C and SPI, offering
connectivity to and communication with sensors and other external
hardware. Typically, 1-Wire is used to connect simple sensors—such as
devices for reading the temperature or humidity of the environment—to the
Raspberry Pi, and is rarely used by add-on boards. If you’re using 1-Wire
devices with the Pi’s GPIO port, make sure to enable the feature here.
Remote GPIO - allow access your Raspberry Pi’s GPIO pins from another
computer.
PERFORMANCE
The Performance tab of the Raspberry Pi Configuration tool provides
settings to increase the computational power of the Pi by overclocking its
processor or increasing the GPU memory. This can help eke out a little more
power from your Pi, but comes with risks.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
GPU Memory
Depending on your Raspberry Pi model, you will have 256MB, 512MB, or 1
GB of memory available to the system. This memory is split between the
system-on-chip’s general-purpose processor, known as the central
processing unit (CPU), and the graphics processor, known as the graphics
processing unit (GPU). By default, 128MB of memory is reserved for the GPU
on most models or 64MB on models with 256MB of memory; the remainder is
given over to the CPU.
Localisation
The Localisation tab provides a way for users in countries other than the UK
to configure the Pi for their needs. By default, Raspbian sets itself to use UK
English language settings, UTC time zone settings, and keyboard layout.
Users in other countries will find that certain keys on their keyboards don’t
type the right characters, particularly those using non QWERTY keyboard
layouts such as AZERTY or QWERTZ.
Locale
Clicking the Set Locale button in the Locale section provides a list of all the
languages, countries, and character sets available to the Pi. The list is
extensive and includes most common languages.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Language
Each language in the drop-down box is named in a particular way. The
letters at the beginning are the language code used by the operating
system, and the name in brackets is a friendly name representing the
language. Scroll through the list with your mouse, and then click on the
language you want the Pi to use as its default.
Country
The language setting is independent to the country setting; it’s possible to
choose a language like Gaelic with a country where it is rarely spoken, such
as Botswana. Use the mouse to choose the country in which you reside, and
then click on your selection to have the operating system tailor certain
settings, such as the way currency is displayed.
Character Set
Each language on a computer has one or more character sets associated with
it. This is the list of possible letters, numbers, and symbols that can be
displayed in that language. Most languages have more than one option here,
but the majority of users will need to select only one: UTF-8, which specifies
the Unicode Transformation Format 8-bit encoding—the most common and
compatible encoding standard.
Confirm your selections in these submenus with the OK button on the Locale
window, and then apply them from the main Raspberry Pi Configuration
window by clicking on its OK button.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
RESULTS:
CONCLUSION:
ASSESSMENT SCHEME:
Pre-Lab In Lab
Post Lab Test Record Total
Test performance
(3) (5) (15)
(2) (5)
Signature of Faculty
1 What is SSH?
2 What is PERFORMANCE Configuration?
3 List down the components of INTERFACES TAB
4 What is underscan?
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 5
AIM: Start Raspberry Pi and learn the basics of editor and Raspberry Pi
infrastructure
LEARNING OBJECTIVE: -
LEARNING OUTCOME:
TEXT EDITOR:
A text editor is a software that edits text. They are often used in making
system configuration files and program sketches. There are two kinds of text
editors you can use on a Raspberry Pi – desktop graphical editors and
command-line editors.
DESKTOP GRAPHICAL EDITORS
Desktop graphical editors are text editors that have a GUI (Graphical User
Interface). They are the ones you see on the start menu, but they can be
accessed via terminal as well. More importantly, the main difference
between graphical editors and the following kind is that they require both
mouse and keyboard to operate properly.
Some of the desktop graphical editors that you can use on a Raspberry Pi
are:
Text Editor
Thonny
Geany
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Mu
GVim
COMMAND-LINE EDITORS
Command-line editors, can only be accessed via the command line. These
make them more convenient for embedded applications. Because unlike
desktop graphical editors, command-line editors can be used with only a
keyboard. As an alternative to the point-and-click interface of graphical
editors, command-line editors use keyboard shortcuts.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
A list will pop up that displays all recommended software for the Raspberry
Pi. If you don’t see Mu, just enter Mu on the search bar on the bottom right of
the window.
Click install
After installation, you can start Mu by going to Menu > Programming > Mu.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
can also get Mu by using the CLI (Command Line Interface). On your
desktop, start the terminal by clicking the blackboard icon in the quick
launch toolbar. Alternatively, you can open it by pressing CTRL + ALT + T
In the terminal, enter sudo pip3 install mu-editor to install mu.
You can start Mu by simply entering mu-editor.
MU MODES
The current version of Mu offers four modes. You can change them
depending on what you intend to use Mu for. For now, we are going to use it
for Python programming.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Select the Python 3 mode and click OK.
WRITING CODE IN MU
Let us now write our first program. Copy the line below and save your file.
No need to add .py on the file name as Mu already assumes the file type
when you set the mode to Python 3.
print ("Hello World")
GNU NANO
GNU Nano is the native text editor of most Linux distros. It’s easy to use and
offers a myriad of keyboard shortcuts, which are useful when writing in a
computer’s CLI (Command Line Interface).
Nano comes with the Raspberry Pi OS as default, and you can start it by
simply entering nano.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
The best thing about Nano is that it is very convenient. You type text directly,
and the keyboard shortcuts are always visible. The carets on the shortcuts
stand for the CTRL button. So, for example, if you need help, just press CTRL
+ G. Same goes with the other shortcuts. If you want to cut a selected text,
simply type CTRL + K.
One thing to note about, though, is that cutting and pasting using Nano
shortcuts won’t let you get the text out of Nano to another software and vice
versa. To do that, you must press the Shift and Right Click button. This will
bring out the usual copy-cut-paste options you see on standard word editors.
Using these, you can get the text in and out of Nano.
wrote a sample text for demonstration and saved it using the shortcut
CTRL+O.
To quit nano you can use CTRL+X.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
RESULT:
CONCLUSION:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
ASSESSMENT SCHEME:
Signature of Faculty
1 What is editor?
2 List the Desktop based editor?
3 List the Command line based editor?
4 How IDLE differ from editor
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 6
AIM: Start Raspberry Pi and try various Linux commands in command
terminal window, Such as: ls, cd, touch, mv, rm, man, mkdir,
rmdir, tar, gzip, cat, more, less, ps, sudo, cron, chown, chgrp,
ping.
LEARNING OBJECTIVE: -
To understand the usages of different Linux command.
LEARNING OUTCOME:
Linux Command:
1. pwd: It prints current working directory
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
3. mkdir <directory>: It creates an empty directory
7. ls: It lists the content & ls -l: It lists the content in long listing
format
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
8. ls -al: It lists all sub content in long listing format
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
11.cat - It concatenates the files
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
14.zip -p password filename.zip *.txt : It password protect the file
zip -e filename.zip *.txt
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
16.gzip : It compresses the file
gzip : It compresses the file
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
19. ping 192.168.2.200
Chgrp
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Chown
LEGEND
U = User
G = Group
W = World
r = Read
w = write
x = execute
RESULTS:
CONCLUSION:
ASSESSMENT SCHEME:
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
LIST OF PRE-LAB QUESTIONS/MODEL ANSWERS:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 7
AIM: Write a program to Read your name and print Hello message with
name in python.
LEARNING OBJECTIVE: -
Understand how to implement python program.
LEARNING OUTCOME:
Students will able to learn python programming concept.
Students will able to execute python program in raspberry pi IDLE.
SOFTWARE/HARDWARE REQUIRED:
SN Name of Software /Hardware Tool Specification
1 Functional Raspberry pi Model B
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
2. next step is to install the Python package to our Raspberry Pi. For this
guide, we will be focusing on Python 3 as it is the currently supported
version.
Run the following command to install Python to your system
or
To access the Python REPL (where you can enter Python commands
just like the command line) enter python or python3 depending on
which version you want to use:
python
or
python3
Enter this code into Nano, then press Ctrl-X and Y to exit
and save the file:
PROGRAMME:
#!/usr/bin/python
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
All Python program files will need to be saved with a “.py” extension. You
can write the program in any text editor such as Notepad or Notepad++, just
be sure to save the file with a “.py” extension.
chmod +x file-name.py
./file-name.py
Development Environments
The simplest way to create Python programs is to write your code in a text
editor, save it, and then run it from the terminal with the command python
<FILE>.py. You are welcome to continue working through this guide using a
text editor and command line.
Some users prefer to use an integrated development environment
(IDE) when developing code. IDEs offer a number of benefits including
syntax highlighting, code completion, one-click running, debugging hints,
etc. However, most IDEs require a graphical interface to use, which means
you will need to be on the full desktop version of Raspbian.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
IDLE
IDLE is the default Python editor that has been available on Raspbian for
many generations.
Open IDLE by selecting the Raspberry Pi logo in the top-left, and click
Programming > Python 3 (IDLE). You should be presented with the Python
interactive interpreter.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Click File > Save As... to save your code to a Python file (don't forget the
.py suffix!). Click Run > Run Module to run your program
Geany
Geany is a great, beginner-friendly IDE that works with many different
languages. However, it does not start up with a Python interactive
interpreter. You can open Geany up by click on the Raspberry Pi logo in the
top-left, and selecting Programming > Geany. Write your code in the file
editor pane.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Save your code, making sure the filename ends with .py.
By default, Geany will attempt to open a new window to show the output of
your code, which may or may not work on the Raspberry Pi. We can change
it to run in the Terminal pane. Click Edit > Preferences. Select the Terminal
tab and click to enable Execute programs in the VTE. Press enter to save and
close the Preferences window
Click Build > Execute (or click the paper airplane icon) to run your code.
You should see the output of your program appear in the Terminal pane of
Geany
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
Thonny
Finally, Thonny is another great, easy-to-use IDE that comes pre-loaded on
Raspbian. It focuses on Python and has an interactive environment when you
load the program. Start Thonny by clicking on the Raspberry Pi icon
followed by Programming > Thonny Python IDE.
Write your program in the top pane, click File > Save as... to save it, and
click Run > Run current script to execute the program. Output will appear in
the bottom interpreter pane.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
RESULT:
CONCLUSION:
ASSESSMENT SCHEME:
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 8
AIM: Write a program to Read two numbers and perform all arithmetic
operations in python.
LEARNING OBJECTIVE: -
Understand how to implement python program.
LEARNING OUTCOME:
Students will able to learn python programming concept of arithmetic
operations.
Students will able to execute python program in raspberry pi IDLE
SOFTWARE/HARDWARE REQUIRED:
SN Name of Software/ Hardware Tool Specification
1 Functional Raspberry pi Model B
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
which version you want to use:
python
or
python3
Enter Ctrl-D to exit the REPL.
3. Writing A Python Program
sudo nano arithematic.py
PROGRAMME:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
4. Running A Python Program
To run the program without making it executable, navigate to the
location where you saved your file, and enter this at the command
prompt:
python arithematic.py
RESULTS:
.
CONCLUSION:
ASSESSMENT SCHEME:
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 9
AIM: Write a program to Read two numbers and perform all arithmetic
operations in python.
LEARNING OBJECTIVE: -
Understand how to implement python program.
LEARNING OUTCOME:
Students will able to learn python programming concept of count &
length.
Students will able to execute python program in raspberry pi IDLE
SOFTWARE/HARDWARE REQUIRED:
SN Name of Software/ Hardware Tool Specification
1 Functional Raspberry pi Model B
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
which version you want to use:
python
or
python3
Enter Ctrl-D to exit the REPL.
3. Writing A Python Program
sudo nano count.py
PROGRAMME:
# initializing string
test_string = "My Branch is AIDS"
# printing original string
print ("The original string is: " + test_string)
# to count words in string
res = test_string.count(" ")+1
# printing result
print("The number of words in string are : " + str(res))
print("The number of Character in string are : ",
len(test_string))
RESULTS:
.
CONCLUSION:
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
ASSESSMENT SCHEME:
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
EXPERIMENT NO. 10
AIM: Write a program to calculate Area of a given shape (rectangle,
triangle and circle) in python.
LEARNING OBJECTIVE: -
Understand how to implement python program.
LEARNING OUTCOME:
Students will able to learn python programming concept.
Students will able to execute python program in raspberry pi IDLE
SOFTWARE/HARDWARE REQUIRED:
SN Name of Software/ Hardware Tool Specification
1 Functional Raspberry pi Model B
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
or
python3
Enter Ctrl-D to exit the REPL.
7. Writing A Python Program
sudo nano area.py
PROGRAMME:
Area of Rectangle=l*b
Perimeter of Rectangle=2*(l+b)
Area of Circule=PI*r*r(PI=3.14)
Circum of a Circule=2*PI*r
'''
len=int(input("Enter the Lenth of rectangle:"))
bre=int(input("Enter the Breadth of rectangle:"))
r=int(input("Enter the Redius of Circle:"))
area1=len*bre
perimeter=2*(len+bre)
area2=3.14*r*r
circum=2*3.14*r
print("Area of Rectangle =",area1)
print("Perimeter of Rectangle =",perimeter)
print("Area of Circle =",area2)
print("Circum of Circle =",circum)
RESULTS:
.
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23
CONCLUSION:
ASSESSMENT SCHEME:
Signature of Faculty
Department of Artificial Intelligence & Data Science PRPCEM, C-Skill Lab-II (4AD09)-2022-23