In this simple tutorial we will learn how to use a DS18B20 Waterproof Temperature Sensor with Arduino.
Watch the Video!
Step 1: What You Will Need
- 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 assembly, 3D printing, CNC 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
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
- 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
Download DS1820.zip