Add a diode in series with the D2 wire.
Anode to the D2 pin cathode to the relay pin.
Show us a schematic for the relay board.
5 volts to the Arduino jack will not power the UNO.
.
Add a diode in series with the D2 wire.
Anode to the D2 pin cathode to the relay pin.
Show us a schematic for the relay board.
5 volts to the Arduino jack will not power the UNO.
.