- HOME - RPi PROJECTS - RADIO RPi PROJECTS - GNU RADIO - SATELLITES - WEATHER SATELLITES - RADIO ASTRONOMY -


WA9ONY
Raspberry Pi Computer Projects

                       

This is a collect of Raspberry Pi (RPi) computer projects that David Haworth, WA9ONY has completed in order to learn how to use the RPi. These projects range from building a RPi P3 Model B system (Project 1) to the simple task of setting the RPi date and time (Project 26). There is a separate web page, Amateur (Ham) radio RPi projects, that demonstrates how to use the RPi computer in amateur (Ham) radio and in electronics applications.

Raspberry Pi Computers

There are several generations of Raspberry Pi (RPi) computers.

RPis are: RPis computer system is:

Raspberry Pi Software

The Raspberry Pi official operating system software is Raspbian. But, other operating system software can be used on the RPi.

The RPi Raspbian includes many programs as part of the standard install process using the Element14 NOOBS 16 GB SD card.

RPi has a large online repository of software ready to be automatically downloaded and installed on the RPi.

Raspberry Pi Popularity

Over 10 million RPis have been sold to students, hobbyist and used in commercial products. This results in a very large installed base of RPi users, applications, hardware, softwares and infrastructure to learning about RPi hardware and software.



RPi Computer Projects Index

These projects demonstrate how to assemble a RPi computer system and how to use the Raspbian operating system and its software.


Project 1: Build RPi Computer

Learn what is needed. Gather components and build the Raspberry Pi P3 Model B computer.
Setup the operating system preferences.


Project 2: Identify the Initial Programs in the RPi PIXEL GUI

This goal is to identify the standard programs in the GUI that are installed by Element14 NOOBS micro-SD card. Raspbian is a Debian-based computer operating system for Raspberry Pi. Raspbian uses PIXEL, Pi Improved Xwindows Environment, Lightweight as its main desktop environment.

Click on the below links to learn more about these programs at Wikipedia.


Project 3: Using USB Memory Devices

This goal is to use an USB memory devices with the RPi to move files to/from the RPi. An USB memory is used as a backup to the user files on the RPi micro-SD card.


Project 4: Update RPi Software

An Internet connect is required to update the RPi software. The update process can take a long time, greater than one hour. The installation process might ask you questions, therefore check it so often.


Project 5: Download The MagPi Magazine And Read It Off-Line

The MagPi is the official magazine of the Raspberry Pi Foundation. It is available as a free download. Also, learn how to save PDFs from the Internet and view them on the RPi.

You will need an Internet connection.

View the download magazine PDF.


Project 6: Create an USB Memory Library

Create a library on a USB memory device for PDF files from the Internet. For example, PDF issues of The MagPi magazine are stored in the library. The benefit of having the library on a USB memory device is not taking up storage space on the RPi SD card. Also, you can easy move the library on USB memory device to other computers.

You will need an Internet connection and USB memory device.

Next copy The MagPi issue 55 that was download in Project 5 to the Library.

Add the PDF version of this web page to the Library.


Project 7: Save Internet Web Pages (HTML), Audio (MPG3), Documents (PDF) and Text (TXT) files on the RPi

To save web pages to the RPi use the wget command in the Terminal window.

Save the web page at http://www.stargazing.net/david/rpi/ to the Download directory. In the URL the last part is rpi which is a directory (folder). The web server will send the file index.html when no file name is in the URL.

Save the PDF file (Raspberry%20Pi%20Hints.pdf) at http://www.stargazing.net/david/rpi/ to the Downloads directory. Notice the %20 in the file name mean space character.

Save the MP3 audio File from ARRL 5 WPM Code Practice Archive to the Downloads directory. Use wget to download the 5 WPM Code Practice Archive audio file.

Save the MP3 text File from ARRL 5 WPM Code Practice Archive to the Downloads directory. Use wget to download the 5 WPM Code Practice Archive text file.

Using what you have learn in the previous projects save these file to the USB memory device Library folder.


Project 8: Back Up the RPi Micro-SD Card

It is important to be able to back up the RPi and restore all the files. There are many ways to doe this. Below is the procedure to create a copy of the micro-SD card that is in your RPi.

First, you will need as micro-SD card equal to or larger than the micro-SD size in your RPi.
Secondly, you need a micro-SD to USB adapter to make at copy with the micro-SD in the USB port.


Project 9: Save a Web Page as a PDF File And View It Off-Line

When a web page has useful information that you want to refer to when you have no Internet access you can save the web page as a PDF file to your RPi for off line viewing.

The web page of Wikipedia Raspberry Pi is saved as a PDF to the RPi.

This example uses RPi 3 Model B with Google Chromium web browser. This was installed by the Element14 NOOBS 16 G SD card.


Project 10: Download YouTube Video and Play It Off-Line

YouTube videos are are great source of information. Below a way to download a YouTube video and view it off-line.

This example uses RPi 3 Model B with Google Chromium web browser. This was installed by the Element14 NOOBS (New Out Of the Box Software) 16 G SD card.

To play the video use omxplayer in the Terminal window. The omxplayer is a command line program.

A HDMI TV that supports audio is used as the monitor for the RPi. To use the audio output jack on the RPi board use the command. Use the command man omxplayer for more details on the omxplayer.

Using what you have learn in the project 6 to save the video file to the USB memory device Library folder.


Project 11: RPi Raspbian Desktop GUI and Command Line Interfaces

The PRi computer can run different operating systemsi. Raspbian is the official operating system. Raspbian is a Debiab distribution of the Linux. Linux is based on UNIX.

Raspbian has two primary user interfaces: LXDE (Lightweight X11 Desktop Environment) desktop GUI (graphical user interface) and the CLI (command line interface).

In 2016 Raspbian LXDE GUI was improved with PIXEL (Pi Improved Xwindows Environment, Lightweight).

The RPi Raspbian can be configured to power-on into the LXDE PIXEL desktop GUI or the CLI.

To access the CLI in the PIXEL Desktop GUI open a Terminal window with the Terminal icon in the top menu bar.

If the PIXEL Desktop is not running you start PIXEL Desktop GUI by entering the command startx in the CLI.


Project 12: RPi Username and Password

During the first time power-on the software will create the username pi with password raspberry.

The default power-on auto login is to login in as 'pi' user. This can be changed by:

Another user name is super user. Use the sudo (super user do) command in front of another command to run the command with admin privileges.


Project 13: RPi Raspbian Files

A computer file contains date/information, executable program code, etc.

In Raspbian the file name is case sensitive. There for the file example/ and Example are two different files. It is good practice to use file extensions to tell the RPi what is file type and as a result what program should be used to open it.

For example, file example.txt is a text file and Raspbian would use Leafpad to open it when double clicking on the example.txt file in File Manager.

Another example, file example.pdf is a Portable Document Format file and Raspbian would use xpdf program to open it when double clicking on the example.pdf file in File Manager.

It is a good computer practice to use file extension on the files you create.

List of Raspbian file extensions and the Desktop default programs that will open them.


Project 14: RPi Raspbian Directories/Folders

Directories (also called folders) are a way to organize files and directories.

Directories/folders contain files and other Directories/folders. The Directories/folders are organized in hierarchal directory tree. The top directory is called root and is represented by "/" Character. One of the directories in the root directory is the home directory. The home directory contains the directories and files of users. In a typical PRi system of on one user there is only the pi directory for the username pi. In the pi directory is where all the files create by the user pi should be saved. The user can create directories and sub directories in pi directory to organize files.

In the PIXEL Desktop GUI use File Manage to view, move, create, rename and delete directories and files. File Manager is started by clicking on the File Manager icon in the top menu bar.

In the CLI text commands are used view, move, create, rename and delete directories and files.


Project 15: RPi Raspbian Keyboard Short Cuts


Project 16: Install GIMP, GNU Image Manipulation Program

GIMP ( GNU Image Manipulation Program) is a free raster graphics editor that is in the RPi online repository.

Internet connection is required and commands in the CLI are used.

To install GIMP.

Install GIMP help.

To uninstall GIMP and GIMP help.

Using GIMP F1 help.

GIMP website.

GIMP resources:


Project 17: Install YouTube Video Download Program

This CLI program downloads YouTube videos to the RPi.

To install youtube-dl program.

To uninstall youtube-dl.

Play saved YouTube video file in Downloads directory.

The youtube-dl saves the video file with the same name as the YouTube title.


Project 18: Bash Shell Command Line Interface (CLI)

The RPi default shell is the bash shell. The bash shell is used at the CLI (command line interface) to work with the RPi Linux kernel and other programs on the RPi.

There are somethings that can only be done using the CLI (command line interface). For example, installing programs on the RPi as shown in project 16 installing GIMP.

The CLI is active when the PIXEL Desktop GUI is not being used and the CLI is used in the PIXEL Desktop GUI Terminal program. When Terminal is used there are cut and past features using the mouse.

Using the CLI.

Mouse operation:

Ctrl key operation

Keyboard arrow keys operation

Other special operations.

Help and manual information

CLI text editors

CLI display a text file

Clear the CLI display or clear Terminal window.

MagPi magazine is a free download.

List of Linux commands from the MUFIC_IT_2008 Group.


Project 19: Create Python 3 Hello World Program

Python 3 is a programming language that is part of the standard install of the Raspbian overtiring system.

The below steps show how to create a Python 3 program to print Hello World.

Run the Python 3 hello_world.py program in the CLI.

For help on python3 in CLI enter.

Start the Python 3 hello_world.py program in PIXEL Desktop File Manager.

The file extension .py tells the RPi to use Python 3 to open the hello_world.py file.

To learn Python

If you have never programmed, check out


Project 20: Monitor Display Resolution

Use a command in the CLI to show the monitor display resolution.

The HDMI monitor needs to be on before turning the RPi in order to use the HDMI fill display resolution. Other wise, the HDMI resolution will be at 4:3 @ 640x480.


Project 21: Memory Free

There are several types of memory in the RPi. The computer board RAM memory, micro-SD card memory and USB flash memory devices.

Different version of RPi boards have different sized of RAM. A summary table of the different board RAM sizes is at Raspberry Pi


Project 22: Stop or Kill an Unresponsive Program

Sometime a program can be unresponsive and you can not control it, stop it or close it.

To stop or kill a unresponsive program.


Project 23: Show RPi CPU Temperature

The RPi monitors the CPU temperature. When the temperature rises high a thermometer is shown on PIXEL Desktop in the upper right corner.

When my RPi CPU temperature is 80.6 C the thermometer is shown on the PIXEL Desktop. Use heat sinks on the CPU and memory IC to help reduct the IC temperature.

The RPi P3 Model B CPU with heat sink and case cover off with room temperature of 21.0 C.

To show RPi CPU temperature.

Raspberry Pi Cooling


Project 24: Show RPi CPU Frequency

The RPi monitors the CPU clock frequency. The higher the CPU clock the faster the CPU runs and quicker the software runs.

The RPi P3 Model B CPU clock frequency at 0% CPU usage is 600 MHz. The RPi P3 Model B CPU clock frequency at 85% CPU usage is 1200 MHz.

To show RPi CPU clock frequency.


Project 25: Show RPi CPU Frequency

The RPi monitors the CPU clock frequency. The higher the CPU clock the faster the CPU runs and quicker the software runs.

The RPi P3 Model B CPU clock frequency at 0% CPU usage is 600 MHz. The RPi P3 Model B CPU clock frequency at 85% CPU usage is 1200 MHz.

To show RPi CPU clock frequency.


Project 26: Get and Set Date and Time

The RPi will automatically set the date and time if the RPi is connected to the Internet. If no Internet connect durning power-on you can set the date and time in the CLI as shown below. The RPi does not have a battery clock circuit keeping time when it is turned off.

Get date and time.


Project 27: Change the PIXEL Desktop Wallpaper

PIXEL Desktop wallpaper is the image in the background of the PIXEL Desktop. The RPi has a select of different images that can be used for wallpaper.

Get date and time.


Project 28: RPi Portable Battery Operation

The RPi power supply requirement is compatible with USB chargers and portable USB power banks. The USB power banks is a battery with electronic circuits to charge a battery operated USB device such as cell phones, tablets, etc. Therefore, the portable USB power bank can be used to power the RPi.

USB power banks output a standard 5 Volts at different current rates. My RPi power supply is rate 5 Volts at 2.5 Amperes. Therefore, I use a 2.5 Amperes USB power bank.

USB power banks have different storage capacity. Storage capacity is typically rated in mAh (mill Ampere hours). The large the mAh rating, the larger the storage capacity, the longer the RPi will operate from the USB power bank.

I use a HyperGear Dual USB Power Bank Model #13460 with dual 2.5 A and 2.1 A outputs. The Power Bank lithium-ion batter capacity is 16,000 mAh. A micro USB cable is needed to connect the Power Bank to the RPi.

If the RPi is running 2,000 mA, I hope to operate the RPi for about eight hours, almost a fill day with the Power Bank. A future project is to bench test the performance of the HyperGear Dual USB Power Bank operating time with the RPi.

The HyperGear Dual USB Power Bank was on sale for $17.99 at Fry's Electronics.


Project 29: Copy and Past Between Chromium Web Browser and Terminal CLI

There are some RPi operations that can only be done in the CLI. If you are follow instructions using the CLI it is easy to copy commands from the instructions like web pages or other electronic documentation and past those commands into the Terminal CLI to run them.

Terminal provides a CLI in a PIXEL Desktop window that supports mouse copy and past operations. As a result, The mouse can be used to copy text in the Chromium Web Browser (like CLI commands) and then paste the text into the Terminal window to be run. Thus, saving typing the command in the Terminal CLI and avoiding typing errors.

For example,


Project 30: Save Terminal CLI Text

Terminal does not have a save to file function. But, you can select CLI Termain text with the mouse, copy this text and past the text into Text Editor to be save as a .txt text file.


Project 31: Get the Raspberry Pi Weekly Newsletter

Sign up for the free Raspberry Pi Foundation Raspberry Pi Weekly newsletter at Subscribe web page.

View the Raspberry Pi Weekly archive.


Project 32: Learn About RPi & Linux From Magazines

The MagPi magazine is the official Raspberry Pi magazine.


Project 33: Watch Raspberry Pi Videos

Raspberry Pi Internet videos are located at YouTube and Vimeo.


Project 34: Join the Raspberry Pi Foundation Forum

The Raspberry Pi Foundation forum is a great place to search for RPi information and answers to questions.


Project 35: Get RPi P3 Model B Specifications

The Wikipedia Raspberry Pi web page has a specifications table comparing the different series and models of RPis.

RPi B+ GPIO pinout diagram and RPi photo with callouts is in the Element14 article Adding a Shutdown Button to the Raspberry Pi B+ The B+ GPIO pinout is the same as P3 Model B. The B+ photo is similar to the P3 Model B, but missing the WiFi ant, etc.

The Raspberry Pi 3 Model B Frequently Asked Questions (FAQs)


Project 36: Learn About the Raspberry Pi From Books

The Raspberry Pi printed books that I have used.

Free online Raspberry Pi PDF books.


Project 37: Learn About the Raspberry Pi From Tutorials, Workshops & Classes

The Raspberry Pi online tutorials, workshops and classes.


Project 38: Install ImageJ, An Image Processing & Analysis Program

ImageJ is an image processing and analysis program inspired by NIH Image.

ImageJ can display, edit, analyze, process, save and print 8-bit, 16-bit and 32-bit images. ImageJ can read many image formats including TIFF, GIF, JPEG, BMP, DICOM, FITS and "raw". ImageJ supports "stacks", a series of images that share a single window. ImageJ can calculate area and pixel value statistics of user-defined selections. ImageJ can measure distances and angles. It can create density histograms and line profile plots. ImageJ supports standard image processing functions such as contrast manipulation, sharpening, smoothing, edge detection and median filtering. Spatial calibration is available to provide real world dimensional measurements in units such as millimeters. Density or gray scale calibration is also available. ImageJ is developed by Wayne Rasband (wayne@codon.nih.gov), is at the Research Services Branch, National Institute of Mental Health, Bethesda, Maryland, USA.

The below installation uses the PIXEL Desktop GUI.

To open ImageJ.


Project 39: Learn About the Raspberry Pi Foundation

Raspberry Pi Foundation created the Raspberry Pi computers and a great website with many resources to learn how to use a RPi.

Links


Project 40: Install Audacity, Audio Editor Program

Audacity is a multi-track audio editor for Linux/Unix, MacOS and Windows. It is designed for easy recording, playing and editing of digital audio. Audacity features digital effects and spectrum analysis tools. Editing is very fast and provides unlimited undo/redo. Supported file formats include Ogg Vorbis, MP2, MP3, WAV, AIFF, and AU.

The below installation uses the PIXEL Desktop GUI.

To open Audacity.

Audacity website

Audacity tutorial


Project 41: Install Stellarium, A 3D Photo-Realistic Sky Chart Program

Stellarium renders 3D photo-realistic skies in real-time. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.

Some features:

Stellarium should not be used for very high accurate calculation or ephemerids like eclipse predictions. However, it is the ideal program to prepare an observation evening with naked eye, binocular, or small telescope.

The Stellarium data files package contains data files required by Stellarium. They include textures, star catalogues and translations.

The below installation uses the PIXEL Desktop GUI.

To open Stellarium.

Stellarium website


Project 42: Shutdown a RPi

It is a good practice to correctly turn off a RPi.

The method to turn-off a RPi depends upon if the PIXEL Desktop GUI is being used.

Using PIXEL Desktop GUI.

Not using PIXEL Desktop GUI.


Project 43: Change the HDMI Display Resolution after Power-On

Small HDMI displays may be difficult to use at full 1080 resolution.

In PIXEL Desktop GUI the display resolution can be changed after power-on.

Using the PIXEL Desktop GUI.


Project 44: Benchmark the RPi P3 Model B

Power-on time to PIXEL Desktop GUI.
Using 32 GB SD, show PIXEL screen when starting Desktop GUI and
HDMI TV monitor at 16:10, 1680x1050 @ 60 Hz progressive.

Element14 RPi benchmark tests.

During the Element14 launch video the RPi 3 Model B core performance was reported to be 10X faster than the first RPi.


Project 45: Help, Manuals, etc. On The RPi

The RPi has several ways to get help off-line.

In the PIXEL Desktop GUI.

In the CLI use the following commands and options. Different commands support different types of help.

In the CLI some commands support the following options.


Project 46: Environment Variables

Environment variables contain a variety of information that range from the user logged on to the search path used to locate commands.

In CLI use the following commands to show the value of the environment variables.

Examples of environment variables.


Project 47: Install X Applications

PIXEL Desktop GUI is based on X Window System. X Window System is also called X11 Window System. X applications run on the PIXEL Desktop GUI.

This package provides a miscellaneous assortment of X applications that ship with the X Window System, including:

Install X Applications.

Example using screenshot (screen dump). The file extension needs to be <.wxd>.

To view the screenshot (screen dump) <file_name>.wxd.

X Window System user's guide : for X11 R3 and R4 of the X Window System

Manuals information.

In project 49 the screenshot .wxd file is converted to a a more common .png file.


Project 48: File Names & Extensions

RPi computer file names are case sensitive. File "test" and file "Test" are two different files in the RPi whereas in a Microsoft Windows computer they are the same file.

File name general guidelines.

File extensions tables.


Project 49: Install ImageMagick

ImageMagick is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. All manipulations can be achieved through shell commands as well as through an X11 graphical interface (display). This package include links to quantum depth specific binaries and manual pages.

The below installation uses the PIXEL Desktop GUI.

To open ImageMagick.

In project 47 the screenshot was saved as a .wxd file. Below the convert command is used to change it to a more common .png file.

ImageMagick website


Project 50: Install XFig

XFig is a menu-driven tool that allows the user to draw and manipulate objects interactively in an X window. The resulting pictures can be saved, printed on postscript printers, or converted to a variety of other formats (e.g. to allow inclusion in LaTeX documents or web pages) using the transfig program. This package contains the xfig program itself. You should think about installing the transfig package to export the graphics to several common formats. You should also think about installing xfig-doc, which contains the documentation and xfig-libs, which contains several clip art libraries.

The below installation uses the PIXEL Desktop GUI.

To open XFig.

XFig website


Project 51: Bash Shell Job Control

The RPi default shell is the bash shell. The bash shell is used at the CLI (command line interface) to work with the RPi Linux kernel and other programs on the RPi.

To show the shell being used by the RPi use the below command.

Job control is managing how programs are run in the foreground or background, halted and stopped (killed). The benefit of job control is a local or remote terminal is used to manage several program jobs at the same time. This will be very important capability when controlling the RPi by a remote computer using Secure Shell (SSH) and the RPi has no keyboard, mouse or display (headless operation).

Job control Ctrl-key commands:

Job control commands:

The below job control examples use the Terminal program in the PIXEL Desktop GUI and the xclock program from project 47. (man xclock) By using the clock with seconds hand it is easy to see when clock is running or stopped.

The clock takes about 10 seconds to start up and the clock will report some errors that does not seem to affect its operation.


Example 1, shows the clock as a foreground job that stops the Terminal from being used for other jobs. Ctrl-c kills the job and the Terminal is back to normal operation.

Terminal

Clock

Comments

Command prompt

xclock -analog -update 1

Start the clock

No command prompt

Clock running in the foreground

Ctrl-c

Clock is killed

Ctrl-c kills the current job

Command prompt


Example 2, shows starting the clock with background & option. The fg command moves the clock to the foreground job resulting in locking the Terminal from being used for other jobs. Ctrl-c kills the job and the Terminal is back to normal operation.

Terminal

Clock

Comments

Command prompt

xclock -analog -update 1 &

Start the clock

Command prompt

Clock running in the background

Ctrl-c

Clock running in the background

Ctrl-c has no effect on the background job

fg

Clock running in the foreground

fg moves the job to the foreground

Ctrl-c

Clock is killed

Ctrl-c kills the current job

Command prompt


Example 3, shows the foreground job being halted and being put in the background using Ctrl-z. Use the kill command to tell the clock job.

Terminal

Clock

Comments

Command prompt

xclock -analog -update 1

Start the clock

No command prompt

Clock running in the foreground

Ctrl-z

Clock is stopped ticking

Ctrl-z halts clock & puts clock in background

Command prompt

fg

Clock running in the foreground

fb starts the clock & moves it to foreground

Crtl-z

Clock is stopped in background

bg

Clock is running in background

ps

Clock is running in background

Get the PID number of clock

kill PID_number

Clock is killed

Kill job with PID number

Command prompt



Glossary

Below is a list of glossary links.



- HOME - RPi PROJECTS - RADIO RPi PROJECTS - GNU RADIO - SATELLITES - WEATHER SATELLITES - RADIO ASTRONOMY -

© March 28, 2017
David Haworth, WA9ONY
www.stargazing.net/david