Project showcase
How To Use DS18B20 Water Proof Temperature Sensor

How To Use DS18B20 Water Proof Temperature Sensor

We are showing how to use DS18B20 one wire water proof temperature sensor using Arduino.

  • 186,260 views
  • 28 comments
  • 39 respects

Components and supplies

Apps and online services

About this project

We are showing how to use DS18B20 one wire water proof temperature sensor. With the help of DS18B20 one wire temperature sensor we can measure the temperature from -55℃ To 125℃ with accuracy of ±5 .

Additional Library:

Installation instructions available

Detail description available on www.iotboys.com (IoTBoys)

Visit www.iotboys.com for more projects.

Code

Source Code C/C++
Source code to use water proof temperature sensor.
#include <OneWire.h>
#include <DallasTemperature.h>

#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();
}

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);
  delay(1000);
}

Schematics

Circuit Design
Follow the design for connection.
Ds18b20 temparature sensor www iotboys com  1024x542 lqdcdeudhb

Comments

Similar projects you might like

DHT11 Temperature/Humidity Sensor

Project tutorial by Zachary Haslam

  • 204,499 views
  • 55 comments
  • 126 respects

Arduino Based Digital Temperature Sensor

Project showcase by Abishek Bhalaaji

  • 35,823 views
  • 1 comment
  • 20 respects

Arduino Temperature - Humidity - Rain Sensor

Project showcase by Mako

  • 26,545 views
  • 7 comments
  • 25 respects

Water Quality Monitoring and Notification System

Project showcase by Emmanuel Ani

  • 119,101 views
  • 59 comments
  • 224 respects

Simple Water Quality Analysis

Project showcase by Wen-Liang Lin

  • 24,257 views
  • 8 comments
  • 24 respects
Add projectSign up / Login