Temperature Sensor DS18B20

By Emir

Waterproof temperature sensor can be helpful in various projects. Knowing the exact temperature in your surroundings is the key to so many problems and can give you a lots of solutions.

In this tutorial you will learn how to use DS18B20 waterproof sensor the easy and fun way.

Step 1

Bill of materials

  • Arduino board with USB cable (we use Arduino Uno)
  • Temperature sensor DS18B20
  • 4.7k ohm resistor (4700 Ω or 4k7 Ω)
  • 3 pcs male to male wires
  • Breadboard
Step 2

Connect sensor wires to breadboard

Connect three sensor wires in separate lines on breadboard.

show more
Step 3

Add resistor

It is important to add resistor between Vcc and Data pins (red and yellow).

Step 4

Connect wires with Arduino board

Now connect sensor pins with Arduino board using additional male wires.

  • Red to 5V;
  • Yellow to pin 10;
  • Gray to ground.

Use picture as reference.

Step 5

Download and install DS18B20 library

To use DHT22 you need appropriate library to read sensor data.

Download DS18B20 library as ZIP from Github.

To Install the library first unzip downloaded archive. After unzip copy folder "OneWire-master" to (My) Documents->Arduino->Libraries folder.

Open Arduino IDE (restart) and check that it's in a new library added to "File"->"Sketchbook"->"libraries"->"OneWire-master".

show more
Step 7

Upload code to Arduino board

Connect Arduino with your computer using USB.

Upload Code to Arduino.

show more
Step 8

Check results

Open Serial Monitor and check results.

show more

Tutorial Forum

There are no posts here yet. Add the first post