PC/CP320 Physical Computing

Raspberry Pi GPIO Introduction


  1. To introduce the Raspberry Pi
  2. To become familiar with Raspberry Pi GPIO pins and numbering
  3. To learn shell commands for interacting with Raspberry Pi GPIO pins





The Rapsberry Pi GPIO pins can easily be damaged with improper handling. For this lab, you will not be connecting anything other than a meter to the GPIO pins.

  1. Raspberry Pi Connections

    Connect the USB keyboard and mouse, and the monitor using the HDMI-to-VGA adapter.

  2. Insert the micro-SD card, and plug the USB power connector into the board.

  3. When you plug the adapter into the wall, the Pi should boot up. Early on you should see a rainbow screen, and it should end with a command prompt.
    Show successfully booted Raspberry Pi to the lab instructor.

  4. The default login to the pi is "pi", and the default password is "raspberry". For now, don't change these!
  5. GUI and wifi

    When the pi is booted and you are logged in, type
    to launch the graphical user interface.

  6. From the menu, you should be able to select wifi, and be able to connect to eduroam.

    You should now be able to open a browser and access this web page. Show this to the lab instructor.

  7. You can now open a terminal so that you can leave the GUI open and still work at the command line.
  8. Identifying GPIO pins

    Identify pins GPIO17 and GPIO18 according to the Broadcom numbering scheme. Which pins are they in the board numbering scheme?
    Show identified GPIO pins to the lab instructor.

  9. Using the shell to control GPIO pins

    Accessing GPIO pins from user space
    Set up pin GPIO18 for output, and use the voltmeter to show that you can set it HIGH and LOW.

  10. Set up pin GPIO17 for input, and connect it to GPIO18. Change the state of pin GPIO18 and see that that is detectable by GPIO17.

    Demonstrate outputting to and inputtting from GPIO pins to the lab instructor.

  11. When you are done, shut down using
    sudo shutdown -h now
    When shutdown is complete, you can disconnect power, and put everything away. Be sure to reconnect the display, keyboard, and mouse to the computer.


To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

(Level AA)

Wilfrid Laurier University