I use PI 4 to power two 3v relays. One is controlling 5v dc, another 12v dc. And about once a minute I am switching each relay signal state to On/Off So each relay is connected to 3v pin, ground pin and signal GPIO on the PI. Do I need to put some protection, like resistors, diodes on the board? What exactly? Or is this setup safe? I tried to google the answer but did not find any information on pi+3v relays My relays are these ones

Here is my board attached. enter image description here

Thank you in advance!

  • 1
    The only thing I can add to the answers you have is this: In general, you should avoid buying electronic components from vendors who do not provide a spec sheet. The information provided on the Amazon seller's page is incomplete and unreliable. When driving anything directly from a GPIO pin, you should know how much current is required. This due to the fact that the GPIO gates are rather wimpy, and poorly documented.
    – Seamus
    Dec 29, 2020 at 21:24

2 Answers 2


The relay modules contain all the protection needed for the Pi. There is no need to do anything else to protect the Pi.


No one can say because the linked page has ABSOLUTELY NO specifications.

Caveat emptor!

Using a relay AND an opto-isolator is NONSENSE and indicates whoever "designed" the module has little experience or understanding of circuit design. The opto-isolator just adds inefficiency.

  • Though isolation is not required, why not use an opto instead of a transistor? The difference in efficiency is negligible as the relay coil is the major factor. Those few mA required by the opto are much less than the coil current.
    – Sim Son
    Dec 31, 2020 at 22:53
  • @SimSon you need ~15mA to drive an opto-isolator, which is close to the GPIO per pin max and uses a significant part of the 50mA total available AND you need a transistor to drive the relay.
    – Milliways
    Dec 31, 2020 at 23:12

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .