IT Course Directory: VMware, Linux, Networking, and Raspberry Pi
Free Raspberry Pi Course: Getting Started with Hardware, Linux, GPIO, and Projects
Learn Raspberry Pi setup, Raspberry Pi OS, Linux, networking, Python, GPIO, electronics, sensors, troubleshooting, and beginner projects.
Welcome to the Raspberry Pi Course
This course teaches you how to choose, set up, use, program, and troubleshoot a Raspberry Pi. You will begin with the computer itself, install an operating system, learn essential Linux commands, connect remotely, write Python programs, and build safe GPIO electronics projects.
The course is suitable for beginners, students learning physical computing, makers, and educators. Basic computer operation and internet use are helpful. Previous programming or electronics experience is useful but not required.
Use the Raspberry Pi course curriculum to follow the lessons in order, and use this learner activity area to review course events and progress.
What Is a Raspberry Pi?
A Raspberry Pi is a compact single-board computer: a complete computer built on one circuit board. Depending on the model, it can run an operating system, connect to a network, display a graphical desktop, store files, and control electronic circuits.
A Raspberry Pi can be used for desktop computing, coding practice, media playback, network services, home automation, environmental sensing, camera projects, robotics, and Internet of Things systems. It can also act as a small web server, file server, monitoring station, or learning platform.
Raspberry Pi versus a microcontroller
A Raspberry Pi normally runs a full Linux operating system and can execute several programs at once. It has substantial storage, networking, USB support, and often a graphical desktop. It is well suited to applications that need files, Python libraries, databases, web interfaces, or remote administration.
A microcontroller board such as an Arduino is designed primarily to run one small program directly on a microcontroller. It usually starts quickly, uses less power, and provides predictable timing for simple control tasks, but it generally has fewer operating-system features. A Raspberry Pi and a microcontroller can also work together: the Pi can provide networking and high-level logic while the microcontroller handles precise, time-sensitive signals.
Raspberry Pi Models and Hardware Selection
Raspberry Pi families differ in processor performance, memory capacity, port selection, wireless features, power requirements, physical size, and GPIO availability. General-purpose Pi boards are intended for desktop use and demanding projects. Smaller or lower-power families are useful for compact embedded systems. Compute-focused boards and modular boards may require a separate carrier or more specialized setup.
Do not select a board only by its name. Check the exact model specification and the needs of the project. A desktop with several applications needs more memory and cooling than a simple sensor logger. A robotics project may prioritize size, power consumption, motor control, and camera support.
| Component or connector | Purpose | Typical use | Notes by model |
|---|---|---|---|
| Processor and memory | Runs the operating system and programs | Desktop applications, Python, servers | Performance and available memory vary significantly |
| USB ports | Connect peripherals | Keyboard, mouse, storage, adapters | Port count and speed vary; demanding devices may need powered USB |
| HDMI or display connection | Provides video output | Monitor, television, display panel | Connector size and display capability vary by model |
| Ethernet and Wi-Fi | Provides network access | Internet, SSH, servers, updates | Some boards provide one or both; wireless bands vary |
| Camera and display connectors | Connect compatible camera or display modules | Photography, computer vision, touch displays | Connector type and software support depend on the board |
| microSD or other storage | Stores the operating system and files | Boot media, programs, project data | Some models support additional storage options |
| 40-pin GPIO header | Connects software to electronics | LEDs, switches, sensors, displays | Header layout and exposed pins depend on the model |
| Power input | Supplies regulated power to the board | Normal operation and peripherals | Use the supply and cable recommended for the specific model |
Choose a compatible power supply first. An adapter with an unsuitable voltage, insufficient current, or a poor-quality cable can cause boot failures, random resets, storage corruption, warning indicators, or throttling. Throttling means reduced performance caused by temperature or inadequate power conditions.
Also select a suitable microSD card, case, cooling solution, display cable, keyboard, and mouse. Add a breadboard, jumper wires, LEDs, resistors, and sensors for electronics work. A fan or heatsink may be appropriate for sustained workloads, but cooling does not correct an unsuitable power supply.
Required Equipment and Safe Setup
| Item | Required or optional | Purpose | Compatibility considerations |
|---|---|---|---|
| Raspberry Pi board | Required | Runs the operating system and project code | Confirm the model supports the intended ports and software |
| Compatible power supply and cable | Required | Provides stable power | Match the connector, voltage, current rating, and model requirements |
| microSD card | Required for many models | Holds the operating system and files | Use a reliable card with sufficient capacity and suitable speed |
| Operating system image | Required | Provides the software needed to boot | Choose an image compatible with the board and intended workload |
| Network or local access method | Required | Lets you configure and control the Pi | Use a monitor and input devices, Ethernet, Wi-Fi, or a headless setup |
| Monitor, keyboard, and mouse | Optional | Provides local desktop access | Check display cable and USB or Bluetooth compatibility |
| Case and cooling | Optional | Protects the board and manages heat | Allow access to ports and GPIO; use model-compatible cooling |
| Breadboard and jumper wires | Optional | Prototypes circuits without soldering | Check connections carefully because breadboard layouts differ |
| LEDs, resistors, switches, and sensors | Optional | Builds hardware exercises | Verify voltage, polarity, current, and interface requirements |
Handle the board by its edges and avoid static discharge. Keep drinks and conductive objects away from the circuit. Do not force connectors, insert a card incorrectly, or move jumper wires while powered. GPIO shorts can damage the board or attached components.
Use a controlled shutdown before disconnecting power. Removing power while the microSD card is being written can corrupt the filesystem. When working on a circuit, shut down the Pi, remove power, check the wiring, and only then reconnect power.
Installing and Booting Raspberry Pi OS
Raspberry Pi OS is a Linux-based operating system commonly used on Raspberry Pi hardware. Other operating systems can be useful for specialist tasks, but Raspberry Pi OS is a practical starting point because it supports the desktop, terminal, hardware interfaces, package management, and common educational tools.
- Identify the exact Raspberry Pi model and obtain a compatible operating system image.
- Install an operating-system imaging utility on another computer.
- Insert the microSD card into that computer and select the card carefully.
- Choose the operating system image and write it to the card. This erases existing data on the selected card.
- If the utility supports it, preconfigure the username, password, locale, wireless network, hostname, and SSH before writing the card.
- Safely eject the card, insert it into the Pi, connect the display and input devices if using local access, and apply power.
During first boot, configure the locale, keyboard layout, timezone, username, password, display settings, and network. Then install software updates before beginning a project:
sudo apt update
sudo apt full-upgradeapt is the command-line interface for the Debian-family package manager used by Raspberry Pi OS. The first command refreshes available package information. The second installs available updates. Restart if the system requests it.
Headless setup
A headless setup operates the Pi without a directly attached monitor, keyboard, or mouse. Preconfigure network access and enable SSH with the imaging utility or configuration tools, boot the Pi, identify its address from the router or local network, and connect from another computer. Have a reliable way to discover the address and verify that SSH is enabled before removing local access.
Desktop and Linux Fundamentals
The desktop environment provides an application launcher, taskbar, file manager, terminal, and settings tools. Use the file manager to browse folders and mounted storage. Use settings to configure display, keyboard, network, users, and hardware interfaces. Use the terminal when a command is faster, repeatable, or required by documentation.
Linux organizes files in a directory tree. The root directory is written as /. A user's home directory is commonly under /home. Configuration and system files occupy other directories, and removable storage is mounted at a directory so its contents can be accessed. A user account has permissions that control whether it can read, write, or execute a file.
| Command | Purpose | Example use | Caution or note |
|---|---|---|---|
pwd | Print the current directory | pwd | Useful when a command uses a relative path |
ls -la | List files, including hidden files and details | ls -la | Check ownership and permission columns |
cd <directory> | Change directory | cd Documents | Use cd .. to move to the parent |
mkdir <directory> | Create a directory | mkdir projects | Choose clear names and locations |
cp <source> <destination> | Copy a file or directory | cp test.py projects/ | Take care not to overwrite the wrong file |
mv <source> <destination> | Move or rename a file | mv old.py main.py | Check the destination before moving |
sudo apt update | Refresh package lists | sudo apt update | Requires network access |
sudo apt full-upgrade | Upgrade installed packages | sudo apt full-upgrade | Review proposed changes before confirming |
Use sudo only for tasks that require administrator privileges. Do not routinely run development programs as the administrator account. Understand file ownership and permissions before changing them.
Networking and Remote Access
Connect through Ethernet for a simple, stable setup, or configure Wi-Fi with the correct network name, password, country, and wireless settings. An IP address is the network address used to reach a device. To inspect local information, run:
hostname -I
ip addr
uname -aUse the address shown by hostname -I when connecting from another computer on the same local network. DHCP may assign a different address later, so a hostname, router reservation, or documented address can make repeat access easier.
SSH provides secure remote terminal access over a network. From another computer, use:
ssh <username>@<raspberry-pi-ip-address>For remote desktop work, use a supported remote-desktop option when a graphical interface is necessary. Secure remote access with a strong unique password, regular updates, SSH key authentication where practical, and limited user accounts. Disable services you do not need and avoid exposing SSH or a remote desktop directly to the public internet. Prefer a VPN or another controlled access method for remote access from outside the home network.
Programming with Python
Python is a common beginner language for Raspberry Pi projects. A program is stored in a text file with a .py extension. Create a file in a text editor or integrated development environment, save it, and run it from the terminal:
python3 hello.pyCore ideas include variables for storing values, data types such as strings, integers, floating-point numbers, and booleans, conditionals for decisions, loops for repetition, functions for reusable behavior, imports for using libraries, and error handling for expected failures.
name = input("What is your name? ")
for count in range(3):
print("Hello", name, count + 1)
try:
number = int(input("Enter a number: "))
print(number * 2)
except ValueError:
print("Please enter a whole number.")Keep project files in a named directory. Run small tests frequently, read error messages from the bottom upward, and change one thing at a time. Hardware programs should also clean up GPIO resources when they finish.
GPIO Fundamentals
GPIO means General Purpose Input/Output. GPIO pins allow software to read signals from inputs or write signals to outputs. A digital output is usually set to HIGH or LOW. A digital input reads a state that represents HIGH or LOW.
Physical pin numbering identifies a header position. BCM numbering identifies the processor's GPIO number. These are different systems. Select one convention and use it consistently in the code, wiring notes, and diagram.
| Physical header pin | BCM GPIO identifier | Common alternate function | Example use |
|---|---|---|---|
| 1 | Not a GPIO | 3.3 V power | Power for a compatible low-current module |
| 2 | Not a GPIO | 5 V power | Power only for devices designed for 5 V; never as a GPIO signal |
| 6 | Not a GPIO | Ground | Common electrical reference |
| 11 | GPIO 17 | General-purpose digital I/O | LED output or button input |
| 13 | GPIO 27 | General-purpose digital I/O | Switch or sensor signal |
| 3 | GPIO 2 | I2C SDA | I2C data line |
| 5 | GPIO 3 | I2C SCL | I2C clock line |
| 19 | GPIO 10 | SPI MOSI | SPI data from controller |
| 21 | GPIO 9 | SPI MISO | SPI data to controller |
| 8 | GPIO 14 | UART TX | Serial transmit |
| 10 | GPIO 15 | UART RX | Serial receive |
| Pin type | Typical role | Voltage or signal guidance | Safety warning |
|---|---|---|---|
| 3.3 V power | Power compatible modules | Regulated 3.3 V supply | Do not short to ground or draw more current than allowed |
| 5 V power | Power suitable peripherals | Board supply voltage | Never connect 5 V to a GPIO signal |
| GPIO input | Read a switch or sensor | Use 3.3 V-compatible signals only | 5 V input can damage the Pi |
| GPIO output | Control an LED or logic input | HIGH is approximately 3.3 V | Do not drive motors, relays, or high-current loads directly |
| Ground | Return path and shared reference | Connect circuit ground to Pi GND | Missing common ground can produce unreliable readings |
A breadboard is a reusable prototyping board. Jumper wires connect the Pi to breadboard rows. A resistor limits current; an LED must have a current-limiting resistor in series. Pull-up and pull-down resistors give an input a defined idle state instead of allowing it to float. The circuit and Pi must share a ground connection.
Project 1: Blink an LED
Use BCM GPIO 17, physical pin 11, as the output. Connect GPIO 17 to one side of a resistor, connect the resistor to the LED's anode, and connect the LED's cathode to a ground pin such as physical pin 6. The anode is normally the longer leg; the cathode is commonly the shorter leg or the side with a flat edge. Confirm the component markings before powering the circuit.
from gpiozero import LED
from time import sleep
led = LED(17)
try:
while True:
led.on()
sleep(1)
led.off()
sleep(1)
except KeyboardInterrupt:
led.off()Save this as blink.py and run python3 blink.py. Stop it with Ctrl+C. The GPIO library uses BCM numbering in this example. The resistor protects the LED and limits the current drawn from the GPIO pin.
Project 2: Button-Controlled LED
Connect a push button between BCM GPIO 2 and ground. Configure an internal pull-up, so the input normally reads HIGH and changes to LOW while the button is pressed. Connect the LED circuit to GPIO 17 as in the previous project.
from gpiozero import LED, Button
from signal import pause
led = LED(17)
button = Button(2, pull_up=True)
button.when_pressed = led.on
button.when_released = led.off
try:
pause()
finally:
led.off()A switch can have multiple terminals whose electrical connections change when pressed. If the input always has one value, check the switch terminal layout, selected GPIO, common ground, and pull-up or pull-down configuration. Turn off power before moving wires.
Sensors, Actuators, and Interfaces
A sensor measures something, such as temperature, motion, light, distance, pressure, or humidity. An actuator causes an action, such as producing sound with a buzzer, switching a relay, moving a motor, or illuminating an LED.
GPIO pins are not general-purpose power drivers. A motor, relay coil, or other high-current load usually needs a transistor or driver board, a flyback diode where appropriate, and possibly a separate power source. A relay module must be compatible with 3.3 V control signals. Keep external power grounds connected appropriately, and never experiment with mains voltage unless you have specialist electrical knowledge and suitable certified equipment.
Common communication buses include:
- I2C: a two-wire bus using SDA for data and SCL for the clock. Multiple devices can share the bus when addresses do not conflict.
- SPI: a faster serial protocol commonly using clock, controller output, controller input, and one or more chip-select lines.
- UART: an asynchronous serial interface using transmit and receive lines. The transmit line of one device connects to the receive line of the other.
Enable I2C, SPI, UART, camera, or remote desktop only when required, using the operating-system configuration utility or desktop settings. Restart if requested. Then check the device address, overlay or interface setting, library, permissions, supply voltage, and wiring. A sensor may need level shifting if its signals are not 3.3 V safe.
Project Workflow
- Write the goal and measurable requirements. Decide what the project should sense, decide, display, or control.
- Choose a board and list every required part, including power, mounting, cables, and protection components.
- Draw the circuit and document physical and BCM pin assignments.
- Install the operating system, update it, and create a clean project directory.
- Test power and the operating system before connecting electronics.
- Run a minimal script, then test one component at a time.
- Combine tested components gradually and add error handling.
- Record dependencies, configuration choices, device addresses, wiring changes, and code revisions.
- Test normal operation and failure cases, then document the final build.
Incremental testing makes faults easier to isolate. Test the Pi alone, then a simple Python program, then one output, then one input, and only afterward combine sensors and actuators.
Maintenance, Reliability, and Troubleshooting
Apply operating-system and package updates safely. Keep backups of important files on another computer or storage device. For a reproducible installation, create a backup image of the microSD card when the system is in a known-good state, and test that the backup can be restored.
sudo reboot
sudo shutdown -h nowsudo reboot restarts the system. sudo shutdown -h now safely halts it. Wait for shutdown to complete before removing power. Avoid pulling the plug while files are being written.
| Symptom | Likely causes | Checks | Resolution |
|---|---|---|---|
| Pi does not boot | Bad image, failed microSD card, insufficient power, display issue | Check power, card, image, cable, and display input; disconnect nonessential peripherals | Use a suitable supply, reimage or replace the card, and test a known-good display or headless network access |
| Unexpected shutdowns, warning icons, or poor performance | Undervoltage, poor cable, overheating, high peripheral demand | Inspect power warnings, temperature, airflow, and connected devices | Use a suitable supply and cable, improve cooling, or use powered peripherals |
| SSH connection fails | SSH disabled, wrong IP, different network, bad credentials, firewall | Run hostname -I locally and verify network reachability and SSH settings | Enable SSH, correct the address or credentials, and connect over the same trusted network |
| Wi-Fi will not connect | Wrong credentials, weak signal, regional settings, unsupported band, access restriction | Check credentials, country settings, signal, router DHCP, and restrictions; test Ethernet | Reconfigure wireless, move closer, or use Ethernet while diagnosing |
| LED does not light | Reversed polarity, wrong pin convention, missing ground, bad mode, loose or damaged parts | Power down and verify pin number, resistor, LED direction, ground, and minimal code | Correct wiring or code and test with a known-good LED and resistor |
| Button always reads one value | Missing pull resistor, wrong wiring, wrong GPIO, misunderstood switch terminals | Check continuity, input configuration, selected pin, and printed readings | Add an internal or external pull resistor and correct the wiring |
| I2C or SPI sensor is not detected | Interface disabled, wrong wiring or voltage, wrong address, missing library | Verify bus settings, ground, supply, SDA/SCL or SPI lines, address, and documentation | Enable the interface, correct connections, install the required library, and use the correct address |
| Permission denied | Incorrect ownership, permissions, group membership, or need for elevated privilege | Inspect file permissions and ownership; identify whether the hardware access group is required | Fix the specific permission, use sudo only when necessary, and avoid administrator development workflows |
Course Progress and Learning Activities
Work through the course as a sequence of lessons, quizzes, assignments, project submissions, and reviews. A useful learning path is: boot and explore the desktop, update the system, connect through SSH, write a Python program, blink an LED, read a button, connect a supported sensor, and submit a documented automation project.
| Activity event | Meaning for learner progress | Typical next action |
|---|---|---|
| Enrollment | The learner has joined the course | Open the curriculum and begin the first unit |
| Course started or reset | The learning sequence has begun or been returned to its initial state | Review prerequisites and complete the next lesson |
| Unit completed | The learner finished a lesson or section | Attempt the quiz or continue to the next unit |
| Quiz attempted | The learner submitted answers for assessment | Review feedback and retry or continue according to the result |
| Assignment submitted | A project, report, code sample, or wiring evidence was sent for review | Check evaluation feedback and revise the work if needed |
| Evaluation recorded | An instructor or course system assessed submitted work | Study comments and apply improvements |
| Badge or certificate earned | A completion or achievement requirement was met | Save the record and continue practicing with a new project |
| Comment left | The learner added a question, observation, or reflection | Check for replies and update the project notes |
| Course update or announcement | Important information was posted for learners | Read the update and adjust the next task if necessary |
The learner activity area can filter announcements, course updates, completion events, submissions, evaluations, certificates, and related progress records. Use filters to locate recent feedback, confirm that a unit was recorded as complete, or review project activity.
Practice Projects and Assessments
- First boot and desktop exploration: boot Raspberry Pi OS, complete initial configuration, open the terminal, and confirm the system works.
- System update: run the package update commands and explain why updates should be applied before project development.
- Remote connection: find the Pi's local IP address and connect through SSH from another computer.
- Python hello world: create and run a script, then modify it to accept input or repeat output in a loop.
- Blink an LED: wire an LED with a current-limiting resistor and write a program that changes its output state.
- Button-controlled LED: read a button input, configure a pull resistor, and control an LED from the button state.
- Environmental monitor: connect a supported I2C sensor, read values in Python, and record or display measurements.
- Simple automation: combine a sensor, program logic, and an LED, buzzer, or suitable relay module while documenting electrical safety.
For each submission, include the board model, operating-system version, parts list, power arrangement, wiring diagram, pin-numbering convention, code, dependencies, test results, and known limitations. This documentation is part of reliable engineering, not an optional extra.
Key Exam and Review Notes
- A Raspberry Pi is a single-board computer; an Arduino is generally a microcontroller board.
- Raspberry Pi GPIO uses 3.3 V logic. A 5 V signal can damage a GPIO input.
- Physical pin numbers and BCM GPIO identifiers are not interchangeable.
- An LED requires a series current-limiting resistor.
- GPIO pins should not directly drive motors or other high-current loads.
- Inputs need a defined state, commonly provided by a pull-up or pull-down resistor.
- All parts in a low-voltage circuit normally need a shared ground reference.
- SSH is secure remote terminal access, and an IP address identifies a device on the network.
- Use
sudo apt updatebeforesudo apt full-upgradeto refresh package information before upgrading. - Shut down Linux before removing power to reduce filesystem and microSD corruption.
- Test power, software, and each hardware component incrementally before combining them.
After completing this course, continue with related study in Linux fundamentals, Python programming, networking, physical computing, electronics prototyping, sensors, robotics, and home automation.