1

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.

Cheers!

nhaus
  • 73
  • 1
  • 6

2 Answers2

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.

Milliways
  • 62,573
  • 32
  • 113
  • 225
-1

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.

PMF
  • 906
  • 7
  • 14