The_Official_Raspberry_Pi_-_Beginner’s_Book_Vol1,_2018 (1)

(singke) #1
Chapter 6 Physical computing with Scratch and Python 123

THE OFFICIAL RASPBERRY PI BEGINNER’S GUIDE


Jumper wires, also known as jumper leads, connect
components to the Raspberry Pi and, if you’re not using
a breadboard, to each other. They are available in three
versions: male-to-female (M2F), which you’ll need to connect
a breadboard to the GPIO pins; female-to-female (F2F), which
can be used to connect individual components together if
you’re not using a breadboard; and male-to-male (M2M), which
is used to make connections from one part of a breadboard
to another. Depending on your project, you may need all three
types of jumper wire; if you’re using a breadboard, you can
usually get away with just M2F and M2M jumper wires.


A push-button switch, also known as a momentary
switch, is the type of switch you’d use to control a games
console. Commonly available with two or four legs – either
type will work with the Raspberry Pi – the push-button is
an input device: you can tell your program to watch out for
it being pushed and then perform a task. Another common
switch type is a latching switch; whereas a push-button is
only active while you’re holding it down, a latching switch –
like you’d find in a light switch – activates when you toggle
it once, then stays active until you toggle it again.


A light-emitting diode (LED) is an output device; you control it directly
from your program. An LED lights up when it’s on, and you’ll find them
all over your house, ranging from the small ones which let you know
when you’ve left your washing machine switched on, to the large ones
you might have lighting up your rooms. LEDs are available in a wide
range of shapes, colours, and sizes, but not all are suitable for use with
the Raspberry Pi: avoid any which say they are designed for 5 V or 12 V
power supplies.


Resistors are components which control the flow of electrical
current, and are available in different values measured using
a unit called ohms (Ω). The higher the number of ohms, the
more resistance a resistor provides. For Raspberry Pi physical
computing projects, their most common use is to protect LEDs
from drawing too much current and damaging themselves or the
Pi; for this you’ll want resistors rated at around 330 Ω, though
many electrical suppliers sell handy packs containing a number of
different commonly used values to give you more flexibility.

Free download pdf