Skip to content

Temperature Probe

Updated: 6/28/2025 Words: 0 words Reading time: 0 minutes

The DS18B20 temperature probe is a temperature sensor based on the DS18B20 digital temperature sensor, commonly used for high-precision, digitized temperature monitoring. It adopts a one-wire bus protocol, offers high precision, and a wide measurement range. The probe tip is usually encapsulated in a stainless steel tube, making it suitable for liquid or humid environments (such as water temperature measurement, industrial process monitoring). It can be used for mechanical equipment, pipeline temperature monitoring, or temperature detection in fish tanks, greenhouses, and incubators.

Preparation

Hardware

HardwareDescriptionImage
Creative Box PlatformMy Image
Power Signal ModuleIncluded with Creative Box purchaseMy Image
DS18B20 Temperature ProbeTaobao Purchase Link, please choose the appropriate length according to your needs.My Image

Software

SoftwareLinkDescription
Temperature Probe AppLinkOfficial frontend application, can be loaded and used directly through the console.

Connection

My Image
Connection
Plug the power signal module into any pin header on the Creative Box. The diagram shows platform pins 16-19
The red wire of the temperature probe is the positive pole, connect to the 5V power supply of the power signal module
The black wire of the temperature probe is the negative pole, connect to the GND (ground) of the power signal module
The yellow wire of the temperature probe is the signal, connect to signal output 1 or signal output 2 of the power signal module. The diagram shows signal output 1 port connected.
Please set the jumper cap to 3.3V or 5V output position

Usage

Reading Current Temperature

Open the Creative Box console and load the Temperature Probe application from the sensor applications. Enter the application and select the pin number where the Creative Box is connected to the temperature probe signal line. The webpage will then automatically display the current temperature information.

Creative Box ConsoleLoad ApplicationSelect Pin Number and Display Current Temperature Probe Data

Principles

DS18B20 Temperature Probe

DS18B20 temperature probe parameters are as follows:

Parameter NameMTS01
Temperature Range-55°C to +125°C
Accuracy0.5°C
Control InterfaceOne-wire Bus Interface
Interface Support Rate0-100kHz
Operating Voltage3.0V - 5.0V
Power ConsumptionStandby current 750nA, measurement current 1mA

Reference Datasheet Download

Datasheet DownloadLink
DS18B20Link

Reading Temperature Value

Through the one-wire bus protocol, the platform reads the DS18B20 registers. Temperature data is stored in the registers. The diagram below (page 8 of the datasheet) shows the DS18B20 register information, totaling 9 bytes. The 16-bit temperature data is stored in the first and second bytes of the register.

My Image

After obtaining the 16-bit temperature data, it needs to be converted to Celsius. The diagram below (page 5 of the datasheet) lists how to convert to Celsius. S represents whether the Celsius temperature is above or below zero, the next 7 bits represent the integer part of the Celsius temperature, and the remaining 4 bits represent the fractional part.

My Image

Temperature Calculation

You can use binary two's complement for calculation, please refer to the following formula.

js
const temperature = negative
  ? -((((~reg_data & 0xffff) + 1) >> 4) + (reg_data & 0xf) * 0.0625)
  : ((reg_data & 0x7f0) >> 4) + (reg_data & 0xf) * 0.0625;