GRBL + Relay issue.

Hello, I'm setting up a cnc machine and I want to use the spindle enable pin to turn on/of a 5V relay (picture attached.

I'm using GRBL 0.9j, which has a PWM feature on the Spindle enable pin...I downloaded a HEX file with the Variable_Spindle disabled so my GRBL shoud behave like previous versions (No PWM stuff activated...).

Now, if I connect a simple LED to the Pin 12, pretending it's my relay, everything works great, I power Arduino and the LED is down, and I can turn it on with M3 command and shut it back down with M5.

If I use a Relay, actually, always on Pin 12, as I power up Arduino it triggers the relay, so whatever is connected to the relay is On. Commands M3 and M5 are switched, M3 shuts it down and M5 triggers it.
I need the relay to be down when I turn on Arduino.

Any chance the relay board might be the problem?

Can you help me?

THANKS

A pulldown on pin 12?

Uhm, can you help me with Resistance value? I simply have Arduino 5V and GND going to Relay + and - pins, and the Signal pin of the relay is connected to the Pin 12 of Arduino board.

THANKS.

Don't really know - try a 4k7.

Solved.

Adding a Transistor seems to get it right. (I know it's redundant, but I need the Relay to handle a 24V valve, ain't got a mosfet or something else, so I'm sticking to the Transistor+Rely).

Sharing my set up for anyone having the same issue.