Device not recognized after load

My arduino works normally without loading, but when I load it simply disappear from my computer ports.

Could this be something programming related?

The schedule is to create an autonomous car for a university project.

Without loading

After loading

I am using the following programming

#define trig 2
#define echoE 8
#define echoM 7
#define echoD 4
#define motorE1 6
#define motorE2 9
#define motorD1 5
#define motorD2 3

long duracaoE;
long duracaoM;
long duracaoD;

float distanciaE;
float distanciaM;
float distanciaD;

void setup()
{
  Serial.begin(9600);
  pinMode(trig, OUTPUT);
  pinMode(echoE, INPUT);
  pinMode(echoM, INPUT);
  pinMode(echoD, INPUT);
  pinMode(motorE1, OUTPUT);
  pinMode(motorE2, OUTPUT);
  pinMode(motorD1, OUTPUT);
  pinMode(motorD2, OUTPUT);
  digitalWrite(trig, LOW);
}

void loop()
{
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  duracaoE = pulseIn(echoE, HIGH);
  distanciaE = duracaoE / 58.82;

  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  duracaoM = pulseIn(echoM, HIGH);
  distanciaM = duracaoM / 58.82;

  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  duracaoD = pulseIn(echoD, HIGH);
  distanciaD = duracaoD / 58.82;

  {
    Serial.print(distanciaE);
    Serial.print(" - ");
    Serial.print(distanciaM);
    Serial.print(" - ");
    Serial.println(distanciaD);
    delay(10);
  }

  if (distanciaE < 15 || distanciaE > 1000)
  {
    analogWrite(motorD1, 0);
    analogWrite(motorD2, 110);
  }
  else
  {
    if (distanciaE < 18 || distanciaE > 100)
    {
      analogWrite(motorD1, 80);
      analogWrite(motorD2, 0);
    }
    else
    {
      if (distanciaE < 21)
      {
        analogWrite(motorD1, 110);
        analogWrite(motorD2, 0);
      }
      else
      {
        if (distanciaE < 28)
        {
          analogWrite(motorD1, 155);
          analogWrite(motorD2, 0);
        }
        else
        {
          analogWrite(motorD1, 205);
          analogWrite(motorD2, 0);
        }
      }
    }
  }
  
  if (distanciaD < 15 || distanciaD > 1000)
  {
    analogWrite(motorE1, 0);
    analogWrite(motorE2, 110);
  }
  else
  {
    if (distanciaD < 18 || distanciaD > 100)
    {
      analogWrite(motorE1, 80);
      analogWrite(motorE2, 0);
    }
    else
    {
      if (distanciaD < 21)
      {
        analogWrite(motorE1, 105);
        analogWrite(motorE2, 0);
      }
      else
      {
        if (distanciaD < 28)
        {
          analogWrite(motorE1, 155);
          analogWrite(motorE2, 0);
        }
        else
        {
          analogWrite(motorE1, 205);
          analogWrite(motorE2, 0);
        }
      }
    }
  }

}

The sketch itself does not look like an issue as I don't see it using any pins that would affect the COM port( 0 and 1).

A schematic may be quite useful at this point to rule out overloading the UNO which could cause similar issues.

Bob.