Hello guys, need some help!

I tried all the proposed solutions to no avail unfortunately...

I also tried to power my arduino using an external power supply.. that didn't work either..

I also did my code way much simpler!

#include <Servo.h>
#include <OneWire.h>
#include <DallasTemperature.h>

int DS18S20_Pin = 2;        // Set temperature sensor in pin 0
int thresholdcold = 21;     // Threshold for cold temperature
int thresholdhot = 23;      // Threshold for hot temperature
int thresholdnormal =22;   // Threshold for normal temperature
int servocold = 174;        // Angle in which servo will go to
int servohot = 0;           // Angle in which servo will go to
int servonormal = 80;       // Angle in which servo will go to
int previousPosition = 80;
int ServoDelay = 30;        // Servo delay
int led = 13;
int Relay_Pin = 12;

Servo servo1;

float Temp1;
float Temp2;
float AverageTemp;
 


// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire);

void setup(void)
{
  Serial.begin(9600); // Begin communicating with computer
  
  Serial.println("Dallas Temperature IC Control Library Demo");
 
  servo1.attach(9); // Attaches servo to specified pin
  
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
 
}

void loop(void) {
  
  
float Temp1 = sensors.getTempCByIndex(1) ;
float Temp2 = sensors.getTempCByIndex(0) ;
float AverageTemp = (Temp1 + Temp2) / 2.0f; ;
  
 // call sensors.requestTemperatures() to issue a global temperature 
  // request to all devices on the bus
  Serial.print("Requesting temperatures...");
  sensors.requestTemperatures(); // Send the command to get temperatures
  Serial.println("DONE");
  
  Serial.print("Temperature for Device 1 is: ");
  Serial.println(Temp1); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
  
  Serial.print("Temperature for Device 2 is: ");
  Serial.println(Temp2);
  
  

 
  Serial.print("Average temp is...");
  Serial.println (AverageTemp);
  
  delay(1000);
  
 // if (Temp1 > 23 || Temp2 > 23 ){              
    
 //  digitalWrite(led, HIGH);                                                        // Testing spikes
    
 //   Serial.println ("ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
 // }
  

  
  
  if(AverageTemp <= thresholdcold) // If temperature is above the threshold, activate sequence
  {
   
	if (servocold != previousPosition){
  
   for(previousPosition != 0; previousPosition < servocold; previousPosition += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    servo1.write(previousPosition);              // tell servo to go to position in variable 'pos' 
    delay(ServoDelay);                       // waits 15ms for the servo to reach the position 
  } 
  
        	servo1.write(servocold);
		previousPosition = servocold;
		}
  }
 
  else if(AverageTemp >= thresholdhot) // If temperature is above the threshold, activate sequence
  {
  
		if (servohot != previousPosition){
  
  for(previousPosition != thresholdhot; previousPosition -= 1;)  // goes from 0 degrees to 180 degrees 
  {                                                                                     // in steps of 1 degree 
    servo1.write(previousPosition);              // tell servo to go to position in variable 'pos' 
    delay(ServoDelay);                       // waits 15ms for the servo to reach the position 
  } 
	    servo1.write(servohot);
		previousPosition = servohot;


		}

      digitalWrite(led, HIGH);
      digitalWrite(Relay_Pin, HIGH);
  }
 
 
 
 
 
  else if(AverageTemp >= thresholdnormal) // If Fract is above the threshold, activate sequence
  {
   
	while (previousPosition != servonormal){
  
  if (previousPosition < servonormal)  // goes from 0 degrees to 180 degrees 
  {                                                                                     // in steps of 1 degree 
    servo1.write(previousPosition++) ;             // tell servo to go to position in variable 'pos' 
    delay(ServoDelay);                       // waits 15ms for the servo to reach the position 
  } 
  
  else  // goes from 0 degrees to 180 degrees 
  {                                                                                     // in steps of 1 degree 
    servo1.write(previousPosition--);              // tell servo to go to position in variable 'pos' 
    delay(ServoDelay);                       // waits 15ms for the servo to reach the position 
  } 
	    servo1.write(servonormal);

		//previousPosition = servonormal;

                digitalWrite(led, LOW);
                digitalWrite(Relay_Pin, LOW);
		}

      
  }
}

Now when the fault occurs my serial print looks like this

Requesting temperatures...DONE
Temperature for Device 1 is: 22.25
Temperature for Device 2 is: -127.00
Average temp is...-52.38

nothing seems to work

Maybe i have a faulty sensor?

do you have any more suggestions? Thanks!