Environmental control system does not work properly unless connected via USB

Post a link to the relay board you are using.

You may need a separate power supply for the relay coils -- the Arduino 5V regulator cannot deliver much current.