Power relay
-
No. Please post a photo of the back of the board with better lighting and focus, so that I can see the PCB traces clearly.
-
-
The traces still are not very clear. But I think that CH1 and GND are the input signal, connected to the input of the opto coupler through a series resistor, while VCC and RGND provide power to the relay. If that's the case, connect VCC to +5V and RGND to ground. Connect GND to the Duet PS_ON output, and connect CH1 to either +5V or +3.3V.
-
Okay thanks David. I'll have a play with it on the bench before connecting it to a duet board.
-
Okay so it did end up working as I had suggested originally, I spoke to the vendor who said to ignore RGND and use VCC, GND, CH1 pins. In fact it did not seem to matter whether PS_ON is connected to GND or RGND so I presume they are tied. So connecting VCC and CH1 tied to +5v on expansion connector and then GND to PS_ON switches the relay on M80, and off on M81.
Nice bright LED too if you are going to put it under a cover of some sort it will shine through. Mine is going to live under the PSU end cover which keeps small fingers off the 240v wiring.
-
Why dont connect the 5v/CH1 to the 5v on ps_on header?
-
Because and it took me a few minutes to work this out yesterday, its a 5v input pin, not 5v output! There is a diode on it.
-
Ok ok. Then 5v/CH1 go in any 5v output and gnd to ps_on.
-
By any I presume it will have to be either the 5v output from your 5v power source for the duet board, or from the board itself with the ext-5v jumper attached. Otherwise the relay wouldn't have a ground.
-
So soldered a link across CH1 and VCC, so I only need two wires. Works great. One thing I did notice, when I send an M81, the console reports a Warning: VIN under-voltage event (X.Xv) .
Not really a problem, but maybe the under voltage monitor routine should be shutdown on an M81 since obviously, the voltage is going to drop if you disconnect the PSU. The restarted on an M80? Perhaps it serves as a useful marker in the log to show when it shut off maybe?
So now using in start gcode
M80 ; PSU ONThen in end gcode
M109 S50 ; lower hotend temp to below glass transition temp
M116 ; wait for temps to stabilise (so PSU does not shut off whilst hotend is hot)
M140 S0 ; turn off bed temperature
M84 ; disable motors
M81 ; PSU offThis allows the hotend to get down below glass transition for any filament.
-
M81 events are logged anyway. The reason I don't suppress the under voltage message is that in some situations the firmware executes M81 without knowing whether it will have any effect. But I guess it could ignore under voltage events for just a few seconds after M81.
-
Thanks David. Was just a thought, might be worth trying the idea of ignoring it for a few seconds, if you have time to do so - it just seems more logical not to report an error on an intentional disconnection of Vin power.
So I have wired up two of my Duet enabled printers with these relays, both working fine.
Found something like this lying around too:
Which means you don't need any more mains sockets for each printer. It provides 2 usb ports, one to the duet usb port to provide 5v power, and a spare one for an ip camera or something else, whilst also having a passthrough port for the printers PSU mains supply.
-
Just a quick question. On one machine that I have added a power relay to, I connected the EXT 5v jumper (removing the INT 5v one). On another machine I just realised I have not removed the INT 5V jumper yet they both behave exactly the same. I am powering them via USB charger, via the USB port.
Is there something I'm missing? Is the functionality of this jumper related to powering via the 5v input pin on the PS_ON header block? Am I potentially doing any damage having the jumper set wrong? I presume not as I've about 4 hours printing on the machine set to INT 5v without any issue?
Just for information a USB charger rated at 1amp (but probably less as it was generic and not great quality) does not provide enough current to reliably power the board via the usb port.
-
That's an interesting solution. I use a significantly more heavyweight approach. I am using a 5V power pins from a 5V PSU and the PS_ON pin goes to the raspberry pi – then I have a webapp which monitors GPIO pins and when it gets the right signal it toggles the connected relays on a 4 relay board -- 2 for mains going to the 24v PSU and 2 for mains going to the heated bed -- I've yet to find an SSR which doesn't leak AC, so I like to cut it's power when the machine is not on. I also am doing a double throw to break both live and neutral on both 24v PSU mains and bed mains -- belt and suspenders
The pi is there for webcam streaming and other things which I am used to having OctoPrint do for me. -
Just a quick question. On one machine that I have added a power relay to, I connected the EXT 5v jumper (removing the INT 5v one). On another machine I just realised I have not removed the INT 5V jumper yet they both behave exactly the same. I am powering them via USB charger, via the USB port.
Is there something I'm missing? Is the functionality of this jumper related to powering via the 5v input pin on the PS_ON header block? Am I potentially doing any damage having the jumper set wrong? I presume not as I've about 4 hours printing on the machine set to INT 5v without any issue?
Should be ok, it's like powering 5V from both USB and the internal 5V regulator.
Just for information a USB charger rated at 1amp (but probably less as it was generic and not great quality) does not provide enough current to reliably power the board via the usb port.
It should be enough, except perhaps if you have a PanelDue with 7" screen.
-
I suspect the plug in adaptor that failed to provide enough power was faulty or a very cheap and nasty bit of kit. On that machine no screen just the duet board and relay, until the relay closes.
@ Kazolar - that is belt and braces good work.
-
I'm planning to do this with a Fotek ssr, will this be alright or will I need something to isolate it from the board as well?
-
To use it as a camera trigger, I need to execute m80 and followed by m81. What interval would I have if I put them one below the other in the gcode?
More than a microsecond, but possibly less than a millisecond.
New question. I use
[[language]] M80 M81
But is to fast for the relay module. What can i do?
Edit:
Forget all, i found the G4 Pxxxxx gcode
This works for my nikon
[[language]] M80 G4 P2000 M81
-
Sorry for hijacking this thread, but this might also help others. I am planning to use a very similar relay module (as pictured in the first post), for my printer (supplied from 24V power supply). The difference is that on mine, the trigger for the relay is the center pin. So recapping: it is non opto-isolated 5V coil side, though driven from the 5V via a transistor and not the signal pin and the relay coil have a diode as support.
I just want to confirm that my planned schematic for a small board is going to work as I expect it to.
Basically in short, we have 24V coming in and then being regulated to 5V (7805 regulator). The 5V is then supplied to the 5V near the PS_ON pin. The 5V is also used to pull the PS_ON to 5V (using a 10k pull-up resistor) [I understand that the PS_ON is not actually pulled high inside the DuetWifi, since the ATX PSU usually does it]. The R1, R2 and Q1(547B transistor) works to invert the signal (since the DuetWifi PS_ON On signal is actually LOW, and my module needs a HIGH). Finally the 5V and inverted signal is fed to the Relay Module. Note that R5 is simply a link aka 0Ohm resistor (needed in the board design).
The second part is an optional part in which I try to increase the time the printer can perform the save/resume when power is lost during a print. The SuperCap is a 1F capacitor for 5.5V, which is charged via a 220Ohm resistor (this means it takes 220s to fully charge upto 5V, but should not blow the regulator). If you want to do something similar, you will need to use the External 5V jumper, otherwise it will simply not work.
Now my few questions:
- Should the relay circuit work? Are there any required changes for this?
- The super cap, will it be able to power the board via the 220Ohm resistor, or how can I ensure it charges via the resistor, but not discharge via it (I considered a diode, but then the voltage drop [though the 220r resistor might give an even greater voltage drop]).
Some extra info that might be useful: in my setup I have the 5" PanelDue, I am using only a single extruder (PT100 sensor) with a heatbed (10k thermistor) and the IR Probe. I have a bypass switch, with which the PSU will get power, startup and enable the relay.
As to the question of the SSR above, I considered using one, but decided against it. Ultimately it is your decision, however you should keep in mind that an SSR fail closed (i.e. it lets the full power through). SSRs are not recommended for important circuitry, especially as the only switch (thus you need at least a switch before it, so that you can safely shut down the printer in case of a failure). That said, failures of the SSRs are not very common (as long as you have a reputable brand) and chances of it failing with a mosfet for one of your heaters are extremely slim (that is mostly the worst case scenario*).
*The firmware does not currently allow a shutdown if it detects such an issue, but it have been discussed as a possible feature for the future (will need a debugging log that can persist after shutdown).