Skip to Main Content

TFDL Makerspace Training

Online training for TFDL makerspace equipment

What is Raspberry Pi?

A Raspberry Pi is a small, affordable single-board computer developed by the Raspberry Pi Foundation in 2012, that like any other computer, connects to your normal computer peripherals, Screen, Keyboard and Mouse. It is designed to promote the teaching of basic computer science in schools and developing countries.

Despite its compact size, it has enough computing power to run an operating system (such as Linux) and perform a variety of tasks, including web browsing, coding, and media playback.  

Since 2012, there have been several models of this computer, which have increased its capabilities and processing power.

Some key features of Raspberry Pi are: 

  • It is typically about the size of a credit card, making it highly portable.
  • The price of a Raspberry Pi model ranges from $15 to $150 CAD, making it an accessible option for many users.
  • It includes a CPU (central processing unit), RAM, storage (usually via microSD card), GPIO (General Purpose Input/Output) pins for interacting with other hardware, USB ports, HDMI output for video, and an Ethernet or Wi-Fi connection.
  • It generally runs a version of Linux, such as Raspberry Pi OS, but it can also support other operating systems like Windows IoT Core or even run a lightweight version of Windows 10.
  • Raspberry Pi can be used for a wide range of projects, including home automation, robotics, media centers, gaming consoles, educational tools, Blinking a LED and more.
  • A large and active community offers support, tutorials, and projects, making it an excellent platform for learning and experimentation.

The Taylor Family Digital Library's Makerspace provides access to Raspberry Pi 2 Model B kits which you can book here.  We can also supply a wireless keyboard/mouse and screen for use with the Pis.

Hardware Setup

What you’ll need:

  • Raspberry Pi
  • MicroSD card (Flashed with Raspberry Pi OS 32-bit)
  • Power supply
  • HDMI cable (for connecting to a monitor)
  • USB keyboard and mouse
  • Ethernet cable (optional, for wired internet)
  • Monitor or TV (with HDMI input)
  • MicroSD card reader (for flashing the SD card from your computer)

 

Hello Raspberry Pi!, Manning Publications. Available from: https://livebook.manning.com/book/hello-raspberry-pi/appendix-b/13

Step by Step

  1. Prepare the MicroSD Card: Insert the MicroSD card into your card reader and connect it to your computer. Download Raspberry Pi Imager from Raspberry Pi's official website. Install and open the Raspberry Pi Imager on your computer. 
  2. Flash the Raspberry Pi OS: Open Raspberry Pi Imager and select the operating system to install, "Raspberry Pi OS (32-bit)" is a good choice. Choose the correct storage device (your microSD card). Click "WRITE" to start the flashing process. Wait for the process to complete (this may take several minutes).

  1. Insert the MicroSD Card into the Raspberry Pi: Once the flashing is complete, safely eject the microSD card from your computer. Insert the MicroSD card into the Raspberry Pi's SD card slot.

  1. Connect Peripherals: Connect the keyboard and mouse to the USB ports on the Raspberry Pi. Connect the HDMI cable from the Raspberry Pi to the monitor or TV. If using Ethernet, connect the Ethernet cable from the Raspberry Pi to your router or network switch.  All these ports are shown in the image above.
  2. Connect Power: Finally, plug in the power supply to the Raspberry Pi. It should boot up immediately, and you should see the boot process on the monitor.

Software Setup

  1. Initial Boot (First Time Setup): On the first boot, Raspberry Pi OS will load, and you'll be guided through an initial setup wizard.

Raspberry Pi OS setup wizard welcome

Setting location window

User Creation. You’ll need to assign a username and password.

Software Update (optional)

 

 

After this screen, there will be a loading bar and the Raspberry Pi will reboot, then the desktop should show up on the screen.

Setup complete and Restart Notification

Reboot process.

Images courtesy of Tomshardware.com

  1. Complete the Setup: After completing the setup wizard, Raspberry Pi OS should load to the desktop.

  1. Update the System (Optional but Recommended): Open the terminal on the Raspberry Pi desktop and type:

sudo apt update

sudo apt upgrade (this will take several minutes to complete)

  1. Update/Install software: Install any available updates and wait for the process to complete. You may want to install additional software depending on your needs, such as:
  • Programming tools: Python, Scratch, or other languages
  • Web browsers: Chromium, Firefox, etc.
  • Office applications: LibreOffice or similar tools

Use the terminal or the "Add/Remove Software" utility to install software. For example to install Chromium, open the terminal on the Raspberry Pi desktop and type:

sudo apt install chromium-browser

  1. Set up Networking (if necessary): If you're using Ethernet, it should automatically connect. For Wi-Fi, if you didn’t set it up during the initial wizard, click on the Wi-Fi icon in the top right corner of the screen and select your network.
  2. Reboot: After completing the software installation and updates, it's a good idea to reboot using the terminal on the Raspberry Pi :

sudo reboot

Handy Terminal Commands

 

Here are some commands you can use in the terminal box of the Raspberry Pi OS:

 

# Command Description
1 sudo apt-get update Use before installing new packages
2 sudo apt-get upgrade Upgrades all of the software packages
3 sudo raspi-config Opens configuration settings menu
4 clear Clears previously run commands
5 poweroff Shutdowns inmediately
6 reboot Reboots inmediately
7 startx Opens GUI (Graphical User Interface)
8 ifconfig Checks status of wireless connection
9 iwconfig Checks which network is being used by the wireless adapter
10 nano Edit a file
11 pwd Show the current directory
12 cat Show the contents of a file
13 cd Change directories
14 cp Copies file or directory
15 ls Lists the files in the current directory
16 mkdir Creates a new directory
17 ping Tests connectivity between two devices in a network

Remember that Raspberry Pi's IDE is based on Python, so any knowledge of Python language is good to make your interaction with Raspberry  Pi better.

Installation of 7” Touchscreen Display for the Raspberry Pi

What you’ll need?

From the Hardware Setup tab:

  • Raspberry Pi board
  • Raspberry Mini USB 5V Power adapter
  • Computer peripherals (USB mouse and keyboard, HDMI screen)

From the Software Setup tab:

  • Micro SD card with Raspberry Pi OS installed.
  • 7” Touchscreen Display Kit (Touchscreen with board attached, DSI and GPIO links

The Kit looks like this:

And when assembled, it looks like this:

 

Step by Step

  1. Remember that before handling electronic boards, make sure you electrically discharge by touching a grounded metal part.  The static electricity can sometimes damage the circuitry, thus the touchscreen or the Raspberry Pi board.
  2. Setup the Raspberry Pi with all the peripherals connected and the MicroSD card with Raspberry Pi OS.  Power it up.
  3. Once the Raspberry Pi OS is running, open the Terminal and type these commands one by one:
    • sudo apt-get update: If you followed the first-time software setup tab this one is optional. 
    • sudo apt-get upgrade: If you followed the first-time software setup tab this one is optional too.
    • sudo apt-get dist-upgrade: Updates all installed software and handles any changes in dependencies (such as adding/removing packages for compatibility).
    • sudo apt-get install raspberrypi-ui-mods: Installs User Iinterface (UI) related modifications that are optimized for the Raspberry Pi's graphical desktop.
    • sudo apt-get install raspberrypi-net-mods: Installs network-related customizations and tools to help with managing your Raspberry Pi’s network connections.
    • sudo shutdown: Shuts down the Raspberry Pi, so the hardware installation of the touchscreen can be performed safely.
  4. The touchscreen already has its board installed, so we’ll be connecting the screen to the Raspberry Pi board.  For this, there are two connections to be made, the GPIO jumpers (Red, Yellow, Green, Black) and the DSI (Display Serial Interface) ribbon.  The DSI ribbon handles the display information and the GPIO handles the touch part of the display and the power.

  • DSI ribbon: This is a gray ribbon with metal pins that need to be connected securely to both circuit boards. The ribbon connectors work like it’s shown on the pictures below. 

On the board of the Touchscreen: 

On the Raspberry Pi board:

  • GPIO jumpers: These are four cables that connect between both circuit boards.  

On the Touchscreen board it connects to the GPIO like this:

 

On the Raspberry Pi board it connects like this:

  1. After everything is connected, you can plug in the power adapter to the touchscreen board MiniUSB port, wait for the OS to load and test the touchscreen.