Third Eye Visions

Setting Up Your Raspberry Pi For Python GPIO Projects

The Raspberry Pi is a great tool to get started with electronic tinkering projects. It's inexpensive, runs a full-fledged Linux operating system, and has I/O pins that can be used to control other electronic devices. This quick guide will walk you through the initial setup from unboxing your Raspberry Pi, to installing the Python GPIO library.

This guide assumes that you are using Linux to setup your Raspberry Pi (hereafter called RPi). The RPi itself runs Linux, and the basic skills and commands you learn will become very valuable later once you are up and running.

What You'll Need:

Step 1: Installing the Raspbian Operating System Using Linux

The first step to setting up you Raspberry Pi is to install the Raspbian OS image from the Raspberry Pi website onto your MicroSD card. Before starting, be sure that your Micro SD card is clean with no existing partitions. If you have trouble with these steps, or are using an OS other than Linux, you may find detailed installation instructions in this quick start guide. Return here after you have installed the Raspbian image onto you SD card.

Step 2: First Boot - Configuration Options

Insert the SD card into your Raspberry Pi along with an ethernet cable/WiFi adapter, keyboard, and mouse. Connect the HDMI or composite cable to your TV/monitor, and turn it on. Make sure that your TV/monitor is set to the correct input. Finally plug in the RPi into the AC adapter to power it up.

On the first boot, you will be confronted with a configuration screen. You may want to make the following changes, at a minimum:

If you ever need to re-run the configuration options panel, use the following command: sudo raspi-config

Step 3: Optional - Setting Up Your WiFi Adapter

If you are planning to connect to the Internet using an ethernet cable, you can skip this section. This section will walk you through the process of connecting to your WiFi network using a WiFi adapter. Please note that you will need to purchase a separate WiFi adapter such as the ... The RPi does not have a built-in WiFi adapter.

Step 4: Installing The Python GPIO Library

If you're like me, you bought your RPi to "control things" using the I/O pins on the RPi. Using Python and the RPi GPIO library, you can do just that. Python should already be installed on your RPi, and it takes just a minute to install the GPIO library:

Important: You must be a superuser to run scripts that control the GPIO pins on your RPi. If you are using the IDLE IDE to write your Python scripts, be sure to launch it as a superuser. Open the terminal and type sudo idle to launch the IDLE IDE as a superuser, otherwise any scripts that utilize the GPIO library will not work.

Time For Your First Project

Now that you have everything setup, you are ready for your first project. Click here to for a very easy tutorial that will teach you how to turn an led on and off using Python.