You are on page 1of 22

DEVELOPMENT OF TEMPERATURE MEASUREMENT

SYSTEM USING DS18B20

A skill-oriented course-1 report submitted in partial fulfillment


of the requirements for the award of the degree of

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE AND ENGINEERING
(Internet of Things)

Submitted by

RAVURI.TEJASRI 22BQ1A4940

[Program: Computer Science and Engineering (Internet of Things) – CSO]


VASIREDDY VENKATADRI INSTITUTE OF TECHNOLOGY
(Autonomous)
Approved by AICTE, Permanently Affiliated to JNTUK, NAAC
Accredited with ‘A’ Grade, ISO 9001:2015 Certified
Nambur (V), Pedakakani (M), Guntur (Dt.), Andhra Pradesh – 522 508
2023

Department of Computer Science & Technology Page i


[Program: Computer Science and Engineering (Internet of Things) – CSO]
VASIREDDY VENKATADRI INSTITUTE OF TECHNOLOGY
(Autonomous)
Approved by AICTE, Permanently Affiliated to JNTUK, NAAC Accredited with ‘A’
Grade, ISO 9001:2015 Certified

Nambur (V), Pedakakani (M), Guntur (Dt.), Andhra Pradesh – 522 508

CERTIFICATE

This is to certify that the research project report entitled “ Development of

Temperature Measurement System using DS18B20 ” is being submitted by


RAVURI.TEJASRI (22BQ1A4940) in partial fulfillment of the requirement for the
award of the degree of the Bachelor of Technology in Computer Science and
Engineering (Internet of Things) to the Vasireddy Venkatadri Institute of Technology is
a record of bonafide work carried out by him/her under our supervision.

The results embodied in this project have not been submitted to any other
university or institute for the award of any degree or diploma.

Signature of the Coordinator Head of the Department


Mr. S. Saida Rao Dr. Chintalapudi V Suresh
Assistant Professor, Professor & HoD,
Department of CSO, VVIT. Department of CSO, VVIT.

DECLARATION

Department of Computer Science & Technology Page ii


I hereby declare that the work embodied in this research project
entitled “Development of Temperature Measurement System using
DS18B20”, which is being submitted by me in requirement for the B. Tech
Degree in Computer Science and Engineering (Internet of Things) from
Vasireddy Venkatadri Institute of Technology, is the result of investigations
carried out by me.
The work is original and the results in this thesis have not been
submitted elsewhere for the award of any degree or diploma.

Signature of the Candidates


R. Tejasri (22BQ1A4940)

Department of Computer Science & Technology Page iii


Department Vision
To accomplish the aspirations of emerging engineers to attain global
intelligence by obtaining computing and design abilities through communication
that elevate them to meet the needs of industry, economy, society, environmental
and global.
Department Mission
 To mould the fresh minds into highly competent IoT application developers by
enhancing their knowledge and skills in diverse hardware and software design
aspects for covering technologies and multi-disciplinary engineering practices.
 To provide the sate- of- the art facilities to forge the students in industry-ready
in IoT system development.
 To nurture the sense of creativity and innovation to adopt the socio-economic
related activities.
 To promote collaboration with the institutes of national and international
repute with a view to have best careers.
 To enable graduates to emerge as independent entrepreneurs and future
leaders.
Program Educational Objectives (PEOs)
PEO-1: To formulate the engineering practitioners to solve industry’s technological
problems
PEO-2: To engage the engineering professionals in technology development,
deployment and engineering system implementation
PEO-3: To instill professional ethics, values, social awareness and responsibility to
emerging technology leaders
PEO-4: To facilitate interaction between students and peers in other disciplines of
industry and society that contribute to the economic growth.
PEO-5: To provide the technocrats the amicable environment for the successful
pursuing of engineering and management.

Department of Computer Science & Technology Page iv


PEO-6: To create right path to pursue their careers in teaching, research and
innovation.
Program Outcomes (POs)
PO1: Engineering knowledge: Apply the knowledge of mathematics, science,
engineering fundamentals, and an engineering specialization to the solution of complex
engineering problems.
PO2: Problem analysis: Identify, formulate, review research literature, and analyze
complex engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
PO3: Design/development of solutions: Design solutions for complex engineering
problems and design system components or processes that meet the specified needs with
appropriate consideration for the public health and safety, and the cultural, societal, and
environmental considerations.
PO4: Conduct investigations of complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.
PO5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex
engineering activities with an understanding of the limitations.
PO6: The engineer and society: Apply reasoning informed by the contextual knowledge
to assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.
PO7: Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
PO8: Ethics: Apply ethical principles and commit to professional ethics and
responsibilities and norms of the engineering practice.
PO9: Individual and team work: Function effectively as an individual, and as a member
or leader in diverse teams, and in multidisciplinary settings.
PO10: Communication: Communicate effectively on complex engineering activities with
the engineering community and with society at large, such as, being able to comprehend

Department of Computer Science & Technology Page v


and write effective reports and design documentation, make effective presentations, and
give and receive clear instructions.
PO11: Project management and finance: Demonstrate knowledge and understanding of
the engineering and management principles and apply these to one’s own work, as a
member and leader in a team, to manage projects and in multidisciplinary environments.
PO12: Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological
change.
Program Specific Outcomes (PSOs)
PSO-1: Proficient and innovative with a strong cognizance in the arenas of sensors, IoT,
data science, controllers and signal processing through the application of acquired
knowledge and skills.
PSO-2: Apply cutting-edge techniques and tools of sensing and computation to solve
multi-disciplinary challenges in industry and society.
PSO-3: Exhibit independent and collaborative research with strategic planning while
demonstrating professional and ethical responsibilities of the engineering profession.

Department of Computer Science & Technology Page vi


Development of Temperature Measurement System using DS18B20

CONTENTS
Page No
LIST OF TABLES viii
LIST OF FIGURES viii
CHAPTER-1: INTRODUCTION
1.1 OVERVIEW 01
1.2 LITERATURE REVIEW 01
1.3 OBJECTIVES 02
1.4 APPLICATIONS 02
CHAPTER-2: PROJECT DESCRIPTION
2.1 INTRODUCTION ABOUT DS18B20 TEMPERATURE SENSOR 03
2.2 COMPONENTS USED 03
2.3 CIRCUIT DIAGRAM 07
2.3.1CONNECTIONS 07
CHAPTER-3: ARDUINO PROGRAM
3.1 INSTALLING LIBRARY FOR DS18B20 08
3.2 CODE EXPLANATION 08
3.3 ARDUINO UNO PROGRAM 09
CHAPTER-4: RESULTS AND DEMONSTRATION
4.1 OUTPUT 11
4.2 COMPARATIVE 13
4.3 SUMMARY OF THE PROJECT 13
REFERENCES 14

Department of Computer Science & Technology Page vii


Development of Temperature Measurement System using DS18B20

LIST OF TABLES
Table. No Description Page No
1.1 COMPONENTS REQUIRED 03
2.1.1 SPECIFICATOINS IN DS18B20 04

LIST OF FIGURES
Fig. No Description Page No
2.2.1 DS18B20 TEMPERATURE SENSOR 05
2.2.2 ARDUINO UNO 06
2.2.3 BREADBOARD 07
2.2.4 RESISTOR 07
2.2.5 JUMPER WIRES 08
2.3.1 CIRCUIT DIAGRAM 09
4.1 ARDUINO UNO SERIAL MONITOR CONSOLE 11
4.1.1 RESULTANT OUTPUT 12
4.1.2 TOP OF THE PROTOTYPE 12

Department of Computer Science & Technology Page viii


Development of Temperature Measurement System using DS18B20

CHAPTER-1
INTRODUCTION
1.1 OVERVIEW
In this project , measure human body temperature second to second. This is a
simple example. For a more precise and medical-grade body temperature measurement, we
need a more accurate sensor and may need to follow specific regulations and calibration
process. Ensure that have the necessary libraries installed in our Arduino IDE for this code
to work.
In this project, we will learn how to design Digital Thermometer Using Arduino &
DS18B20 Temperature Sensor. Simply we will interface Arduino with DS18B20 Digital
Waterproof Temperature Sensor and display the temperature values in degree Celsius.
A usable health-monitoring system is required for prolonged monitoring of the
patient with reduced cost. This paper describes a working prototype system for real-time
health-monitoring system using DS18B20 temperature sensor.
1.2 LITERATURE REVIEW
Due to the successful emergence of Internet of Things, sensor-based real-time
health monitoring is getting popularized. A usable health-monitoring system is required
for prolonged monitoring of the patient with reduced cost. This paper describes a working
prototype system for real-time health-monitoring system using DS18B20 temperature
sensor, Arduino UNO with micro-controller ATmega328 where Zigbee module is used
for wireless communication. In this prototype sensor data gets acquired and analyzed to
give proper feedback to the patient with or without mobility support at indoor. The sensor
vitals are collected and sent to the computing device using shielded cable and ZigBee, i.e.,
through wired and wireless communication, respectively. Analysis of patient vitals based
on medical definitions gives patient’s real-time health condition so that if condition is not
normal, then timely preventive measures can be taken to avoid further complication. Per
user data can be saved in the system database for further reference.
By Muhammad Dawood Husain and Shaneal Naqvi, University of Manchester and
NED University of Engineering and Technology; Ozgur Atalay, Istanbul Technical
University and Harvard University; Syed Talha Ali Hamdani, University of Manchester
and National Textile University; and Richard Kennon, University of Manchester
1.3 OBJECTIVES
 To measure the temperature second to second.
 To develop further projects by using ds18b20 temperature sensor.
1
Development of Temperature Measurement System using DS18B20

 To design easy and low cost.


 To determine the temperature in water and fire also.
1.4 APPLICATIONS
 Thermostatic Controls
 Industrial Systems
 Consumer Products
 Thermally Sensitive Systems
The components required for developing this system are tabulated in Table.1.1
Table.1.1 Components required
Number of
S.
Name of the component Specifications Units
No
required
1 Arduino Uno ATmega328P 1
DS18B20 digital temperature CurrentConsumption:1mA,
2 1
sensor Accuracy: ±0.5°C
3 Resistor 4.7kΩ 1
4 Breadboard 16.5x5. 5cm,5V 1
Diameter:0.6mm,
5 Jumper wires As per required
Tolerance:0.001mm

2
Development of Temperature Measurement System using DS18B20

CHAPTER-2
PROJECT DESCRIPTION
2.1 INTRODUCTION ABOUT DS18B20 TEMPERATURE SENSOR
The DS18B20 is a digital temperature sensor manufactured by (formerly Dallas
Semiconductor). It is one of the most popular temperature sensors on the market and
provides fairly high accuracy (±0.5 °C) over a large temperature range (-55 °C to + 125
°C). Because the operating voltage of the sensor is 3.0 to 5.5 V, you can use it with both
the Arduino (which operates at 5 V), as well as with devices like the ESP32 and Raspberry
Pi which have 3.3 V GPIO pins.
The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature
measurements and has an alarm function with nonvolatile user-programmable upper and
lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition
requires only one data line (and ground) for communication with a central microprocessor.
In addition, the DS18B20 can derive power directly from the data line (“parasite power”),
eliminating the need for an external power supply. Each DS18B20 has a unique 64-bit
serial code, which allows multiple DS18B20s to function on the same 1-Wire bus. Thus, it
is simple to use one microprocessor to control many DS18B20s distributed over a large
area. Applications that can benefit from this feature include HVAC environmental
controls, temperature monitoring systems inside buildings, equipment, or machinery, and
process monitoring and control systems.
2.1.1 SPECIFICATOINS IN DS18B20
Power Supply 3V to 5.5V
Current Consumption 1Ma
Temperature Range -55 to 125°C
Accuracy ±0.5°C
Resolution 9 to 12 bit (selectable)
Conversion Time < 750ms

2.2 COMPONENTS USED


The sensor works by reading and converting the temperature and storing this value
in scratchpad memory. The scratchpad memory is then read via the One-wire bus by the
Dallas library. The power-on value in the scratchpad memory is 85 °C .The core
functionality of the DS18B20 is its direct-to- digital temperature sensor.

3
Development of Temperature Measurement System using DS18B20

Fig.2.2.1 Sketch of DS18B20 Temperature Sensor


DS18B2 Arduino
0
GND GND
DQ Any digital pin (with 4.7k Ohm pull-up resistor)
VDD 5V (normal mode) or GND (parasite mode)

Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It


has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs,
a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an
ICSP header and a reset button. It contains everything needed to support the
microcontroller; simply connect it to a computer with a USB cable or power it with a AC-
to-DC adapter or battery to get started.. You can tinker with your Uno without worrying
too much about doing something wrong, worst case scenario you can replace the chip for a
few dollars and start over again.
"Uno" means one in Italian and was chosen to mark the release of Arduino Software
(IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference
versions of Arduino, now evolved to newer releases. The Uno board is the first in a series
of USB Arduino boards, and the reference model for the Arduino platform; for an
extensive list of current, past or outdated boards see the Arduino index of boards.
Barrel Jack - The Barrel jack, or DC Power Jack can be used to power your Arduino
board. The barrel jack is usually connected to a wall adapter. The board can be powered by
5-20 volts but the manufacturer recommends to keep it between 7-12 volts. Above 12
volts, the regulators might overheat, and below 7 volts, might not suffice.
VIN Pin - This pin is used to power the Arduino Uno board using an external power
source. The voltage should be within the range mentioned above.
USB cable - when connected to the computer, provides 5 volts at 500mA.
4
Development of Temperature Measurement System using DS18B20

5v and 3v3-They provide regulated 5 and 3.3v to power external components according to
manufacturer specifications.
The Arduino Uno has 6 analog pins, which utilize ADC (Analog to Digital converter).
These pins serve as analog inputs but can also function as digital inputs or digital outputs.
Reset Pin: Making this pin LOW, resets the microcontroller

Fig.2.2.2 Sketch of Arduino Uno


A Breadboard is simply a board for prototyping or building circuits on. It allows
you to place components and connections on the board to make circuits without soldering.
The holes in the breadboard take care of your connections by physically holding onto parts
or wires where you put them and electrically connecting them inside the board. The ease
of use and speed are great for learning and quick prototyping of simple circuits. More
complex circuits and high frequency circuits are less suited to breadboarding. Breadboard
circuits are also not ideal for long term use like circuits built on per board (protoboard) or
PCB (printed circuit board), but they also don’t have the soldering (protoboard), or design
and manufacturing costs (PCBs).

Fig.2.2.3 Sketch of Breadboard

5
Development of Temperature Measurement System using DS18B20

The 4.7k ohm (4700 ohm) resistor is one of the most common resistors in
electronics. The four band 4.7k resistor is easy to recognize with its’ distinctive pattern of
yellow, violet, and red color bands. The 5 and 6 band versions have a pattern of yellow,
violet, black, brown, followed by the tolerance band and temperature coefficient band on
the 6 band version.

Fig.2.2.4 Sketch Of 4.7KΩ Resistor


A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical
wire, or group of them in a cable, with a connector or pin at each end (or sometimes
without them – simply "tinned"), which is normally used to interconnect the components
of a breadboard or other prototype or test circuit, internally or with other equipment or
components, without soldering.[1] Individual jump wires are fitted by inserting their "end
connectors" into the slots provided in a breadboard, the header connector of a circuit
board, or a piece of test equipment.

Fig.2.2.5 Sketch of jumper wires

6
Development of Temperature Measurement System using DS18B20

2.3 CIRCUIT DIAGRAM

Fig.2.3.1 Circuit Diagram


2.3.1 CONNECTIONS
Connections The DS18B20 Sensor to the Arduino as follows:
 DS18B20 VCC ->Arduino 5V
 DS18B20 GND -> Arduino GND
 DS18B20 Data -> Arduino digital pin 4
o (we can use a different pin, just up date it in the code)
 Connect a 4.7k ohm resistor between the DS18B20 Data line and the VCC line.

7
Development of Temperature Measurement System using DS18B20

CHAPTER-3
ARDUINO PROGRAMING
3.1 INSTALLING LIBARIARY FOR DS18B20
The 1-Wire protocol is a bit complicated, and it takes a lot of code to make it work.
DallasTemperature.h was written to abstract away this unnecessary complexity, allowing
us to issue simple commands to obtain temperature readings from the sensor.
To install the library, navigate to Sketch > Include Library > Manage
Libraries… Wait for the Library Manager to download the library index and update the
list of installed libraries.
Filter we search by entering ‘ds18b20’. There should be a couple of entries. Look
for DallasTemperature by Miles Burton. Click on that entry and then choose Install.
Dallas Temperature is a hardware-specific library that handles lower-level
functions. It must be paired with the One Wire Library in order to communicate with any
one-wire device, not just the DS18B20. Install this library as well.
3.2 CODE EXPLANATION
The sketch begins by including the OneWire.h and DallasTemperature.h libraries
and declaring the Arduino pin to which the sensor’s signal pin is connected.
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 4
To communicate with the DS18B20 sensor, we do two things. First, we create a
one-wire object and pass the sensor’s signal pin as a parameter. Second, we create a
DallasTemperature library object and pass the reference of the one-wire object (that we just
created) as a parameter.
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
In the setup section, we establish serial communication with the PC and call the
begin() function. The begin() function scans the bus for connected DS18B20 sensors and
sets the bit resolution (12 bits) for each one.
void setup(void) {
sensors.begin(); // Start up the library
Serial.begin(9600);
}
8
Development of Temperature Measurement System using DS18B20

In the loop section, we call the request Temperatures() function, which instructs all
sensors on the bus to perform a temperature conversion.
Then we call the getTempCByIndex(deviceIndex) function, where deviceIndex is
the location of the sensor on the bus. This function reads the temperature reading from the
corresponding sensor and returns it.
If you only have one DS18B20 on the bus, set deviceIndex to 0.
void loop(void) {
sensors.requestTemperatures();
Serial.print("Celsius temperature: ");
Serial.print(sensors.getTempCByIndex(0));
Serial.print(- Fahrenheit temperature:);
Serial.print((sensors.getTempCByIndex(0) );
delay(1000);
}

3.3 ARDUINO UNO PROGRAM


#include <OneWire.h>
#include <DallasTemperature.h>
// Data wire is conntec to the Arduino digital pin 4
#define ONE_WIRE_BUS 4
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);
void setup(void)
{
// Start serial communication for debugging purposes
Serial.begin(9600);
// Start up the library
sensors.begin();
}
void loop(void){
// Call sensors.requestTemperatures() to issue a global temperature and Requests to all
devices on the bus

9
Development of Temperature Measurement System using DS18B20

sensors.requestTemperatures();
Serial.print("Celsius temperature: ");
// Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first
IC on the wire
Serial.print(sensors.getTempCByIndex(0));
Serial.print(" - Fahrenheit temperature: ");
Serial.println(sensors.getTempFByIndex(0));
delay(1000);
}

10
Development of Temperature Measurement System using DS18B20

CHAPTER-4
RESULTS AND DEMONSTRATION
4.1 OUTPUT
The output of the developed prototype model can be verified on the serial monitor
of the Arduino IDE. The fig shown in Fig.4.1, displays the temperature measured by the
sensor in both degC and F. The continuous monitoring of the temperature values for all
time instants is displayed.

Fig.4.1 Arduino Uno serial monitor console

11
Development of Temperature Measurement System using DS18B20

In the 4.1.1, figure to develop front of the prototype and display resultant output.

Fig.4.1.1 Resultant Output


In the 4.1.2,figure to develop top of the prototype.

Fig.4.1.2 Top of the prototype

12
Development of Temperature Measurement System using DS18B20

4.2 COMPARITIVE ANALYSIS


Compare normal thermometer with DS18B20 temperature sensor
 Normal Thermometer is used only to measure human body temperature. But
DS18B20 temperature sensor is used to measure temperature of hot water, flame
and surroundings.
 DS18B20 is measured time to time when compare to normal thermometer.
In this project we use few components when compare to other projects. As well as
cost of the project is low when compare to other DS18B20 temperature sensor projects. It
is more useful when compared to normal thermometer.
In this project we gain more knowledge regarding to the sensor. This sensor is more
usable compared to other sensor. In the recent era this kind of sensor based projects is
more efficient.
In this project we gain more knowledge regarding to the sensor. This sensor is more
usable compared to other sensor. In the recent era this kind of sensor based projects is
more efficient.

4.3 SUMMARY OF THE PROJECT


In this project, we will learn how to design Digital Thermometer Using Arduino &
DS18B20 Temperature Sensor. Simply we will interface Arduino with DS18B20 Digital
Waterproof Temperature Sensor and display the temperature values in degree Celsius.

13
Development of Temperature Measurement System using DS18B20

REFERENCES
Online resources followed

 https://moz.com/domain-analysis/www.google.com
 Tinkercad
 Project hub
 Arduino project hub
 Tutorials point
 Makerguides
 W3Schools
 https://moz.com/domain-analysis/youtube.com
 https://youtu.be/Y1__vmkr8-g?si=PvNHTholvqYQx2bL
 https://youtu.be/Y1__vmkr8-g?si=V2gLU-jaDCgHsoHA
 https://youtu.be/hIkUQZuaTE4?si=QhLnxhy-q5gh3VC4
 https://youtu.be/0HL-ugIC5eQ?si=HSi6oBx9z-KL2S6n
 https://youtu.be/SHOO7wIRVCs?si=OkzeN0FO_wfhpx3w
 https://youtu.be/bbLbbWi55pI?si=clDTTVWavVPgJ-E9
References
[1].Zhou Y, Sun C. DS18B20 Hardware connection and software programming. Doctoral
dissertation, 2001.
[2].Deshmukh AD, Shinde UB. A low cost environment monitoring system using
raspberry Pi and arduino with Zigbee. In: 2016 International Conference on Inventive
Computation Technologies (ICICT) (Vol. 3). IEEE, pp. 1–6, 2016.
[3].Arduino SA. Arduino. Arduino LLC, 2015.
[4]. Ipswich D. Setting up a WAMP server on your windows desktop. Technology Now at
Smashwords, 2011.
[5].Kommey B, Kotey SD, Opoku D. Patient medical emergency alert system 2018.

14

You might also like