Lol no one looked at the PDF if you cut the ground from the uno the relays are still hooked to the supply ground and if you turn on one closing the power loop. But the OP should rethink this and read the data sheet the relays are setup to use 20 mA to turn on, and Like I said you don't need a resistor from the uno to turn these on with five volts but your using a resistor and 12 volts that sets it to about 21mA.
That's why it works now but it's not a good idea you forget the 4.7 good by port pin.
So if you left off the resistor and just use 5 volts it should work too and no worries off blowing a port pin.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||