How To Use DS18B20 Water Proof Temperature Sensor
In this article 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 .
What is DS18B20 ?
The DS18B20 is a small temperature sensor with a built in 12bit ADC. It can be easily connected to an Arduino digital input. The sensor communicates over a one-wire bus and requires little in the way of additional components. The sensors have a quoted accuracy of +/-0.5 deg C in the range -10 deg C to +85 deg C.
One-wire temperature sensors like the DS18B20 are devices that can measure temperature with a minimal amount of hardware and wiring. These sensors use a digital protocol to send accurate temperature readings directly to your development board without the need of an analog to digital converter or other extra hardware. You can get one-wire sensors in different form factors like waterproof and high temperature probes–these are perfect for sensing temperature in many different projects and applications. And since these sensors use the one-wire protocol you can even have multiple of them connected to the same pin and read all their temperature values independently.
Requirements
- 1 x Arduino uno board
- 1 x USB cable
- 1 x DS18B20 Temperature Sensor
- 3 x Jumper wire (Male to Male)
Additional Arduino Library :-
Installation Instruction is available here
Recommended:
- Arduino IDE | Arduino | Open Source Hardware/Softawre | Arduino Vs RPi
- Best Arduino IDE alternatives to start programming
How To Use DS18B20 Water Proof Temperature Sensor
How To Connect
Arduino IDE Sketch Code
#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); }
You may like also:
- Raspberry Pi – Introduction | Overview | Setup and Management | Tutorials
- MQTT | What is MQTT | MQTT in Depth | QoS | FAQs | MQTT Introduction
- How to set up Windows 10 IoT Core on the Raspberry Pi
- Best IoT Visual Programming Tools
- Arduino ESP32 support on Windows and Ubuntu
Pingback: How To Use DS18B20 Water Proof Temperature Sensor — IoTbyHVM – Explore TechBytes – hashstacks