Professional Documents
Culture Documents
Objectives
Part 1: Setting up the Prototyping Lab with the Raspberry Pi
Part 2: Set up the python code
Background / Scenario
In this lab you will learn more about how the Raspberry Pi can be used to write an application
that interacts with external electronics using the GPIO ports on the Raspberry Pi. In Part 1, you
will build the circuit with an external RGB LED that is connected to the GPIO ports on the
Raspberry Pi. In Part 2, you will create a program, using Python that will blink the RGB LED
when uploaded and run on the Raspberry Pi.
Required Resources
It is important to know how the GPIO pins on the Raspberry Pi are numbered and accessed. The
Raspberry Pi 3 model B uses 3 different pin numbering schemes described in the figure below.
Pi 4 should be same. The recommended one is the BCM pin numbering scheme:
Step 1: Build the prototyping circuit on the breadboard.
Note: The Raspberry Pi should not be powered on when building the prototyping circuit.
You will need the pinout for the RGB led. This has 4 legs on it and it contains 3 colors
within the LED, RED, GREEN, and BLUE. One of the legs is the “common” leg that will be
connected to “ground” on the RPi.
On this example, the common lead is pin 3, which is the longest lead (or leg). Your RGB led
should be the same. The other 3 leads will be attached to pins 23, 24, and 25 on the RPi
and you will control turning them on or off with python code.
Step 2: Complete the prototyping circuit by connecting it to the Raspberry Pi.
Note: The GPIO pins on the Raspberry Pi are male. If available, use male to Female jumper wires
to connect from the breadboard to the Raspberry Pi. Otherwise, use the GPIO ribbon cable,
provided in the starter kit, to convert the GPIO pins to female connectors.
1. Connect one the lead/legs of the RGB LED to the pins on the RPi as shown in the
picture below. The pins are BCM 23, 24, and 25.
2. Connect the common lead/leg to the ground pin, physical pin 20 one on the
Raspberry Pi.
Blue – pin 25
Green – pin 24
Red – pin 23
Please double-check before you start your system. You don’t want to burn the LEDs or the
Raspberry Pi.
If LED is not blinking, check your wiring and also check your python code for any errors.