Can't get relay module to work with Octoprint

I am trying to make a 12V 10A 8ch relay module work to control LEDs with octoprint, but I can't seem to make it work. The LEDs work fine when connected to the 12V PSU. The LED work fine when its connected to the relay with NC, but I can't control it via GPIO, no 'clicking' sounds from magnets. And nothing works when connected via NO. I have the DC+ on the Pi 5V, the DC- on GRND, and the IN1 on GPIO14

I've tried all sorts of combinations in Octoprint, I think I tried them all. Every combination of high/low in the GPIO Control plugin, nothing would make the sound of the magnets (enabling/disabling of relay). The LED would change however, when pressing on or off in Octoprint on the relay.

Octoprint 1.6.1, OctoPi 0.18.0, Raspberry Pi 3B+, Printer : Geeetech A30T
Relay module link - https://www.amazon.com/gp/product/B08RRY15Z4/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
PSU Link - https://www.amazon.com/gp/product/B0109IMRPS/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1

I even tried connecting the DC+ and DC- to the 12V PSU, after it never worked when connected to the Pi's 5V, and that also didn't show any positive/negative results. Any help would be appreciated.

From the product page linked:

Trigger Voltage(HIGH): 4.5 - 12V

The Pi can only output 3.3v on the GPIO, you need a relay with a lower trigger voltage or some way to increase the voltage after the GPIO pin using a level shifter or something.

1 Like

I greatly appreciate this info, I even got a replacement thinking the first one was faulty :man_facepalming:. It is my first time working with a relay module. I assumed the "trigger current" was the important part :man_facepalming:.

Edit : I need to do more research and not rush. Is there a way to narrow down trigger voltages? Seems like its always down in the specs and not the titles. Not sure if a 3.3V 12V exists

Hi sorry for the double post, but could you explain why my 5V relay module (https://www.amazon.com/gp/product/B08RS9LRH2/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&th=1) works fine but the 12V relay does not? The 12V has a Low trigger of 0-4V, but I did try setting it to Low on the first 12V relay, but I don't remember if I tried it on the replacement. But it sounds like if the 5V relay works, the 12V should also work while set to low?

The 5V relay has these specs:

Trigger Voltage(LOW): 0 - 1.5V
Trigger Voltage(HIGH): 2.5 - 5V

The Pi's 3.3v fits into the HIGH range there to trigger the relay.

The problem you are having with your 12V relay is that the signal is always staying in the low side since it cannot go above 5V into the HIGH trigger section.

2 Likes

But if the LED are 12V and the PSU is 12V, I don't get how that works in the 5V relay module but doesn't in the 12V module when set to "Low". Isn't the High/Low like a good/bad toggle, and that if I set the 12V relay module to "low" it should allow the 3.3V from the Pi to trigger it? Or for some weird reason is it 'requiring' the module be set to "High" and that I am just not getting something. But from my understanding the High/Low is just a convenience/safety toggle

No. They're just the two states - like ON and OFF.
When the relay has a LOW trigger of 0-4V it means you need at least 4.1V so it is able to detect the other state.

1 Like

But then why is there even a little high/low jumper, if it is useless and serves no purpose? I thought the purpose of the jumper was to select which state decides what is on/off :thinking:. But if High is On, regardless of where the jumper is, why is it even a thing. Sorry for asking something that is kinda offtopic of Octoprint

Some relays can be configured to be either normally closed or normally open.

That means it can be configured to be active when the trigger is LOW or to be active when the trigger is HIGH.

I guess that's what the jumper is for.

1 Like

I agree with @PrintedWeezl here - if we think about this logically about how you want it to work, then when set in 'LOW' mode the trigger voltage is 0-4V. So how do we know when the relay should be off? If the signal is removed, then the voltage will be around 0V, but this is still in the range of trigger voltages so the relay will never change state. So the only way that it would not be triggered is if signal is above 4V, and we are back to square one with 'the Pi can't output that'.

2 Likes

Obviously there are several different designs, the ones I've seen have a jumper which gives the option of providing power to the relays either from the same supply that powers the isolation circuit (Vcc) or from a separate supply (VccSel). Generally it's a good plan to keep all that nasty relay noise off the main bus.

2 Likes

To all,
You need 3.3V relays.
You can try 5v relays but put DC IN on 3.3V on raspi.
It will work but could drain too much power.

Hello @dum !

As it was stated already here in the solution:

As previously noted it's possible to separate Vcc to the optoisolator curcuit and power to the relays. No reason not to use 3.3v form raspi to drive isolation electronics and whatever the relays are rated for. Obviously that need and additional supply but at least it keeps any relay noise away from the raspi.