Serial monitor crash after relays switch down main power

hi everyone, I am pretty new in Arduino so I need your help.

I’m using Arduino Uno R3 with DHT11, YL69, and 4 channel relay.

when Relay start working, I still receive data from the board but, when It’s turn off again, serial monitor stop working but

the circuit still working.

I am using 5v/2A adaptor for relay and using USB power for Arduino.

here is my code :

#include <dht.h>
dht DHT;

void setup() {

  Serial.begin(9600);

  pinMode(8, OUTPUT);

}

void loop()

{

  //Air Sensor

  int chk = DHT.read11(7);

  Serial.print("Temperature = ");

  Serial.println(DHT.temperature);

  Serial.print("Humidity = ");

  Serial.println(DHT.humidity);

  //Soil Sensor

  Serial.print("Moisture Sensor Value:");
  
  Serial.println(analogRead(0));

  int x = analogRead(0);

  //Relay and Pomp Control
  
 if ( x < 500)
  digitalWrite(8, LOW);
  
else
    digitalWrite(8, HIGH);

  delay(2000);
}

help me I really need your help.

If the board is resetting, the serial monitor will drop its connection and "stop working". The cause of the reset may be noise from the relay(s). To see if the board is resetting, put a serial print in setup(). Something like Serial.println("Board reset"). If the board resets, the message will be printed.

Post a schematic of your project. Include part values, part numbers and power supplies.

+1 karma for using code tags on your first post. No many new users bother to read the guidelines.