How to Use DS18B20 Waterproof Temperature Sensor With Arduino

by RonFrtek in Circuits > Arduino

475 Views, 2 Favorites, 0 Comments

How to Use DS18B20 Waterproof Temperature Sensor With Arduino

How to Use DS18B20 Waterproof Temperature Sensor With Arduino

In this simple tutorial we will learn how to use a DS18B20 Waterproof Temperature Sensor with Arduino.

Watch the Video!

What You Will Need

ds1820.jpg
VisuinoAdvrtisementPLCXPertTinyLab (1).jpg
breadboard.png
F7WXB0JJJ4ZYGGX.LARGE.jpg
FZEK4WBK3XGYAP0.LARGE.jpg
  • DS18B20 Waterproof Temperature Sensor
  • OLED Display
  • Arduino UNO (or any other Arduino)
  • 4.7K ohm resistor
  • Jumper wires
  • Breadboard
  • Visuino program: Download Visuino


Brought by PCBWay

2022-08-26_13-41-18.jpg

Thank you PCBWay for supporting this tutorial and helping users learn more about electronics.

What I like about the PCBWay is that you can get 10 boards for approximately $5 which is really cost effective for professional made boards, not to mention how much time you save!

Go check them out here. They also offer a lot of other stuff in case you might need it like assembly3D printingCNC machining and a lot more.

The Circuit

2022-09-24_15-12-47.jpg
  • Connect Arduino digital pin [2] to 1K ohm resistor
  • Connect Arduino digital pin [2] to DS18B20 Yellow wire
  • Connect 1K ohm resistor to Arduino pin [5V]
  • Connect Arduino pin [5V] to DS18B20 Red wire [+]
  • Connect Arduino pin [GND] to DS18B20 Black wire [GND]
  • Connect Arduino pin [5V] to OLED pin [VCC]
  • Connect Arduino pin [GND] to OLED pin [GND]
  • Connect Arduino pin [SDA] to OLED pin [SDA]
  • Connect Arduino pin [SCL] to OLED pin [SCL]



Start Visuino, and Select the Arduino UNO Board Type

FRWQB80K1RVKKV9.LARGE.jpg
Visuino-Select-Board-UNO.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

In Visuino Add & Set Components

2022-09-24_15-16-10.jpg
2022-09-24_15-16-31.jpg
2022-09-24_15-16-54.jpg
2022-09-24_15-17-39.jpg
2022-09-24_15-17-12.jpg
  • Add "DS1820" component
  • Add "OLED I2C" component


  • Double click on the "DisplayOLED1" component and in the "Elements" window:
  • Drag "Draw Text" to the left side and in the properties window set "Size" to 2 and "Text" to TEMP:
  • Drag "Text Field" to the left side and in the properties window set "Size" to 3 and "Y" to 30
  • Close the "Elements" window

In Visuino Connect Components

2022-09-24_15-18-04.jpg
  • Connect "Thermometer1" pin [Out] to "DisplayOLED1" > "Text Field1" pin [In]
  • Connect "Thermometer1" pin [One Wire] to Arduino Digital pin [2]
  • Connect "DisplayOLED1" pin I2C [Out] to Arduino I2C pin [In]

Generate, Compile, and Upload the Arduino Code

FBR42I2KXBU01YW.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino module a temperature value will show on the OLED Display.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Downloads