Students will learn how to setup a simple single board computer through SSH. They will download the operating system and copy it onto their flash drive. They will boot the system. To test the installation, they will hook up a camera and run example face tracking python program and a target recognition program using computer vision.
Learning outcome:
Prepare portable computing platform with operating system and practice Unix shell skills.
Urs Utzinger, Updated 1/17/2026
Raspberry Pi (version 4 is used here but others will work too)
USB-C power supply 3A (Raspberry Pi 5 recommends 5A)
USB flash drive [or SD Card] (16 GBytes or larger)
Micro-HDMI to HDMI adapter
USB to Ethernet Adapter (List of suggested USB to Ethernet adapters with pictures of USB ports if you want to get one).
Ethernet Patch Cable
[Optional] WiFi network to which you can connect your devices.
{Optional] Display with HDMI cable such as your TV,
[Optional] Keyboard and mouse
!! Don't power Raspberry Pi on the USB port of your desktop or notebook computer. Raspberry Pi needs more than 2A . You like will permanently damage your computer !!
!! Electronics are exposed. If you place the Raspberry Pi on a metal part you will short it. Your laptop case, pen, screwdriver, coin are metal parts. If you drop screws, tools or jewelry on it, you will short it. It will not recover !! Common parts no longer working after shorting is display, wifi, usb ports.
You can add the mouse, keyboard and display when your Raspberry Pi is running but you shall not remove the flashdrive (or SD card) while it is running.
If you brake your Pi, we will offer you an older and slower model. If you brake that too, you will need to purchase and replace the Pi 4 and leave it with us. As one of the next assignments you will create a protector for the top and bottom of your Pi.
We will setup the Raspberry Pi according the written step by step instructions below. A YouTube video also available below. We will want to accomplish the following tasks:
Installation of a boot medium that contains the operating system. In this setting we use a flashdrive because they are less expensive and faster than SD cards. Raspberry Pi does not have internal storage or a storage drive interface.
We will need to set up the Network. For the lab the Network SSID is MEDDEV-5G. The password is provided by the instructor.
For easier operation will need to configure other common options every computers has:
Hostname: e.g. yournamepi (urspi)
Username: e.g. urs
Password: *****
Less Common Options:
Remote headless operation (no display) using SSH. [servers and many internet of things devices.]
Remote display mirroring using VNC. You will need VNC viewer on your laptop. RealVNC provides RealVNC viewer. You do not need an account with RealVNC nor the VNC server. VNC is a remote desktop program and not commonly used on UNIX or Windows computers.
We will use a network patch cable to connect your laptop to the raspberry pi.
If the describe method with USB to Ethernet adapter fails, you can connect with WiFi.
Black adapters work for PC, sliver works for Mac.
Install the Raspberry Pi Imager: https://www.raspberrypi.com/software/ on your laptop or desktop computer.
Run the Raspberry Pi Imager again and insert the flash drive in to a UBS port of your laptop/desktop computer. Select
Raspberry Pi 4 Model B
Operating System: Raspberry Pi OS 64 bit,
Choose Storage: Your flashdrive, e.g USB SanDisk 14.3GB. ! Do not select any other drive otherwise you brick your computer.!!
Customization
Hostname: yournamepi, e.g. urspi
Localization: Washington DC, America/Phoenix, Keyboard us
Username: yourname, e.g. urs
Password: use something simple you can remember
WiFi: Meddev-5G, Password: I tell you in class
Enable SSH and Use password authentication
Enable Raspberry Pi Connect
Create account with Raspberry Pi
Create new token, I clicked on Having Trouble to actually see it as I did not want the website to launch the installer.
Click Write. It can take 5-10 minutes to complete.
If the write process stalls for several minutes at the same per cent indicator, try another USB port on your computer. If that fails also, return the defective flash drive and have it replaced by staff.
Temporarily attach a display to the Raspberry Pi and energize the Raspberry Pi. When the system starts properly and shows the desktop you can disconnect the display and let someone else on your bench use it. It will take about 30 seconds until desktop shows the first time. It might reboot and show it again.
If your Raspberry Pi indicates that it can not find a boot medium although you inserted the flash drive, you either selected the wrong image (Raspberry Pi 5 instead of 4) or you will need to change the boot order. Ask for a temporary flash drive to change the boot order and return it afterwards. You do not want to overwrite your flashdrive with the Operating System you created above:
Run the Raspberry Pi Imager and select Raspberry Pi 4, Operating System: Misc Utilities: Boot Loader: USB Boot, Choose Storage: The SanDisk flashdrive. !! Do not select any other drive otherwise you brick your computer.!!
Write the selected option to the flashdrive. Ignore requests from your computer to format the flash drive
Plug the flash drive into one of the blue USB ports.
Plug the power cable into the UBS-C port of the Raspberry Pi.
Let it run until you see not more flashing activity on the green and red LED.
Unpower the Raspberry Pi and remove the flash drive.
If changing the boot order did not solve the problem you should recreated an image for Raspberry Pi 4 as you likely did not select the correct hardware.
Further configure the Raspberry Pi:
Allow a direct connection from the USB to Ethernet adapter to the Raspberry Pi using the network patch cable. Such a connection is faster than WiFi in a classroom where 30 laptops and 30 Raspberry Pi's are using WiFi. If the installation below can not be completed on your computer, you can decide to use WiFi only.
Startup the Raspberry Pi.
Attach the network patch cable to the Raspberry Pi.
Connect the patch cable to the USB to Ethernet dongle.
Plug the USB to Ethernet dongle into your laptop/desktop (if you need USB-C adapter ask TA, ULA or instructor). If you have a MAC computer you need to use a silver colored adapter not the black one.
We need to enable sharing of the Internet Connection from your laptop/desktop to the USB to Ethernet Adapter.
Windows:
Click Windows Symbol and type Run + enter and a requester will appear
Type ncpa.cpl and enter into the field and a Window with all your network adapters will appear.
Right Click on the WiFi connection you want to share and select Properties.
Select Sharing Tab.
If you do not see a Sharing Tab, run services.msc and make sure "Internet Connection Sharing (ICS)" is running (Start) and Startup Type is "Automatic". If you still do not have sharing, you might not be able to use USB to Ethernet adapter (talk to instructor). You can still connect to Raspberry Pi using WiFi.
Enable "Allow other network users to connect through this computer’s Internet connection"
In "Home Networking Connection" select the USB to Ethernet Adapter which might have a name such as "Ethernet #". It should be listed as a symbol in the Window that displayed all your network adapters from above.
Complete/Apply the configuration.
When Raspberry Pi is running, remove and reattach the network patch cable. Your Raspberry Pi should obtain an IP number now. If your Raspberry Pi is connected to a display it will indicate a solid up/down arrow on the top right of the screen and briefly show the IP number/network address. If the up/down arrow remains blinking, try unplugging the USB connector from your lapop/desktop and plug it back in while the Raspberry Pi remains powered on.
iOS/Mac
Open System Settings.
In the Search Bar type "Sharing" and Select "Internet Sharing"
Configure Sharing by Sharing WiFi to Enable sharing of Wi-Fi to USB 10/100/1000 LAN or USB Ethernet.
Apply the settings.
If 802.x error appears that means your Mac is managed by an Enterprise (e.g. the University) and does not allow Internet Sharing. You still can connect to the Raspberry Pi using WiFi but the USB to Ethernet adapter will not work for you.
When raspberry pi is running unplug network cable and plug it back in. Your Raspberry Pi should obtain an IP number. If your Rasberry Pi is connected to a display it will indicate a solid up/down arrow on the top right of the screen and briefly show the IP number/network address. If the up/down arrow remains blinking, try unplugging the USB connector from your laptop/desktop and plug it back in while the Raspberry Pi remains powered on.
Linux:
Clicking on network indicator on your desktop (top right, bottom right of screen) and select "Settings".
Locate the USB to Ethernet adapter. It should show that it is connected / plugged in.
Click on the Gear Icon for Settings on the USB to Ethernet Adapter
You will want to change the settings so that IPv4 is shared to other computers. IPv6 is not recommended to be shared.
Apply the settings.
When Raspberry pi has booted up, unplug and re-plug the network cable. Your Raspberry Pi should obtain an IP number. If your Raspberry Pi is connected to a display it will indicate a solid up/down arrow on the top right of the screen and briefly show the IP number/network address. If the up/down arrow remains blinking, try unplugging the USB connector from your laptop/desktop and plug it back in while the Raspberry Pi remains powered on.
Open Power Shell (Windows) or Terminal (Mac, Linux) and type ping hostname.local replacing hostname with the computer name you choose above.
If ping can not find your computer, while the Raspberry Pi is running, unplug the USB to Ethernet adapter from the USB port of your computer, plug it back in and give it 20 seconds and try again.
If you are using Wi-Fi and not the USB to Ethernet adapter, your computer and Raspberry Pi need to be both on the MEDDEV network or your hotspot or home WiFi (UA WiFi likely does not allow you to connect from your laptop to an other computer on UA WiFi)
If the Raspberry Pi responded to ping we connect to it with ssh username@hostname.local using the username and hostname you choose above. Accept the certificate, type your password and you are connected.
If the password is wrong, you can connect the Raspberry Pi to a display and open Terminal/Shell. The prompt should show you your username as well as the hostname. If you forgot the password you need to ask AI for help.
If the ssh connection is refused, you will need to attach a display to your Raspberry Pi and open the Configuration Center under the Raspberry Icon (top left). Find the settings to enable SSH. If its already enabled, disable it, apply settings (close) and open settings again and enable it again.
If ping hostname.local worked but ssh does not find your Raspberry PI, you can try ssh username@192.168.x.x where the numbers match the ones from your ping response. The numbers can also be something like fe80::ba27:ebff:fe12:3456%12. If this does not resolve the connection issue, you can attempt the next step with Rasberry Connect in your web browser (complete step 6 first).
Configure the Raspberry Pi by executing sudo raspi-config in the Terminal / Power Shell.
Under Interface Options, enable SPI, and I2C. We already enabled SSH and RPI Connect. You will need to use the arrow keys on your keyboard to navigate. The mouse does not work in a shell/terminal.
Select Finish.
FYI: SPI and I2C are used to connect sensors and you will use this again in this class and also in BME310.
Now you can connect with Raspberry Pi Connect from your computer to the Raspberry Pi.
On your laptop/desktop open https://connect.raspberrypi.com and login to your account. You will see your raspberry pi in the device list.
If the Raspberry Pi is turned on and connected to the internet you can connect to it. Even if its at home.
If Raspberry Connect does not show your Raspberry Pi, you need to connect it to a display and make sure the circle symbol on top right is connected to the service. When circle symbol is greyed out, you can click on it to log in.
You can open a connection to your Raspberry Pi using "Screen Sharing" or "Shell/Terminal".
Update the Operating System
Open a terminal on Raspberry Pi which is the black icon on top left (Raspberry Pi connect with Raspberry Connect or Display or with SSH)
Execute sudo apt update in the terminal.
Decide if you have time to update. Execute sudo apt upgrade in the terminal. This will take at least 10 minutes to complete especially if 20 other students are using the network for the same purpose.
The messages you see are similar to when your phone is installing upgrades. Here you manually started them and your phone does these commands automatically in the background.
Optional Add additional WiFi credentials
If you plan to use the Raspberry Pi on campus, you can add UAWiFi to the list of known SSIDs. You will want to edit the network by clicking on the wireless symbol on the top right. If it shows UAWiFi you can attempt conencting to it. You can add settings also manually:
Security : WPA/WPA2-Enterprise
Authentication : EAP method: PEAP
Phase 2 authentication: MSCHAPv2
PEAP version: Automatic
Identity
Username: Your NetID
Password: Your NetID password
Anonymous identity: (leave blank)
Certificates
CA certificate: None
Select “No CA certificate required”
Domain (if requested): arizona.edu
No CA certificate is allowed at University of Arizona but not good practice.
You can also add the WiFi settings from your home, but its easiest to attach a display and connect to them by selecting the SSID from your home when you are there.