DIY Arduino Thermometer With DS18B20

35,647

170

21

Posted

Introduction: DIY Arduino Thermometer With DS18B20

Hello, everyone ! Today I'm going to show you how to make LCD or Serial* thermometer with DS18B20 digitaltemperature sensor using Arduino, breadboard, jumpers. So you can measure temperature of the air, liquids like water and the temperature of the ground.

*prints the temperature data on the serial monitor of the arduino IDE.

Step 1: ​Information About the Sensor

DS18B20 is 1-Wire digital temperature sensor from Maxim IC. Reports degrees in Celsius with 9 to 12-bit precision, from -55 to 125 (+/-0.5). Each sensor has a unique 64-Bit Serial number etched into it - allows for a huge number of sensors to be used on one data bus.

Features:

  • Unique 1-Wire® interface requires only one port pin for communication
  • Each device has a unique 64-bit serial code stored in an onboard ROM
  • Multidrop capability simplifies distributed temperature sensing applications
  • Requires no external components
  • Can be powered from data line.
  • Power supply range is 3.0V to 5.5V
  • Measures temperatures from –55°C to +125°C (–67°F to +257°F)±0.5°C accuracy from –10°C to +85°C
  • Thermometer resolution is user-selectable from 9 to 12 bits
  • Converts temperature to 12-bit digital word in 750ms (max.)
  • User-definable nonvolatile (NV) alarm settings
  • Alarm search command identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition)
  • Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermally sensitive system

Step 2: Gathering the Parts

To make the thermometer you will need the following things:

  1. Arduino board (UNO,DUE,Micro, etc..).
  2. DS18B20 sensor a waterproof or not and one 4.7k resistor*
  3. 16x2 LCD display with I2C bus.
  4. Breadboard and some jumpers to connect everything together.

*Some stores sell the sensor with 4.7k resistor

Step 3: Libraries !!!

Before you start to make the thermometer, download and unzip the following libraries for arduino at - /Progam Files(x86)/Arduino/Libraries (default)

  1. 1- Wire bus
  2. Dallas Temperature, it does all the calculations and other stuff
  3. Liquid Crystal I2C

Step 4: Serial Thermometer

To print the data on the Serial monitor connect the DS18B20 sensor to the Arduino using the jumpers and the breadboard and don't forget to connect or solder the 4.7k resistor between pin 2 an 3 of the sensor.

Then download, open and upload the .ino file which is named - DS18B20_Serial.

If everything is ok you should see the temperature being measured and showed in the Serial monitor of the arduino IDE like on the screenshot above.




Step 5: LCD Thermometer

If you don't want to measure the temperature through the serial monitor then this step is for you !

Connect the I2C LCD to pins UNO,- A4 (SDA) , A5 (SCL) andthe sensor to digital pin 2. Then download and upload the .ino file which is named - DS18B20_I2C_LCD . If everything is OK you will see the temperature readings on the display.

Also visit my previous instructable Arduino Thermometer With LM35 - here

2 People Made This Project!

Recommendations

  • Science of Cooking

    Science of Cooking
  • Pocket-Sized Contest

    Pocket-Sized Contest
  • Spotless Contest

    Spotless Contest
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

17 Comments

Thnx, good, basic tutorial - while playing around with this i confirmed that the pullup R is required, it will NOT work without it.

temperature trough is a typographical error. The author was trying to say "measure temperature through the serial..."

so how do you fix it

It's a "typo", not a technical error. I read, and was confused by the sentence "If you don't want to measure the temperature Trough the serial interface ..." (and judging by the comments, I wasn't the only one). Trough made me think of waterbath, and other experimental techniques.

The author intended to say (and has since corrected it to) say "Through", not "Trough". A minor issue in an awesome instructable.

hi.thanks very lot for this project.
I have a question:
how can i save the log for a month which data save per hour a day.
i mean save the log hour to hour for 1 month.and so i can draw the graph of these logs.
please help me.thanks a lot master.

thanks!! we will use this for our thesis project :)

Works like a charm.

Thanks:-)

Thnal

Thanks for the tutorial! Was really useful ;)

I complemented this with another tutorial http://undercontrol.io/ds18b20-temperature-sensor/ and finally got connected my DS18b20 with an ESP8266.

Maybe the tutorial is not so complete, but I found that the SDK and platform provided work like a charm!