I'm trying to setup an automated garden as a quarantine project for my mother and I can't really figure out how to properly wire a 12V 5-pin relay module as every tutorial online only shows the ones that come in a board (those are extremely expensive in my country). I have all the components needed: resistors of all types, the relays itself, a raspberry pi, a power source for everything, the lights I'm controlling and wiring; But I just can't find a way to put everything together and control the lights in my project! My objective is to be able to control the lights through the GPIO pins on the Pi.

This is the type of relay I'm using (ignore the voltage on the image, the seller has a bunch of models): picture of relays

  • 2
    See elinux.org/RPi_GPIO_Interface_Circuits Driving a relay. While this says 5V you can use any (reasonable) voltage that matches your relay. See also raspberrypi.stackexchange.com/a/105820/8697 – Milliways Oct 31 '20 at 23:00
  • I am a poor electronics hobbyist, making toys as cheap as possible. One of my projects is about relays. I did use relay modules which everything is assembled, I ALSO DIY RELAY MODULES FROM SCRATCH, because cheapy relay modules have no user guide, or very poorly documented, if not just misleading and plain wrong. Me home automation hobbyist, am building my own roof top garden with also sorts of actuators (motors, relays, solenoid, pumps, water/air flow meter, ... ), sensors (temp, humid, gas (for air quality control)). / to continue, ... – tlfong01 Nov 1 '20 at 1:48
  • 1
    I can try to design and draw you a schematic of the kind of relay module in mind. You might like to tell me your experience, say, can you use Arduino/Rpi/STM32/)M3/M0 to blink a LED, use opto couplers, preference over NPN/PNP (eg 2N2222), N/P-Channel MOSFET (eg 2N7002, IRL540N). python (Thonny/circuit/micro). I have a tutorial on using all sorts of relay/modules. You might read my relay tutorial: electronics.stackexchange.com/questions/505318/…, and tell me which module in my answer fits your needs. Cheers. – tlfong01 Nov 1 '20 at 2:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.