What pin should I use to switch my router relay?

  • Sorry to be so active asking questions, but I'm going through this process and really appreciate the online help... so

    My CNC router uses a 5V relay to switch the router power on/off. I've set my system up as CNC with a fan pin for the 'spindle' (relay). The relay current requirement is about 100mA so a fan output makes sense.

    M453 C"fan1" R1000 ; use the fan1 port for spindle / CNC mode

    The problem is that when the board is reset (such as updating the config.g or a software bug) the relay triggers on for a short time causing the potentially dangerous router to turn on.

    Is there any way to not have the relay trigger at reboot? Must I use a different method to trigger the relay?

    My system is a Duet2 with a breakout expansion.


  • @markz use a heater instead. The fan outputs are set to on before the config has loaded incase the hotend has been on and needs cooling.

  • @jay_s_uk Hmmm, i looked at the schematic and doc and don't see a way to run the bed heater at 5V for the relay. I hate to run 2W into a dropping resistor (I have a 24V supply) but I guess I could do that. Is there another way to get 5V there?

    Thanks for the info about the reset. I suppose I could change the startup code since I have to do firmware changes any way. I don't define it as a a fan and deliberately didn't use fan0... sigh.

  • @markz what's it switching at the other side?
    Most mains solid state relays support 5v-32v input to activate them.
    An SSR is probably better than one of those cheap little pi blue ones.

  • @jay_s_uk It's a physical relay, specifically an IDEC RJ1V-AH-D5, see here:


    For $5 I can buy the 24V version at Digi-key...

  • @jay_s_uk Nice! Thanks to your hint I decided to look at the source code and found that on the Duet2 only fan 1 is turned on at power on - and of course that's the one I was using - so I just swapped my two relays (the other controls the spotting laser - no big deal) and now it no longer turns on at reboot.


Log in to reply