How To Use Ds18b20 Waterproof Temperature Sensor & Arduino

About the project

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

Project info

Difficulty: Easy

Platforms: AdafruitArduinoVisuino

Estimated time: 1 hour

License: GNU General Public License, version 3 or later (GPL3+)

Items used in this project

Hardware components

Jumper wires (generic) Jumper wires (generic) x 1
Resistor 47.5k ohm Resistor 47.5k ohm x 1
Breadboard (generic) Breadboard (generic) x 1
Arduino UNO Arduino UNO x 1
ElectroPeak 0.96" OLED 64x128 Display Module ElectroPeak 0.96" OLED 64x128 Display Module x 1
Adafruit Waterproof DS18B20 Digital temperature sensor Adafruit Waterproof DS18B20 Digital temperature sensor x 1

Software apps and online services

Visuino Visuino
Arduino Web Editor Arduino Web Editor
Arduino IDE Arduino IDE

Story

Step 1: What You Will Need

1 / 7

  • DS18B20 Waterproof Temperature Sensor
  • OLED Display
  • Arduino UNO (or any other Arduino)
  • 4.7K ohm resistor
  • Jumper wires
  • Breadboard
  • Visuino program: Download Visuino

Step 2: Brought by PCBWay


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.


Step 3: The Circuit

  • 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]

Step 4: Start Visuino, and Select the Arduino UNO Board Type

1 / 2

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

Step 5: In Visuino Add & Set Components

1 / 5

  • 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

Step 6: In Visuino Connect Components

  • 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]

Step 7: Generate, Compile, and Upload the Arduino Code

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.

Step 8: 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

Schematics, diagrams and documents

Visuino File

Code

Visuino File

Credits

Photo of Ron

Ron

Arduino Developer

   

Leave your feedback...