So, I got a Raspberry Pi and immediately wanted to make it do something. A quick trip to ebay and I had a traffic signal and a popular relay module. The relay module didn't have any documentation, so I made the assumption that setting a GPIO pin to high would get my relay clicking, right? Wrong!
- this is the 4 channel, I got an 8 channel, but they're very similar.
For starters the relay is triggered when the voltage on the GPIO line drops near zero, this is the LOW setting in the WiringPi library. Also, the relays are 5V, and Raspberry Pi is 3.3v on GPIO, using 3.3v makes the relay click, but people on the internet that are smarter than me said something about increased load and breaking my tiny new computer.
In a little documented stroke of luck the relay module has a separate loop to power the relay coils, that is the electromechanical part that makes the relay switch, and the Pi has a +5V pin to supply power directly from the USB power source. The 2 standalone pins on the relay module marked VCC and ground should go to the Pi's +5V and Ground pins. Now hook the 3.3v to the signal VCC, and the inputs to whatever GPIO pins you like.
When you set a GPIO pin to low your relay should click on and the indicator LED should light up. No go forth and wire the Pi to something dangerous and cool. I made a stoplight to let us know the status of our CI Server.
all lights on in party mode