Arduino Blynk Multiple DS18B20 With High/Low Alarm

HERE is an example for reading multiple ds18b20 sensors (due note there are other ways of reading multiple ds18b20 sensors, e.g. by index).

Once you are reading each sensor, add in the checks for the HIGH/LOW alarm. For example:

void sendSensor2() {
  sensors.requestTemperatures();
  temperature2 = sensors.getTempC(tempSensor2);
  Blynk.virtualWrite(2, temperature2);
 // Low temperature alerts
    if ((temperature2 <= alertTempLow) && !lowAlertOn2) {
      Blynk.setProperty(V_PIN_TEMP_A, "color", ALERT_COLOR_LOW);
      Blynk.notify(alertMessageLow);
      lowAlertOn2 = true;
    }
    else if (lowAlertOn2 && (temperature2 > alertTempLow + ALERT_HYSTERESIS)) {
      Blynk.setProperty(V_PIN_TEMP_A, "color", ALERT_COLOR_OK);
      lowAlertOn2 = false;
    }
// High temperature alerts
    if ((temperature2 >= alertTempHigh) && !highAlertOn2) {
      Blynk.setProperty(V_PIN_TEMP_A, "color", ALERT_COLOR_HIGH);
      Blynk.notify(alertMessageHigh);
      highAlertOn2 = true;
    }
    else if (highAlertOn2 && (temperature2 < alertTempHigh - ALERT_HYSTERESIS)) {
      Blynk.setProperty(V_PIN_TEMP_A, "color", ALERT_COLOR_OK);
      highAlertOn2 = false;
    }
}

The example you are working from has a lot of features. If you are not familiar with programming, I suggest you start simple and work your way up to the more advanced stuff.

1 Like