Professional Documents
Culture Documents
Experiment No: - 1
Aim:
Starting Raspbian OS, familiarizing with raspberry pi components and Interface, connecting
to ethernet, monitor, USB.
Abstract:
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.
Required Components:
1. Hardware:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
Micro SD USB card reader 1
A Monitor that supports HDMI 1
An HDMI cable 1
An Ethernet cable 1
2. Software:
Raspbian, installed via NOOBS
1. USB ports - these are used to connect a mouse and keyboard. You can also connect
other components, such as a USB drive.
2. SD card slot - you can slot the SD card in here. This is where the operating system
software and your files are stored.
3. Ethernet port - this is used to connect the Raspberry Pi to a network with a cable.
The Raspberry Pi can also connect to a network via wireless LAN.
4. Audio jack - you can connect headphones or speakers here.
5. HDMI port- this is where you connect the monitor (or projector) that you are using to
display the output from the Raspberry Pi. If your monitor has speakers, you can
also use them to hear sound.
6. Micro USB power connector - this is where you connect a power supply. You
should always do this last, after you have connected all your other components.
7. GPIO ports -these allow you to connect electronic components such as LEDs and
buttons to the Raspberry Pi.
Procedure:
1. Insert the SD card into your SD card reader. Note the drive letter assigned to the SD
card. You can see the drive letter in the right hand column of Windows Explorer.
2. Run the Win32DiskImager utility from desktop or menu.
3. Select the image file and click on Write Button.
7. Connect the Pi to the internet via Ethernet, use an Ethernet cable to connect the
Raspberry Pi.
8. Sound will come if it has speakers or connect headphones or speakers to the Audio
jack if necessary
9. Plug the power supply into a socket and connect it to the micro USB power port.
10. Red light will indicate Power On and Green Will Indicate the booting of the
Raspberry Pi. The Pi will boot up into a graphical desktop
b. System: In this tab you can change basic system settings of your Pi.
c. Interfaces: You can link devices and components to the Raspberry Pi using a lot of
different types of connections. The Interfaces tab is where you turn these different
connections on or off, so that the Pi recognizes that you’ve linked something to it
via a particular type of connection.
d. Performance: If you need to do so for a particular project you want to work on,
you can change the performance settings of your Pi in this tab.
e. Localisation
12. After starting with Raspberry Pi for the first time, the Welcome to Raspberry Pi
application will pop up and it will guide through the initial setup.
13. Click Next to start the setup.
14. Set respective Country, Language, and Time zone, then click Next again.
16. Connect to your Wi-Fi network by selecting its name, entering the password, and
clicking next
17. Click next, let the wizard check for updates to Raspbian OS and install.
Linux commands
File system
1. ls: The ls command lists the content of the current directory
2. cd: Using cd changes the current directory to the one specified. You can use relative
(i.e. cd directoryA) or absolute (i.e. cd /home/pi/directoryA) paths.
3. pwd: The pwd command displays the name of the present working directory entering
pwd willoutput something like /home/pi.
4. mkdir: You can use mkdir to create a new directory, e.g. mkdir newDir would create
the directory newDir in the present working directory.
5. rmdir: To remove empty directories, use rmdir. So, for example, rmdir oldDir will
remove the directory oldDir only if it is empty.
6. rm: The command rm removes the specified file (or recursively from a directory
when used with -r).
7. cp: Using cp makes a copy of a file and places it at the specified.
8. ssh: SSH denotes the secure shell. Connect to another computer using an encrypted
network connection.
9. scp: The scp command copies a file from one computer to another using ssh.
10. sudo: The sudo command enables you to run a command as a superuser, or another
user. Use sudo -s for a superuser shell. For more details see Root user / sudo
11. dd: The dd command copies a file converting the file as specified. It is often used to
copy an entire disk to a single file or back again.
12. df: Use df to display the disk space available and used on the mounted filesystems.
Use df -h to see the output in a human-readable format using M for MBs rather than
showing number of bytes.
13. unzip: The unzip command extracts the files from a compressed zip file.
14. wget: Download a file from the web directly to the computer with wget. So wget
https://www.raspberrypi.org/documentation/linux/usage/commands.mdwill download
this file to your computer as commands.md
15. grep: Use grep to search inside files for certain search patterns.
16. awk: awk is a programming language useful for searching and manipulating text files.
17. find: The find command searches a directory and subdirectories for files matching
certain patterns.
Networking
1. ping: The ping utility is usually used to check if communication can be made with
another host. It can be used with default settings by just specifying a hostname (e.g.,
ping raspberrypi.org) or an IP address (e.g., ping 8.8.8.8).
2. nmap: nmap is a network exploration and scanning tool. It can return port and OS
information about a host or a range of hosts. Running just nmap will display the
options available as well as example usage.
3. hostname: The hostname command displays the current hostname of the system.
4. ifconfig: Use ifconfig to display the network configuration details for the interfaces
on the current system when run without any arguments (i.e., ifconfig). By supplying
the command with the name of an interface (e.g., eth0 or lo) you can then alter the
configuration. Check the manual page for more details.
Conclusion:
Thus Raspbian OS was installed, Raspberry Pi Components and Interface were studied and
implemented, Raspberry was also Connected to ethernet, Monitor, USB.
Experiment No: 2
Aim:
Displaying different LED patterns with Raspberry Pi.
Abstract:
This project deals with displaying different LED patterns using module MAX7219 that uses
SPI interface.
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
MAX7219 1
Discover Board 1
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
Step 7: Type and run the program and see the output on 7 segment display board.
Conclusion:
Thus we have studied and displayed different LED patterns with Raspberry Pi.
Experiment No: 3
Aim:
Displaying Time over 4-Digit 7-Segment Display using Raspberry Pi.
Abstract:
This project deals with Interfacing of 4-digit Seven Segment Display Module with Raspberry
Pi and display Time over it. Only two data wires are required for I2C – a data line (SDA) and
a clock line (SCL).
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
4-Digit 7-Segment Display Module 1
Discover Board 1
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
Step 6: Type and run the program and see the output on 4-Digit 7 segment display.
Conclusion:
Thus, we have studied and displayed Time over 4-Digit 7-Segment Display using Raspberry
Pi.
Experiment No: 4
Aim:
Raspberry Pi Based Oscilloscope
Abstract:
The oscilloscope is an electronic test instrument that allows the visualization and observation
of varying signal voltages, usually as a two dimensional plot with one or more signals plotted
against time. Today’s project will seek to replicate the signal visualization capabilities of the
oscilloscope using the Raspberry Pi and an analog to digital converter module.
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
ADS1115ADC 1
Discover Board 1
Analog Input As per availability 1
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
Step 7: Type and run the program and see the output on terminal.
Conclusion:
Thus Raspberry Pi Based Oscilloscope has been studied and implemented
Experiment No: - 5
Aim:
Control Raspberry Pi via Telegram Messenger.
Abstract:
This project deals with how to automatically run scripts for text commands via Telegram
after the installation on the Raspberry was covered in the previous tutorial. This allows you to,
for example, easily query the status of your Pi’s on the go or simply perform actions remotely
via your messenger.
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
Discover Board 1
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
Procedure to install “Telegram App” on your smart phone and preparing “Raspberry Pi” to control
Lamp, Fan, etc. connected across relays on Discover Development Board.
Step 5: Installing Telegram App on your smart phone (Only for Android smartphone,
WiFi or mobile data should be ON)
Open “Playstore” app in your android mobile. Search for “Telegram” in search option. Install
the “Telegram” app by clicking on install button highlighted in green colour.
Open the telegram app in your mobile. Click on “START MESSAGING” button. Enter your
“mobile number” to register with telegram service.
Now, go in “Search option” in your telegram app and search for the name “BotFather”
You will see screen as shown below. Now, “botfather” is asking your you to choose
the name for your bot.
Now, “botfather” is asking username for your bot. I have reply with username
“discoverBot”. You use your own “username”.
Thus, you will see reply from “botfather” as shown below.
Same way you have to choose name for your “Bot”. Here I have use “discoverBot”.
Thus for security reason, I have hidden my token key as shown above.
And note down your token key somewhere in text editor or book so that you can copy
it to your python script.
Step 7: Program raspberry pi with Telegram TOKEN key to control devices connected
across relays.
Now, go to your Raspberry pi Desktop Program folder.
Now, you have created python file with name “main.py”.Right click on it and open
with python idle 2 as shown below in picture.
Conclusion:
Thus, we have studied and implemented how to Control Raspberry Pi via Telegram
Messenger.
Experiment No: 6
Aim:
Fingerprint Sensor interfacing with Raspberry Pi.
Abstract:
Fingerprint Sensor is now become very common to verify the identity of a person for various
purposes. In present time we can see fingerprint-based systems everywhere in our daily life
like for attendance in offices, employee verification in banks, for cash withdrawal or deposits
in ATMs, for identity verification in government offices etc. We have already interfaced it
with Arduino, today we are going to interface Fingerprint Sensor with Raspberry Pi. Using
this Raspberry Pi Fingerprint System, we can enrol new fingerprints in the system and can
delete the already fed fingerprints.
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
Discover Board 1
USB to TTL converter 1
Fingerprint Module 1
16x2 LCD 1
The Raspberry Pi has two pins (pin 8 / GPIO14 and pin 10 / GPIO 15), but they work with
3.3V. Since there are different fingerprint sensors, which do not all work with 3.3V, a USB
UART converter is recommended.
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
Step 7: Type and run the program and see the output on terminal and LCD module.
Conclusion:
Thus, we have studied and interfaced Fingerprint Sensor with Raspberry Pi.
Experiment No: 7
Aim:
Visitor Monitoring with Raspberry Pi and Pi camera
Abstract:
This project deals with interfacing Pi camera with Raspberry Pi to capture the image of every
visitor which has entered through the Gate or door. whenever any person is arrived at the
Gate, he/she has to press a button to open the Gate, and as soon as he/she press the button,
his/her picture will be captured and saved in the system with the Date and time of the entry.
This can be very useful for security and surveillance purpose. This system is useful in offices
or factories where visitor entry record is need to be maintained.
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
Discover Board 1
Pi Camera With CSI Connector 1
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
After it, user needs to enable Raspberry Pi Camera by using Raspberry Pi Software
Configuration Tool (raspi-config):
$ sudo raspi-config
Then select Enable camera and Enable it.
Then user needs to reboot Raspberry Pi, by issuing sudo reboot, so that new setting
can take. Now your Pi camera is ready to use.
$ sudo reboot
Step 6: Create a new file with an extension .py
Step 8: Type and run the program and see the output on terminal.
Conclusion:
Thus, we have studied and implemented Visitor Monitoring with Raspberry Pi and Pi camera.
Experiment No: 8
Aim:
RFID interfacing with Raspberry Pi.
Abstract:
Radio-frequency identification (RFID) uses electromagnetic fields to automatically identify,
and track tags attached to objects. The tags contain electronically stored information. The
RFID technology enables remote and automated gathering and sending of information
between RFID tags or transponders and readers using a wireless link. Using RFID, the
exchange of data between tags and readers is rapid, automatic and does not require direct
contact or line of sight. An RFID system consists of a reader device and a transponder. A
transponder or tag has a unique serial number which is identified by the reader. The RFID
module can be interfaced with the board using the same serial reception program used for
testing the UART. When a Card (tag) is brought near the RFID reader, it tries to
communicate with the tag, receives the data and decodes it. Finally, it sends the data over the
TX line. The UART module in MCU receives the data and thus used for further applications.
RFID tag is applied to products, individuals or animals to identify and track them through this
number. The identification code of the tag is also displayed on a 16x2 LCD. By employing
RFID, much secured entry systems can be developed without incurring huge costs.
Required Components:
Particular Quantity
Raspberry Pi3 1
Power Supply 12V/2Amp 1
USB Keyboard 1
USB Mouse 1
Micro SD card 1
Discover Board 1
RFID Reader 1
16x2 LCD 1
The Raspberry Pi has two pins (pin 8 / GPIO14 and pin 10 / GPIO 15), but they work with
3.3V. Since there are different RFID Module, which do not all work with 3.3V, a USB
UART convertor is needed.
Interfacing Diagram:
Procedure:
Step 1: Connection of Discover Development Board
Let’s begin by first opening the raspi-config tool, we can do this by opening terminal and
running the following command:
sudo raspi-config
This tool will load up a screen showing a variety of different options. If you want a
more in-depth look into these options you can check out our raspi-config guide that’s
located in the Getting Started section of this book.
On here use the arrow keys to select “5 Interfacing Options”. Once you have this
option selected, press Enter.
Now on this next screen you want to again use your arrow keys to select “P4 SPI“,
again press Enter to select the option once it is highlighted.
You will now be asked if you want to enable the SPI Interface, select Yes with
your arrow keys and press Enter to proceed. You will need to wait a little bit while
the raspi-config tool does its thing in enabling SPI.
Once the SPI interface has been successfully enabled by the raspi-config tool you
should see the following text appear on the screen, “The SPI interface is enabled“.
Before the SPI Interface is fully enabled we will first have to restart the Raspberry Pi.
To do this first get back to the terminal by pressing Enter and then ESC.
Type the following Linux command into the terminal on your Raspberry Pi to restart
your Raspberry Pi.
sudo reboot
Step 8: Type and run the program and follow the steps shown on terminal window,
show RFID card see the output on terminal and LCD module.
Conclusion:
Thus, we have studied and displayed RFID interfaced with Raspberry Pi.