-
Notifications
You must be signed in to change notification settings - Fork 3
4. Hardware Guide
- You're gonna need
constant power
to the Pi. Any power source that you can rely on will do. You'd need to power on the Pi using theUSB-C
port on it. I have my main Internet router plugged into a UPS, so I have that on 24/7. The router has a USB Port and so I used that to power up the Pi. It works just fine. - To use the pins on the Pi, I used a set of female to male jumper wires (This isn't the exact one I bought since I never buy from amazon myself). These wires will usually go from the Pi itself to the
breadboard
so that everything is a bit more tidy. - The
GPIO Pin
used to control the relay in the script is GPIO Number (TBD) which is the (TBD) one in the physical board itself. - The Raspberry Pi will be used to power up the relay. For that we're going to use both the
5V GPIO pin
, and the3V3
one.
This section will contain everything you need to know to wire everything up from the Raspberry Pi
to the relay
In my case, I bought this specific relay from this specific store in my country. Now this relay is a 4 Channel opto-isolated relay
. This basically means that it can control 4 different devices
at the same time. In this project, we're controlling 1 device only so far. I just figured I'd buy a 4 channel one so we can control more devices later on.
The relay that I've bought is an "Active LOW"
relay. This means that whenever you give it a LOW
signal, the relay switches on. And whenever you give it a HIGH
signal, it switches back off. The only problem with that is that while the Pi is booting up, before it gets to run the script itself, the relay switches on. The workaround for this is to find the right IC (Maybe an NPN Transistor
) to put before the GPIO pin reaches the Relay pin so that this doesn't happen. The solution, on the other hand, is to find an "Active HIGH"
relay instead. But oh well.
Please do keep in mind that working with high voltage electricity can cause serious injuries. Be careful while wiring! Please follow the guide HERE on youtube so that you don't make any mistakes.