0% found this document useful (0 votes)
3 views18 pages

Introduction To Raspberry Pi 2

2nd part - Introduction to Raspberry Pi

Uploaded by

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

Introduction To Raspberry Pi 2

2nd part - Introduction to Raspberry Pi

Uploaded by

hyydd
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Introduction to Raspberry Pi

(Part 2)

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Linux Shell
• In order to interact with Operating System or Hardware, we need to
use the “Shell”
• Shell is a program that takes commands from keyboard and tell the
Operating System to perform them
• Olden times: There was no GUI so the shell was the only interface
available

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Linux Shell

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Basic Linux Commands For Raspberry Pi
• GENERAL COMMANDS
• apt-get update: Synchronizes the list of packages on your system to the list in the repositories. Use it before
installing new packages to make sure you are installing the latest version.
• apt-get upgrade: Upgrades all of the software packages you have installed.
• clear: Clears previously run commands and text from the terminal screen.
• date: Prints the current date.
• find / -name [Link]: Searches the whole system for the file [Link] and outputs a list of all
directories that contain the file.
• nano [Link]: Opens the file [Link] in the Linux text editor Nano.
• poweroff: To shutdown immediately.
• raspi-config: Opens the configuration settings menu.
• reboot: To reboot immediately.
• shutdown -h now: To shutdown immediately.
• shutdown -h 01:22: To shutdown at 1:22 AM.
• startx: Opens the GUI (Graphical User Interface).
Copyright © Sophicautomation [Link]. All rights reserved. |
by Theram Singh
Basic Linux Commands For Raspberry Pi
• FILE AND DIRECTORY COMMANDS
• cat [Link]: Displays the contents of the file [Link].
• cd /abc/xyz: Changes the current directory to the /abc/xyz directory.
• cp XXX: Copies the file or directory XXX and pastes it to a specified location; i.e. cp [Link] /home/pi/office/ copies
[Link] in the current directory and pastes it into the /home/pi/ directory. If the file is not in the current directory, add the
path of the file’s location (i.e. cp /home/pi/documents/[Link] /home/pi/office/ copies the file from the documents
directory to the office directory).
• ls -l: Lists files in the current directory, along with file size, date modified, and permissions.
• mkdir example_directory: Creates a new directory named example_directory inside the current directory.
• mv XXX: Moves the file or directory named XXX to a specified location. For example, mv [Link] /home/pi/office/ moves
[Link] in the current directory to the /home/pi/office directory. If the file is not in the current directory, add the path of
the file’s location (i.e. cp /home/pi/documents/[Link] /home/pi/office/ moves the file from the documents directory to
the office directory). This command can also be used to rename files (but only within the same directory). For example, mv
[Link] [Link] renames [Link] to [Link], and keeps it in the same directory.
• rm [Link]: Deletes the file [Link].
• rmdir example_directory: Deletes the directory example_directory (only if it is empty).
• scp user@[Link]:/some/path/[Link]: Copies a file over SSH. Can be used to download a file from a PC to the Raspberry
Pi. user@[Link] is the username and local IP address of the PC, and /some/path/[Link] is the path and file name of the file on
the PC.
• touch [Link]: Creates a new, empty file named [Link] in the current directory.
Copyright © Sophicautomation [Link]. All rights reserved. |
by Theram Singh
Basic Linux Commands For Raspberry Pi
• SYSTEM INFORMATION COMMANDS
• cat /proc/meminfo: Shows details about your memory.
• cat /proc/partitions: Shows the size and number of partitions on your SD card or hard drive.
• cat /proc/version: Shows you which version of the Raspberry Pi you are using.
• df -h: Shows information about the available disk space.
• df /: Shows how much free disk space is available.
• dpkg – –get–selections | grep XXX: Shows all of the installed packages that are related to XXX.
• dpkg – –get–selections: Shows all of your installed packages.
• free: Shows how much free memory is available.
• hostname -I: Shows the IP address of your Raspberry Pi.
• lsusb: Lists USB hardware connected to your Raspberry Pi.
• UP key: Pressing the UP key will print the last command entered into the command prompt. This is a
quick way to repeat previous commands or make corrections to commands.
• vcgencmd measure_temp: Shows the temperature of the CPU.
• vcgencmd get_mem arm && vcgencmd get_mem gpu: Shows the memory split between the CPU and GPU.
Copyright © Sophicautomation [Link]. All rights reserved. |
by Theram Singh
Basic Linux Commands For Raspberry Pi
• NETWORKING AND INTERNET COMMANDS
• ifconfig: To check the status of the wireless connection you are using (to see if wlan0 has
acquired an IP address).
• iwconfig: To check which network the wireless adapter is using.
• iwlist wlan0 scan: Prints a list of the currently available wireless networks.
• iwlist wlan0 scan | grep ESSID: Use grep along with the name of a field to list only the
fields you need (for example to just list the ESSIDs).
• nmap: Scans your network and lists connected devices, port number, protocol, state
(open or closed) operating system, MAC addresses, and other information.
• ping: Tests connectivity between two devices connected on a network. For example, ping
[Link] will send a packet to the device at IP [Link] and wait for a response. It also
works with website addresses.
• wget [Link] Downloads the file [Link] from the
web and saves it to the current directory.
Copyright © Sophicautomation [Link]. All rights reserved. |
by Theram Singh
REFER TO LAB SHEET
• Practical 1

After Practical 1 then do this small task USING SHELL ONLY


-Go to desktop, create a new txt file called [Link]
-Then edit it using nano and put in “THIS IS A NEWFILE” and save it

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Arduino vs Raspberry Pi

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Raspberry Pi GPIO PINS
-There are 40 pin in GPIO Header in Raspberry Pi
-These pins allow us to provide an interface between the Pi and the outside world
-UART=Serial Communication
-GND=Ground
-SPI=Serial Peripheral Interface
-I2C=Inter-integrated Circuit
-GPIO=General Purpose Input Output
-Reserved=Do not Connect(Pins cant
be Used)

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Type of sensors & components
Jumper Wires
• Short wire used to electrically connect two or more position
within a connection.
• Types
1) Male to Male
2) Male to Female
3) Female to Female

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Type of sensors & components

Breadboard
• To prototype circuits without the hassle of soldering.

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Type of sensors & components
• LED (Light Emitting Diode)
• Light when a small emits current is passed

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Type of sensors & components

• Resistors
• Restrict the amount of current that can flow through a
circuit

• Note:
• Easy to grab the wrong value.

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Type of sensors & components

Sound Sensor Module

It uses a microphone which


supplies the input to an amplifier,
peak detector and buffer. When
the sensor detects a sound, it
processes an output signal voltage
which is sent to a microcontroller
then performs necessary
processing

The sound sensor module provides an easy way to detect sound and is
generally used for detecting sound intensity. This module can be used for
security, switch, and monitoring applications. Its accuracy can be easily
adjusted for the convenience of usage [Link]. All rights reserved. |
Copyright © Sophicautomation
by Theram Singh
Type of sensors & components
Sound Sensor Module
Specification

• Operating voltage 3.3V-5V


• Output model: digital switch outputs (0 and
1, high or low level)
• With a mounting screw hole
• PCB size: 3.4cm * 1.6cm

Pin Configuration

1. VCC: 3.3V-5V DC
2. GND: ground
3. DO: digital output See PRACTICAL 5 for
4. AO: analog output example

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
Type of sensors & components
IR Obstacle Sensor

The device consists of an Infrared Transmitter, an Infrared


Detector, and support circuitry. It only requires three
connections. When it detects an obstacle within range it will send
an output.

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh
IR Obstacle Detection Module Pin Outs

See Practical 6 for


Example

Copyright © Sophicautomation [Link]. All rights reserved. |


by Theram Singh

You might also like