i am using two relay module in may cnc plasma project. I am using only one relay from this module to turn torch on/off. I wired it as in the picture below, only difference i am using pin 13 on arduino to control relay. Problem is that when i turn power on the relay is active (but there is no signal from arduino pin 13 which should activate it). And when i connect ugs and use command M04 which should activate relay. It turns off, when i use turn off command relay turns on. What i am doing wrong? I installed grbl 1.1 on arduino.
Some bootloaders send a signal to flash the on board LED (pin 13) at boot to show that the chip is booting. Use a different pin for the relay.
You are doing nothing wrong. The relay is active LOW because of the optical isolator on the relay module. The relay is suppose to activate with a LOW on is input and turn off with a HIGH. If you cannot live with that you can put an inverter between the Arduino and the relay to reverse the action or buy a relay module that is active HIGH.
@corvuscorax4, your topic has been moved to a more suitable location on the forum.
Note that most of us prefer a photo (reasonably sized like 300 kB max) of a hand drawn schematic over the Fritzing diagram, especially if the Fritzing diagram does not match your description when it comes to pin 13..