I am very new to all of this, so please excuse if this is a very basic question.

I am trying to power a tiny water pump with my raspberry pi. For that I need the 3.3V or 5V output, because the GPIO pins do not supply enough current.

In order to control it nonetheless, I decided to go with a 5V relay (this one).

I looked up tutorials online (e.g. this one) how to wire up the relay. The specify that the VCC should be connected to the 5V, which makes a lot of sense to me, because after all it is a 5V relay. The problem is, that if I wire it up like that, I cannot control the relay with a GPIO.HIGH command.

However, if I plug the VCC into the 3.3V output and change nothing else, everything works exactly how it is supposed to work.

So I was wondering if someone could explain to my why I am observing this behavior and if it is wrong or dangerous to power the relay with 3.3V like I am doing right now.



2 Answers 2


These (appalling designed) modules are controlled by a PNP transistor connected to 5V.

They can only be controlled by 5V - which requires an external transistor (which kind of negates the point of a module because you could just control the relay directly).
See Can you use a 5V Relay Module with the Pi?

Some claim they can be used with 3.3V - but the relay manufacturer claims 5V, so operation will be unreliable.

NOTE the Instructables link is WRONG and dangerous (these are often questionable and anyone can post misleading "instructions").

The reason it doesn't work is when GPIO is HIGH there is 5-3.3V i.e. 1.7V across the transistor B-E junction which is more than enough to turn the transistor on.

Even if it worked, putting 5V on a GPIO risks damaging the Pi. The substrate diodes provide some protection, but are not rated to carry any current and will eventually fail.

  • Thanks for you answer. I did some more research and was wondering if you could quickly confirm if I understand everything correctly. If I buy a different Relay (this) and I hook up the 5V from the RPi to the normal VCC, while also using the VCC - JD-VCC jumper. I should be able to control the relay with the 3.3V from the GPIO.
    – nhaus
    Feb 13, 2021 at 22:52
  • @nickhir it is very difficult to comment on a device with no published circuit and minimal specifications and without more specific detail of what you are proposing (which should be edited into your Question) I can say no more than in the referenced Answer. If there is any path from 5V to GPIO you risk damaging the Pi.
    – Milliways
    Feb 13, 2021 at 23:26

This behavior is, in fact, a bit unusual, since most devices would recognize 3.3V as high, even if the power supply is at 5V. But it seems this is not the case here. That's not a big problem, though. If it works at 3.3V and the relais is (as I expect) properly separating the control side from the switch side you're all set.

  • Its actually pretty common, the behavior comes from that circuitry that protects the relay, they usually use some sort of opto-isolator. And this circuit expects a HIGH signal to be close to VCC, so by lowering VCC to 3.3V, then an input of 3.3V is read as HIGH, whereas if VCC is 5V then 3.3V doesnt always read as HIGH.
    – Chad G
    Feb 12, 2021 at 16:21
  • I don't know about different relays, but for most pieces, this is not the usual behavior.
    – PMF
    Feb 12, 2021 at 18:41
  • Can you post a simple schematic as you have it wired and links to each of the hardware items.
    – Gil
    Mar 24, 2022 at 0:50
  • @Gil There are readily available modules such as the one linked in the question from different vendors. They also come with the corresponding documentation on how to wire them and with example code.
    – PMF
    Mar 24, 2022 at 6:17
  • This would be easier if you just used a Raspberry Pi relay hat.
    – NomadMaker
    Jul 21, 2022 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.