PSU Control relay won't switch off

ok, i was testing and I think I did understand the problem, even if I dont have enough knowledge to solve it. From my testing my relay signal has around 4.5v and my raspbery pi switch between 0v and 3.3v... the relay should not have any voltage or it should be 3.3v?
If I could buy a 3.3v relay from ebay it should work?
thanks!

Not that I've done this particular project but it sounds like brandon was suggesting a reversal of the logic. In theory, anything less than 2.5V then would not trigger the relay. Anything above that would trigger the relay (to include the Raspi's 3.3V high logic level). At least that's my take on what he wrote. But this might require checking some box in the plugin's setup.

Perhaps opening a dialog on the plugin author's repository might help.

so, after some search about "raspberry pi relay" I could find this video : https://www.youtube.com/watch?v=My1BDB1ei0E
as he said on the video i test the relay with 3.3v in the VCC instead of the 5v and... it works!
for others with the same problem and probably the same relay from ebay try to use the 3.3v pin instead of the 5v from the RP.
My PSU Control settings for reference (i used pin 3 INVERTED for signal, pin 1 (instead of 4) for VCC and pin 6 for ground) :

3 Likes

Thx this helped me <3

Just a little conclusion for me. If the relay doesnt switch i have two options

  1. modify the relay board to work with RPI 3.3V GPIO pins https://github.com/foosel/OctoPrint/wiki/Controlling-a-relay-board-from-your-RPi

or
2.Solder the circuit with the transistor and the resistor like shown here, https://gpailler.github.io/2018-03-02-octoprint-psucontrol/ (better and safer)

is this right?

I Solder the solution from gpailler, the relay is switching, i hear it clicking but the Energy didnt switch. Any Troubleshootings

I had same issue spent about 4 hrs trying, but after I saw this post and Transistor I checked signal wire from GPO 21 which is the pin I am using and ON voltage is 3.3 volts and OFF voltage is 0 volts when relay is disconnected, so is working so maybe relay is causing feedback so will try the transistor mod later ..

John

directly connecting a relay to GPIO is a bad thing that is very bad and will probably kill that GPIO pin, and if you're really unlucky, nuke the entire pi

why, I hear you ask?

a) the relay probably draws more current than the GPIO pin can provide
b) if it does succeed in driving the relay, switching the relay off will cause the magnetic field in its coil to collapse. this generates a massive voltage spike back to the GPIO pin. so you MUST connect a diode across the relay to absorb the spike

relay drivers have all this circuitry so really, very really, use one

HTH YMMV

THX! this was the solution to my problem as well. I created the transistor circuit but it didn't work for me. This did and I am grateful to you!

1 Like

Thank you! this worked for me aswell!!

1 Like

I made an account specifically to say thank you Seltix, your solution worked for me! :grinning:

2 Likes

happy to know, thanks :smiley:

Had the same problem couldn't get the relay to switch. Seltix's post put me on the right track and now it works for me thank you.

1 Like