DUET 2 WIFI, RELAY CONTROL VIA GPIO
-
@siam I tested the relay with the raspberry PI 4 and it works perfectly powered at 3v
-
@diy-o-sphere said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
@gianluca
You can control that typ of relay with the PS_ON pin.Interesting... could you give me some additional information on this solution?
I found the PS_ON pin, but what configuration could I use men config.g? -
@cosmowave said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
@gianluca said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
I added the command M950 F4 C "exp.heater7" Q500 in config.g and I wanted to switch the relay on and off through M42 P7 S1 and M42 P7 S0.
With M950 F4 you have created a fan#4.
So you have to use M42 P4 S1 afterwards, for switching on the relay.Correct, I try this evening...
-
@gianluca said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
could you give me some additional information on this solution
You can switch the pin with M80/M81.
Check the option for M81 maybe it is useful in your case.In RRF3 "pson" is available as a pin name for the 6HC . So configurable with M950.
But for the other boards the pin is not listed here.
I would have expected that this is uniform in RRF3, maybe @dc42 can confirm that.
I can't get why for those boards PS-ON is hard wired in the firmware. -
@gianluca that relay should work if you connect the relay connection labelled +5V to +5V on the Duet, instead of to +3.3V.
-
@dc42
So the gpio pin is cappable to take 5V?
I thought since the logic runs on 3.3v no higher voltage should be applied. What is the limit?Edit:
Talking about expansion port.... -
@diy-o-sphere said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
So the gpio pin is cappable to take 5V?
No, it isn't. However, the schematic for that relay module shows that the SIGNAL input is used to feed a transistor and LED, and the 5V input provides the power to the relay, which is switched by the transistor.
-
@dc42
Ok. That makes sense.... -
@cosmowave said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
@gianluca said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
I added the command M950 F4 C "exp.heater7" Q500 in config.g and I wanted to switch the relay on and off through M42 P7 S1 and M42 P7 S0.
With M950 F4 you have created a fan#4.
So you have to use M42 P4 S1 afterwards, for switching on the relay.I have tryed with:
M950 F4 C"exp.heater7" Q500 in config.g
and M42 P4 S1 to turn ON on console.
But pin 31 (heater7) is always on 0,0Volt.I also powered the relay at 5v (not at 3.3V as in the picture ) but nothing changes...
-
@diy-o-sphere said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
@gianluca said in DUET 2 WIFI, RELAY CONTROL VIA GPIO:
could you give me some additional information on this solution
You can switch the pin with M80/M81.
Check the option for M81 maybe it is useful in your case.In RRF3 "pson" is available as a pin name for the 6HC . So configurable with M950.
But for the other boards the pin is not listed here.
I would have expected that this is uniform in RRF3, maybe @dc42 can confirm that.
I can't get why for those boards PS-ON is hard wired in the firmware.Tested, all working good ... thanks.
Now I just have to work the relay with the GPIO on heater7 -
Note, the solution for correct run of relay is:
M950 F4 C"exp.heater7" Q500 (create a fan4)
M4106 P4 S1 (to turn ON the fan or relay).