Arduino Stops Responding

I'm using two nanos connected to a PC usb. Sending a serial signal to each.

One is then switching digital outputs on or off depending on the signal (sending a string of characters A-R in alphabetical order, lowercase switches an output off, uppercase switches it on) These then switch the transistors of a ULN2003 which in turn switch relays which in turn operate solenoids and three phase contactors.

The other nano, when it receives a signal relays the state of it's inputs back to the PC as a string of 1s and 0s. These inputs come via ULN2003 transistors, with pull up resistors (or internal pull ups enabled) on both sides of the transistor, allowing the input to the transistor to be pulled down to common ground, switching the transistor off thus the input of the arduino is pulled high. Releasing the input, the transistor is pulled high, pulling the arduino input to ground.

All works fine on the desk. However, once I connect the system up to the machine, it runs for a few minutes, then one or other Arduino stops responding.

Do I need to opto-isolate the inputs and outputs? Not sure if this will be practical as the ground line on the Arduino is connected to the earth on the PC, which is then connected to earth the same as the machine.

Update:
Pressing the reset button on the nano doesn't start it responding again, the com port either has to be disabled and re-enabled in device manager, reboot the pc, or unplug the usb lead and plug it back in. Would this suggest it's the onboard CH340 adaptors that are crashing rather than the microcontroller?
Would using a separate USB to serial converter help, connected to the Rx and Tx lines of the Arduino maybe through opto-isolation? How about reducing the baud rate?

I don't think you would gain anything from opto-isolation. The board is rather isolated with the transistors, however, do these have resistors running from arduino pin to base? The 5-6 minute mark suggests, to me, a thermal factor is involved, perhaps input section of chip. See if any part is getting hot, but take care not to get burned.

I had one shorted accidentally and the (VR got hot) and it started acting strange after a few minutes of uptime every time.

Thanks for the response, nothing is getting remotely warm. It seems to stop responding on switching of an input or an output as it's run fine for almost 24 hours doing nothing. The external circuits were all working fine when connected to a PC via the printer ports, but using an Arduino to read and write is causing issues.