Trying to switch a relay for lights with the octopus
I found this reddit post where someone uses the exact same relay module as me and it works. Only thing is his uses marlin. https://www.reddit.com/r/BIGTREETECH/comments/s2b9t5/switch_a_relay_with_the_octopus_v11/
No matter what I do the module is always on. Ive tried 5v rails/ 3v rails. Same outcome always. The weird thing is if I dont plug the input cable in, the relay is off, or if I plug it into an unregisterd pin its also off. But as soon as i register the pin. Its on always. Now i tried with endstop pins
[output_pin my_pin]
pin:PG11
value: 1
shutdown_value: 0
Reddit
From the BIGTREETECH community on Reddit
Explore this post and more from the BIGTREETECH community
76 Replies
have you tried putting
!
in front of the pin to invert the logic?
yep and it dosent do anything
its still on
think i could run them off a fan header?
they are 12v leds and pull about 2.3a
Mine are off a heater header
mine are 12v. Can you change the voltage on those?
Ah, mine were 24V sorry
Run two in series?
i have 3=))
the fan mos datasheet says this
Continous Drain Current
4.6 to 5.8 A
and the 12v buck datasheet says this
The AOZ1284 works from a 3.0V to 36V
input voltage range, and provides up to 4A of continuous
output current.
Sounds like that should work, and bypass the relay entirely
Oh, did you ever check that the pin was changing value when you turned the lights on/off in ratos?
and the 12v psu
yeah i did
it dose change
But the relay just didn't care, gotcha
which is why i think its a software issue
Wait, what?
only after i designate the pin in printer.cfg dose it turn on
If the pin changes like you expect why do you think it's software?
because if the pin is not designated the module dosnt turn on. But once it is its on alwasy
and if i change state high or low
nothing
votlage changes
but it dosnt turn off
i think this gives current [output_pin}
So in ratos you're telling it to turn on and off, and the voltage at the pin is changing from zero to some voltage, right?
yes
the module need 150ma to turn on
Then why are you blaming software?
Sounds like it's doing exactly as expected
cuz in marlin it works
and klipper it dosnt
You have marlin running on your octopus?
nope:))
the guy on reddit does
i posted a link to it above
If the voltage at the pin is changing when you tell it to in klipper, then it is working as expected
weird thing is if i add voltage to it manualy
it dosnt turn on
So the relay is broken?
give me 2 min i have another one
changed it with a fresh on thats in the bag and it behaves the same
the module for the input only says it needs current on the input to trigger
[output_pin] dose something that makes it be always on
Feels like there is some basic electronic troubleshooting I'm struggling to think of from here
im a try the fan headers and see whats up
Good luck!
well it works:))
now to see how long it will work
@D00M-_ You probably need to connect the grounds of your buck, 24v psu and relay/mosfet.
How did you connect everything?
Hi mikl!
Ive tried multiple combinations. Module has 3 pins. VCC, GND, IN.
VCC to a 5v pin, GND to a GND pin, and IN to a pin with that can be designated.
Also tried to do an open collector as you suggested in another post. https://discord.com/channels/582187371529764864/843098069200666634/863527623024050176
All that did was turn the whole relay module off and on. But it wouldnt switch states
in this configuration, the relay is always on. When the pin is designated with [output_pin]
if i undesignat it it turns off
the [output_pin] does change the voltage of the pin
if i add 5v manually to the IN pin nothing happens
I i connect the module to a rpi that is not running klipper/ratos the module runs as intended
Ive also tried to run it off the rpi with GPIO pin for input and same story happens. As soon as I designate with [output_pin] the relay is always on
So your problem is that the relay is always on even when the pin in is low ?
Maybe you need a pull down resistor on the pin
I got this on some Arduino if I don’t place a pull down resistor there are Creep currents
Does it assume a 5V signal? Your gpio's operate at 3.3V, which won't work.
You'd need a level shifter
That doesn't make sense to me
I literally followed this guide and it worked
The Raspberry Pi Guide
Control electronics using a relay
A collection of tutorials to help set up and work with your Raspberry Pi
And yes it dose work from a gpio
You can do this in klipper too (
rpi:
as pin prefix)i have and it behaves the same
on always
That makes no sense
ikr=))
there is no difference
as soon as i designate it
its always on
When you specify the pin as an output_pin it is set to whatever
value
you configured for that pin. By default output_pin's can only be 1 or 0 (low or high).
But it's doing the exact same thing as the python codei n your link.in theory yes
but in practice even on low
its still on
as measured?
yes
with a multimeter
but then with a different setup, on the same pin, with the same voltage, the relay works correctly?
yes
So the voltages on the pin is the same, the 5v and gnd connections are the same, but it behaves differently? There's something missing 😄
5v is to power the relay
gnd is gnd
and the input pin is for signal
yeah, i'm going back to my earlier "there is some basic electronic troubleshooting I'm struggling to think of from here"
gnd is how the signal returns to the MCU that controls it. If the signal doesn't have a return path it doesn't work.
So if gnd on your relay isn't connected to gnd on whatever device you're controlling it with, it won't work.
so when u wire it dont u put gnd to a gnd prin?
Yes, multiple gnd pins if necessary
theres only one:))
that's how the meme "connect ALL THE GROUNDS" started
No, there are ground connections on all your electronics
well ive tried multiple locations
the exp1 port
the pi
the endstops
all the same
You need to connect them simultaneously
i dont understand what you mean
You need gnd connections between all points in your system. So if your pi is powered by an external psu and your board is powered by the 24V psu, there's no gnd connection between the two. What you do is bridge the gnd connection on the 24V psu and the 5v psu.
It's the same here.
there is only one psu
Your relay's gnd need to be connected to both the power source providing the 5v input and the mcu that controls the signal.
the 24v
im getting the 5v from either the mcu or the pi
and the gnd respectivly
then yeah that should work
if it doesn't, i don't see any other cause than misconfiguration
have you check the reddit post of the guy doing it with marlin on the octupus?
ive also tried it his way
and still no
question
whats t the alternative way or switching the lights on if not the relay method
?
and can i keep it wired to my fan port?
I have some 24V leds from IKEA that I wired to my heater port. Works great. Dimmable even
these are 144/p ones, high intensity
and i had them arround
just want to exhaust all possilbe options before it go and buy new ones
yeah, i was just answering the "alternative way"
Just had a look at the Reddit post. The OP notes in the picture that the relay did not work with 5V. Therefore he changed to another pin with 3V, should be the one next to PB15 according to the pinout of the board. Did you test this?
Another question: I know you want to use the existing LED's but the Octopus has a Neopixel port for 5V Neopixel LED's. These cost a few euros on Amazon (normally under 10 euros/dollars). Is it worth the stress to keep trying with the Relay or just get some Neopixels? 😅
MOSFET (allows you to dim them too)
and it's much smaller
You should test a pull down resistor
some of this relays don't work correctly. Ask me how I know.
Have plenty of them and only got results after changing module.
can you recommend one?
Tomorrow I can send you a pic of what I’m using
oki thx