problem using ds18b20 sensor and water pump with relay

Hello every one, [sorry for bad english], i have a problem with using a ds18b20 sensor and relay for my project (detect the temperature of water and pump hot or cold water), when i compile this code, it indicates that ds18b20 have some problems (-127.0 which means that i connect something wrong), but when i comment the part of code in which i call the pump to action, in serial monitor it looks like that all is ok, i mean without any changes in wiring it shows normal temperature.

i'm using arduino mega 2560, 2X relays, 2X pumps 12V and one waterproof ds18b20

Also: when i run this code, temperature sensor begin to warm

relay is connected in NC mode

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

float limit = 30.0f;

#define ONE_WIRE_BUS 8
#define RELAY1 7
#define RELAY2 4
 
OneWire oneWire(ONE_WIRE_BUS);
 
// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);
 
void setup(void)
{
  Serial.begin(9600);
  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);

  sensors.begin();
}
 
void loop(void)
{
  sensors.requestTemperatures();
  float current_temp = sensors.getTempCByIndex(0);
  
  Serial.print("Temperature is: ");
  Serial.println(current_temp);

  if(current_temp > limit)
  {
    digitalWrite(RELAY2, LOW);
    digitalWrite(RELAY1, HIGH);
  }

  if(current_temp < limit)
  {
    digitalWrite(RELAY1, LOW);
    digitalWrite(RELAY2, HIGH);
  }

  // if current temp == limit do nothing
}

i attached how i connected the ds18b20

What happens if you run that code with the relays disconnected?

if i disconnet the signal pin of relays and leave the original code, temperature sensor show normal temperature of my room

Sounds like your relays aren't sufficiently isolated from the rest of the circuit. Are they optoisolated? How are they powered? I.e. How are they wired up?

sorry for bad quality of image

It looks like you're powering the relays and the motors from the Arduino which won't be able to provide enough current. The motors at least will need their own power supply. What are those relay modules?

i will need an additional power supply for the pumps?

Do you have a kickback diode in parallel with the pump?

no, i have just a 4.7 kohm resistor at ds18b20. How to connect that diode?

soryn:
i will need an additional power supply for the pumps?

Yes. Arduino controls the relay, the relay activates the pump. At the moment it seems that the relays are redundant and you are trying to drive the pump directly, leaving you with two possible results

  1. Nothing happens because Arduino has insufficient power available from its pins
  2. Nothing happens because you have fried Arduino.