KY-019 relay to control Router

So, it seems like this should work, I understand the wiring from the AC side.

I’m not sure how I’d actually hook up to the Rambo though. Or what software changes I need to make.

I use this IOT relay. No firmware changes are required. The relay is hooked up to a set of fan pins (there are at least three different sets on the Rambo board), and the relay is controlled by issuing M106/M107 g-code commands. The fan pins by default are 12V pins, so to make the kind of relay you reference work, you will need to do one of two things: 1) purchase a 12V version of that relay, or 2) make a simple modification to the firmware so that one set of the fan pins gets reassigned to 5V pins.

In the Marlin firmware in pins_Rambo.h, this is the section that would get edited:

#ifndef FAN_PIN
  #define FAN_PIN                              8
#endif
#define FAN1_PIN                               6
#define FAN2_PIN                               2

Here is a picture with some labeled 5V pins:

Rambo1_4_ExtraPins

44, 45, and 46 are a good choice since they are PWM pins.

I agree with Robert.

I also use an IOT relay, and it is the easiest, perfect solution.
I have both my router and shop vac hooked up to it, so they both turn on and off in the gcode.

I am trying to use the IOT relay as well, whick pins do i use and what code to turn it on

You can use any of the three fan pin pairs. They are labeled on this image. These are 12V pins. I use Fan 2 for my IOT Relay. I control these pins using the fan control g-codes M106 and M107. I’m not sure of your software pipeline, but for most pipelines, there are ways of inserting these g-codes automatically.

You didn’t say you are using a Rambo board. If using another board, you will need to find the pinout diagram or image for your board and locate the fan pins.

P.S.: Forgot to mention that the IOT relay (assuming you purchased the same one I did) is polarity sensitive.