Data Sheet
UCTRONICS Ultimate Starter Leaning Kit for Raspberry Pi #K0064
66 www.uctronics.com
8.5 Project 5: Relay
8.5.1 Overview
In this lesson, we will learn how to control a relay to cut off or connect a circuit.
8.5.2 Requirement
Raspberry Pi ×1
Relay ×1
NPN Transistor (S8050) ×1
Diode (1N4001) ×1
1KΩ Resistor ×1
Breadboard ×1
Several Jumper wires
8.5.3 Principle
1. What’s relay ?
Please refer to chapter 3.16 Relay
2. Working Principle
When an electric current is passed through the coil it generates a magnetic field that
activates the armature, and the consequent movement of the movable contact(s) either
makes or breaks (depending upon construction) a connection with a fixed contact. If the set
of contacts was closed when the relay was de-energized, then the movement opens the
contacts and breaks the connection, and vice versa if the contacts were open. When the
current to the coil is switched off, the armature is returned by a force, approximately half as
strong as the magnetic force, to its relaxed position. Usually this force is provided by a spring,
but gravity is also used commonly in industrial motor starters. Most relays are manufactured
to operate quickly. In a low-voltage application this reduces noise; in a high voltage or
current application it reduces arcing.
When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would
otherwise generate a voltage spike dangerous to semiconductor circuit components.