Hello,and welcome back to Enghme for a new Arduino project.In this article, we will build a temperature monitoring system using a waterproof DS18B20 temperature sensor and an Arduino. If you like this project, you can check out more cool projects on Arduino. This system is able to display temperature readings in real time. We are using an Arduino UNO microcontroller and an I2C module with a 16 x 2 LCD here. The DS18B20 is a temperature sensor that generates its output according to the temperature it senses.
Working temperature monitoring system
The LCD screen displays the actual values captured by the sensor in degrees and also in Fahrenheit. Since the temperature sensor we use is waterproof, you can dip it in water to capture the temperature. You can also read the IoT weather monitoring system we made as well. You can check the measured temperature value on the LCD screen as well as on the serial monitor. Use the image below to locate the serial monitor on your Arduino IDE.
Circuit diagram for the project:
project code:
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
#define ONE_WIRE_BUS 5
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
float Celcius=0;
float Fahrenheit=0;
void setup(void)
{
Serial.begin(9600);
sensors.begin();
lcd.init();
lcd.backlight();
lcd.print("Temp Monitoring");
}
void loop(void)
{
sensors.requestTemperatures();
Celcius=sensors.getTempCByIndex(0);
Fahrenheit=sensors.toFahrenheit(Celcius);
Serial.print(" C ");
Serial.print(Celcius);
Serial.print(" F ");
Serial.println(Fahrenheit);
lcd.setCursor(0, 1);
lcd.print(Celcius);
lcd.setCursor(6, 1);
lcd.print("C");
lcd.setCursor(9, 1);
lcd.print(Fahrenheit);
lcd.setCursor(15, 1);
lcd.print("F");
delay(1000);
}
//www.enghme.com