Saturday, 7 March 2020

DS18B20 Thermometer using Arduino & 4 Digits 7 Segment Display


In this project we will learn how to design DS18B20 Based Thermometer using Arduino & 4 Digits 7 Segment Display. Simply we will interface Arduino with DS18B20 Digital Waterproof Temperature Sensor and display the temperature values in degree celsius on Common Cathode Display.









The DS18B20 temperature sensor is a 1-wire digital temperature sensor. This comes with sealed package lets precisely measure temperatures in wet environments with a simple 1-Wire interface. It communicates on common bus. It means it can connect several devices and read their values using just one digital pin of the Arduino.

Check some of the posts related to DS18B20 here:
1. Temperature Meter using DS18B20 OLED Display & Arduino
2. Digital Thermometer Using Arduino & DS18B20 Temperature Sensor



DS18B20 Waterproof Digital Temperature Sensor


This is a pre-wired and waterproofed version of the DS18B20 sensor. Handy for when you need to measure something far away, or in wet conditions. The Sensor can measure the temperature between -55 to 125°C (-67°F to +257°F). The cable is jacketed in PVC.
Because it is digital, there is no any signal degradation even over long distances. These 1-wire digital temperature sensors are fairly precise, i.e ±0.5°C over much of the range. It can give up to 12 bits of precision from the onboard digital-to-analog converter. They work great with any microcontroller using a single digital pin.


Components Required for Digital Thermometer:
1. Arduino UNO Board
2. DS18B20 Waterproof Temperature Sensor 
3. Common Anode 7 Segment Display - 4
4. 7HC595 IC (8 bit Shift Resistor)
5. 4.7K Resistor
6. 330 ohm Resistor - 8
7. Breadboard

8. Connecting Jumper Wires


Circuit Diagram & Connections:



Connect VDD pin of DS18B20 to 5V and GND Pin to Ground. Connect its data pin to digital pin 2 of Arduino and also to 4.7K Resistor (Connect another end of 4.7K Resistor to 5V) as shown in the figure below.

Working of the Project:
The DS18B20 Digital Thermometer provides 9 to 12-bit (configurable) temperature readings which indicate the temperature of the device. It communicates over a 1-Wire bus that by definition requires only one data line (and ground) for communication with a central microprocessor. In addition it can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.


The core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively. The default resolution at power-up is 12-bit.


Source Code/Program for Displaying Temperature in °Celsius:




To design DS18B20 Based Thermometer using Arduino & 4 Digits 7 Segment Display& to display temperature in degree Celsius you need two different library
1. Download 1 Wire Library
2. Download Dallas Temperature Library


Add these to library file to Arduino IDE and then simply compile and upload the code.

Source Code/Program for Displaying Temperature in °Fahrenheit:



To design DS18B20 Based Thermometer using Arduino & 4 Digits 7 Segment Display& to display temperature in degree Fahrenheit you need two different library
1. Download 1 Wire Library
2. Download Dallas Temperature Library


Add these to library file to Arduino IDE and then simply compile and upload the code.

No comments: