KY-001 DS18B20 Dallas Temperature sensor Interfacing

with Arduino, Node MCU, ESP32

para

This is the latest DS18B20 1-Wire digital temperature sensor from Maxim IC. Reports degrees C with 9 to 12-bit precision, -55C to 125C (+/-0.5C). Each sensor has a unique 64-Bit Serial number etched into it – allows for a huge number of sensors to be used on one data bus. This is a wonderful part that is the corner stone of many data-logging and temperature control projects. Because they are digital, you don’t get any signal degradation even over long distances! The DS18B20 provides 9 to 12-bit (configurable) temperature readings over a 1-Wire interface, so that only one wire (and ground) needs to be connected from a central microprocessor. Usable with 3.0-5.5V systems. The DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply. Digital out put eliminates the requirement of ADC device and circuitry.

 
Because each DS18B20 contains a unique silicon serial number, multiple DS18B20s can exist  on the same 1-Wire bus. This allows for placing temperature sensors in many different places. Applications where this feature is useful include HVAC environmental controls, sensing temperatures inside buildings,equipment or machinery, and process monitoring and control.

Features

three-pin

Description: Arduino Temperature Sensor Module Keyes KY-001, Allows ambient temperature measurement using digital serial bus. 

Specifications: The KY-001 Temperature Sensor Module consists of a DS18B20 single-bus digital temperature sensor, a LED and a resistor. Compatible with popular electronics platforms like Arduino, Raspberry Pi and Esp8266.

count

Operating Voltage: 3.0V to 5.5V

Measurement Accuracy Range: ±0.5°C

DS18B20 Working Principle

The oscillation frequency of the crystal oscillator with low temperature coefficient in the picture is little affected by temperature. It is used to generate a fixed frequency pulse signal and send it to the subtraction counter

1. The high temperature coefficient crystal oscillator changes its oscillation frequency significantly with temperature changes. At the same time, the generated signal is used as the pulse input of the subtraction counter.

2. The figure also implies a counting gate. When the counting gate is opened, DS18B20 counts the clock pulses generated by the low temperature coefficient oscillator to complete the temperature measurement.

64-bit

The subtraction counter 1 subtracts the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of the subtraction counter 1 is reduced to 0, the value of the temperature register will increase by 1, the preset of the subtraction counter 1 will be reloaded, and the subtraction counter 1 will restart counting the pulse signals generated by the low temperature coefficient crystal oscillator.

This loop until the subtraction counter 2 counts to 0, stop the accumulation of the temperature register value. The value in the temperature register is the measured temperature at this time.

The slope accumulator is used to compensate and correct the nonlinearity in the temperature measurement process, and its output is used to correct the preset value of the subtraction counter. As long as the counting gate is not closed, repeat the above process until the temperature register value reaches the measured temperature value. This is the temperature measurement principle of DS18B20.

The internal structure of DS18B20 mainly includes 4 parts:

In the 64-bit ROM, the manufacturer has a 64-bit serial number burned by the manufacturer before the product leaves the factory. The serial number can be regarded as the address serial code of DS18B20, used to distinguish each DS18B20. So as to better realize the multi-point measurement of field temperature.

KY-001 DS18B20 Dallas Temperature sensor Interfacing with Arduino:

There are only three pins on this module of which VCC and GND are connected to 5 volts DC and ground pins of Arduino. Third pin gives out data on a single pin in Digital format which is connected to Pin 7 of Arduino. In case the temperature exceeds certain value Pin 9 would go high for down stream control. Apart from this Arduino Pin 2, Pin 3 and Pin 4 must be connected to green LED, red LED and Buzzer respectively. While green LED indicates that Arduino is switched on Red LED and Buzzer indicates the set temperature has been exceeded when Pin 9 gets activated.

KY-001 DS18B20 Dallas Temperature sensor Interfacing with Node MCU:

There are only three pins on this module of which VCC and GND are connected to 3.3 volts DC and ground pins of Node MCU. Third pin gives out data on a single pin in Digital format which is connected to Pin GPIO7 of Node MCU. In case the temperature exceeds certain value Pin GPIO9 would go high for down stream control. Apart from this Node MCU Pin GPIO2, Pin GPIO3 and Pin GPIO4 must be connected to green LED, red LED and Buzzer respectively. While green LED indicates that Node MCU is switched on Red LED and Buzzer indicates the set temperature has been exceeded when Pin 9 gets activated.

DS18B20 Dallas Temperature sensor Interfacing with ESP32:

There are only three pins on this module of which VCC and GND are connected to 3.3 volts DC and ground pins of ESP32. Third pin gives out data on a single pin in Digital format which is connected to Pin GPIO7 of ESP32. In case the temperature exceeds certain value Pin GPIO9 would go high for down stream control. Apart from this ESP32 Pin GPIO2, Pin GPIO3 and Pin GPIO4 must be connected to green LED, red LED and Buzzer respectively. While green LED indicates that ESP32 is switched on Red LED and Buzzer indicates the set temperature has been exceeded when Pin 9 gets activated.