Digital DS18B20 Temperature Sensor Cable Assembly

custom made waterproof multiple display esp32 lcd breadboard, arduino mega nano ds18b20 sensor Cable Assembly datasheet.
DS18B20 is a digital temperature sensor with a wide range of applications. It outputs digital signals and has the characteristics of small size, low hardware resource consumption, strong anti-interference ability and high precision.

custom made waterproof multiple display esp32 lcd breadboard, arduino mega nano ds18b20 sensor Cable Assembly datasheet.
DS18B20 is a digital temperature sensor with a wide range of applications. It outputs digital signals and has the characteristics of small size, low hardware resource consumption, strong anti-interference ability and high precision.

DS18B20  temperature sensor features
1. Adopt single-wire interface method: DS18B20 temperature sensor only needs one wire to achieve two-way communication with the microprocessor.
2. Temperature measurement range: The temperature measurement range of DS18B20 temperature sensor Cable Assembly can reach -55℃~+125℃, and the error is ±0.4° in the range of -10℃ to +85℃.
3. Support multi-point networking function: multiple DS18B20 temperature sensors can be connected in parallel on a data line, up to 8 can be connected in parallel to achieve multi-point temperature measurement.
4. Working power supply: 3.0~5.5V/DC. The DS18B20 temperature sensor can be powered by an external independent power supply or a data line parasitic power supply.
5. The DS18B20 temperature sensor does not require any external components during application.
6. The temperature measured by the DS18B20 temperature sensor is transmitted serially in a 9 to 12-bit digital format.
7. Power-down protection function, the DS18B20 temperature sensor contains EEPROM inside. Digital conversion accuracy and alarm temperature can be set through the configuration register. The resolution and alarm temperature settings can still be saved after the DS18B20 temperature sensor is powered off.
8. The DS18B20 temperature sensor returns a 16-bit binary number representing the temperature value detected at this moment, and the high five digits represent positive and negative. If the high five bits are all 1, it means that the returned temperature value is a negative value. If the high five bits are all 0, it means that the returned temperature value is a positive value. The following 11 bits of data represent the absolute value of the temperature. After converting it to a decimal value, multiply it by 0.0625 to get the temperature value at this time.

Control method of temperature sensor DS18B20
DS18B20 has six control commands, as shown in Table 4.1:
Table 4.1 has six control commands for DS18B20
Instruction agreement code operation instructions:
Temperature conversion 44H: Start DS18B20 for temperature conversion;
Read temporary register BEH: Read temporary register 9-byte binary number;
Write temporary register 4EH: Write data into the TH and TL bytes of the temporary register;
Copy temporary register 48H: Write the TH and TL bytes of the temporary register to E2PROM;
Re-adjust E2PROM B8H: write the TH and TL bytes in the E2PROM to the temporary register TH and TL bytes;
Read the power supply mode B4H: Start DS18B20 to send the power supply mode signal to the main CPU;

Initialization of temperature sensor DS18B20
(1) First set the data line to high level “1”.
(2) Delay (the time requirement is not very strict, but it should be as short as possible)
(3) The data line is pulled to low level “0”.
(4) Delay of 750 microseconds (the time range can be from 480 to 960 microseconds).
(5) The data line is pulled to high level “1”.
(6) Delay waiting: If the initialization is successful, a low level “0” returned by DS18B20 will be generated within 15 to 60 microseconds. Its existence can be determined based on this status, but you should be careful not to wait indefinitely, otherwise the program will enter an infinite loop, so timeout control is required.
(7) If the CPU reads the low level “0” on the data line, it will still need to delay. The delay time is at least 480 microseconds from the high level sent out (from the time of step (5)).
(8) Pull the data line to high level “1” again and end.

Write operation of temperature sensor DS18B20
(1) The data line is first set to low level “0”.
(2) The delay time is determined to be 15 microseconds.
(3) Send bytes in order from low bit to high bit (only one bit is sent at a time).
(4) The delay time is 45 microseconds.
(5) Pull the data line to high level.
(6) Repeat the operations from (1) to (6) until all bytes have been sent.
(7) Finally, pull the data line high.

Read operation of temperature sensor DS18B20
(1) Pull the data line high to “1”.
(2) Delay 2 microseconds.
(3) Pull the data line low to “0”.
(4) Delay 3 microseconds.
(5) Pull the data line high to “1”.
(6) Delay 5 microseconds.
(7) Read the status of the data line to get 1 status bit, and perform data processing.
(8) Delay 60 microseconds.

DS18B20 temperature sensor parasitic power supply mode
The parasitic power supply mode of the DS18B20 temperature sensor is shown in the figure below. In the parasitic power supply mode, the DS18B20 temperature sensor draws power from the signal line. When the signal line is high, electrical energy is stored in the internal capacitor. When the signal line is at a low level, the power on the capacitor is consumed, and the capacitor (parasitic power supply) is charged until the signal line reaches a high level.

Advantages of parasitic power supply:
1. No local power supply is required, and remote temperature measurement can be achieved.
2. Temperature measurement can be achieved with only one signal line, making the circuit simpler.

Disadvantages of parasitic power supply:
In order for the DS18B20 temperature sensor to perform accurate temperature conversion, the signal line must ensure that sufficient energy is provided during the temperature conversion. But when multiple DS18B20 temperature sensors are hung on the same signal line, the pull-up resistor alone cannot provide enough power, which will cause the DS18B20 temperature sensor to be unable to measure temperature or have a huge error.
Therefore, the parasitic power supply method is only suitable for use when measuring temperature with a single DS18B20 temperature sensor.

 
 
3.5mm audio interface DS18B20 sensor

3.5mm audio interface DS18B20 sensor

DS18B20 sensor probe

DS18B20 sensor probe

USB interface DS18B20 sensor

USB interface DS18B20 sensor

DS18B20 temperature sensor parasitic power supply strong pull-up power supply mode
The strong pull-up power supply mode of the DS18B20 temperature sensor parasitic power supply is shown in the figure below. In order for the DS18B20 temperature sensor to obtain sufficient power supply during the temperature measurement process, using a MOSFET to directly pull the signal line to VCC can provide sufficient power (when any copy or start temperature conversion command is involved, it must be completed within a maximum of 10 μS. The signal line switches to a strong pull-up state) to solve the problem of insufficient power supply. The strong pull-up power supply mode of the DS18B20 temperature sensor parasitic power supply is suitable for multi-point temperature measurement applications, but it requires one more I/O line for strong pull-up switching.

External power supply mode of DS18B20 temperature sensor
In the external power supply mode, the working power supply of the DS18B20 temperature sensor is connected to the VDD pin. There is no problem of insufficient power supply current and the conversion accuracy can be guaranteed. At the same time, multiple DS18B20 temperature sensors can be connected to the bus to form a multi-point temperature measurement system. The external power supply method is the best power supply method for the DS18B20 temperature sensor: it works stably and reliably, has strong anti-interference ability, and the circuit is relatively simple.

Internal structure of DS18B20 temperature sensor
The interior of the DS18B20 temperature sensor is composed of 64-bit ROM, cache memory, CRC generator, temperature sensitive device, high and low temperature trigger and configuration register.

1. 64-bit ROM of DS18B20 temperature sensor
There is a 64-bit ROM inside the DS18B20 temperature sensor, and the ROM curing has certain contents. The lower eight bits (fixed to 28H) are the product type identification number, the next 48 bits are the serial number, and the upper eight bits are the previous 56 bits of cyclic redundancy check code.

2. Memory mapping of DS18B20 temperature sensor
There are 9-byte cache memory units in the DS18B20 temperature sensor, as shown in the figure below.

3. Configuration register of DS18B20 temperature sensor
The highest bit BIT7 of the configuration register byte of the DS18B20 temperature sensor is the test mode bit. It is 0 when shipped from the factory and does not need to be changed by the user. BIT6 and BIT5 are used to set the conversion resolution of the DS18B20 temperature sensor. There are four resolution options: 9, 10, 11 and 12 bits. The corresponding conversion times are: 93.73ms, 187.5ms, 375ms and 750ms respectively. The remaining 5 lower bits are reserved bits (all 1).
The default R0 and R1 settings of the DS18B20 temperature sensor are 11. That is 12-bit resolution, that is, 1 bit represents 0.0625 degrees Celsius.

Reading and writing of DS18B20 temperature sensor
instruction
The temperature value converted by the DS18B20 temperature sensor is stored in the 0th and 1st bytes of the high-speed temporary storage memory in two-byte complement form. So when we just want to simply read the temperature value, we only need to read the 0th and 1st bytes in the temporary register.

The simple steps to read the temperature value are as follows:
1. Skip ROM operation.
2. Send temperature conversion command.
3. Skip ROM operation.
4. Send the read temperature command.
5. Read the temperature value.

Initialization of DS18B20 temperature sensor
The master device first sends a low-level pulse of 480-960 microseconds, then releases the bus to high level, and detects the bus within the subsequent 480 microseconds. If there is a low level, it means that there is a DS18B20 temperature sensor on the bus that has responded. If there is no low level, it means that there is no response from the DS18B20 temperature sensor on the bus.
As a slave device, the DS18B20 temperature sensor has been detecting whether there is a low level of 480-960 microseconds on the bus as soon as it is powered on. If so, wait 15-60 microseconds after the bus turns high, then pull the bus level low for 60-240 microseconds to respond with a pulse, telling the host that the device is ready. If it is not detected, it will keep checking and waiting.

Contact Us

Waiting for your email, we will reply you within 12 hours with valuable information you needed.

RELATED PRODUCTS

Request A Quote

Fill in our quote request form and we will reply to your message as soon as possible!