Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Sensor Module

project: DS18B20 temperature

Thomas Gumbricht bio photo By Thomas Gumbricht

Introduction

The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line (and ground) for communication with a central microprocessor. In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply. Datasheet.

Wiring

Below are two different wirings, with a breakout board including the pull-up resistor, and with the pull up resistor added. The sketch is the same for both wiring alternatives.

KY-001

The KY-001 Arduino Temperature Module has a built-in pull-up resistor and you can wire it directly to the 5 volt power supply as shown below.

Wiring of the KY-001 Arduino module with the DS18B20 temperature sensor.

Waterproof and cabled

If your module lacks the pull-up resistor you must put a 4.7 kOhm resistore between the %v poser and the data cable, as shown in the sketch below.

Wiring of the waterproof and encased DS18B20 temperature sensor, the wiring must include the pull-up resistor of 4.7 kOhm.

Sketch

The sketch includes two libraries: OneWire.h and DallasTemperature.h. You need to install both to your library as explained in the official Arduino page on Installing Additional Arduino Libraries. In this version I have put the analog sensor signal on port A1.

Sensor Module