Hardware Reference
In-Depth Information
Figure 4-14.
Raspberry Pi, converter board, and relay board (on left) connected to housing with electrical outlets
(on right)
The relay board connects to two pairs of power outlets just like the ones in your wall,
which you'll use to plug in your light strands.
Connect the Hardware
While you could build your own separate relay controllers, plenty of vendors sell pre-
made relay control cards with one, two, four, or eight relays on one card for less than
it would cost to do it yourself. (That always hurts to say when you love to DIY, but
sometimes it really is easier to just buy built.)
Then you just have to control the relays from the Pi. You'll find both 5 V and 12 V relays
for sale. Avoid the 12 V ones, which will require more level shifting as well as a second
power supply. With a 5 V relay, all you'll need to add is a 3.3-to-5 volt converter for the
Raspberry Pi GPIO pins. Level converter boards are also readily available online from
vendors like Adafruit and DX.com.
A level converter actually has several converters in one board: 5 V power, 3.3 V power,
ground, and four signals going in and four signals going out. Converting the signal
from 3.3 V out of the pins into the 5 V that the relay requires provides the necessary
power to the relay while grounding the signal so it doesn't fry the Raspberry Pi.
Do not use the 5 V power from the Raspberry Pi to power the relays. You could burn
out your Pi.
 
Search WWH ::




Custom Search