#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#define ONE_WIRE_BUS 8 // temp sensor connected to Arduino digital pin 8
OneWire oneWire(ONE_WIRE_BUS); // Setting a one wire instance
DallasTemperature sensors(&oneWire); // Passing onewire instance to Dallas Temperature sensor library
LiquidCrystal lcd(2, 3, 4, 5, 6, 7); // Arduino lcd sheild pins defined
void setup(){
lcd.begin(16, 2); // Initialize the 16x2 lcd sheild
sensors.begin(); // Begin the DS18B20 initialization
}
void loop(){
int Panel=0, Boiler=0; //Variables to store temperature readings from DS18B20 temperature sensor
sensors.requestTemperatures(); //Call all sensors on one wire to start calculating the temperature readings
Panel=sensors.getTempCByIndex(0); //Get temperature reading from sensor 0 in celsius scale
Boiler=sensors.getTempCByIndex(1); //Get temperature reading from sensor 1 in Celsuis scale
lcd.setCursor(0, 0); // Place the lcd cursor on Row-1
lcd.print("PANELE "); // Print Celsius temperature on first row
lcd.print(Panel);
lcd.print((char)223); //prints °
//lcd.print("C"); // prints C
lcd.setCursor(11, 0);
lcd.print("ON");
//lcd.print("wstaw temp wlaczenia pompy")
lcd.setCursor(0, 1); // Place the lcd cursor on Row-2
lcd.print("BOILER "); // Print temperature on second row
lcd.print(Boiler);
lcd.print((char)223); //prints °
//lcd.print("C"); // prints C
lcd.print("OFF");
//lcd.print("wstaw temp wylaczenia pompy")
delay(500); //Refresh the temperature readings after every 0.5 seconds
}