Week 2: Raspberry PI with multiple LED

Introduction: This week you will be working with LED’s. You will connect 4 LED’s at once. This is a great beginner activity to get familiar with the Raspberry PI as well as how to code using Scratch.
Parts Needed:
You will need the following parts:
⦁ 1x Breadboard
⦁ 1x Raspberry Pi
⦁ 4x LEDs
⦁ 4x 330 Ω or 220 Ω Resistors
⦁ 6x Jumper Wires
⦁ Hardware Hookup
Ready to start hooking everything up?
Important Information:
Before we can start you will need to learn some basics.

Circuit Symbols

LED or Light Emitting Diode

The legs of the Led are not the same. One is longer then the other. The longer LED is the Anode and the shorter one is the Cathode.

Scratch BlockS

These are the 3 blocks that you will use the most.

Circuit Diagram:
Connect the Lightbulbs to GPIO 2, GPIO 3, GPIO 4 and GPIO 5. See last page for pin Locations. (Red Wires)
Connect GND (Ground) on the Raspberry PI to GND on the breadboard. (Blue Wires)

Programming Code


What You Should See


You should see all the LED’s blink. If they aren’t, make sure you have assembled the circuit correctly and uploaded the correct code, or see the troubleshooting section.


Real World Application:
Scrolling marquee displays are generally used to spread short segments of important information. They are built out of many LEDs.


CHALLENGES:
Make a traffic light with the Red, Yellow, Green LED’s. Make the Green LED on for 5 seconds, the yellow for 1 and the Red for 3.

Lesson Content