Tuesday, February 20th, 2024
Latest updates

DS18B20 issues


I’m using the DS18S20 and DS18B20 in a energy control system. The
1-wire temperature sensors is connected on the same 1-wire bus. Just
these two sensors are connected to the bus. The 1-wire is connected to
a microcontroller i/o port. To pull down the 1-wire bus, an open drain pulldown
transistor and a 1k resistor to +5V are used. The DS18B20 is connected
to the bus using two wires only. The sensor Vdd is connected to GND on
the sensor, to be able to operate it with parasitic power. The other
sensor DS18S20 is connected using 3 wires.
Two different sensor part types was used to easily distinguish them from one another in firmware. I my application I found that safer and easier than
using the pre-programmed unique 64-bit serial code.

This is the problem:
To make the sensors do another temp measurement I send out to the sensors the
command “ConvertTemp” as a broadcast message. After 1 second, I read the
individual sensors using the “ReadScratcpad” command. The DS18B20
always updates the temperature. But sometimes very rare, the DS18S20 do not
update the temperature, but the same old temperature is read back. When
the DS18S20 has entered this state there is no way it will go back to
normal operation. It always returns the same temperature. It happens
very rare, maybe once a month, but when first entered this state it
will never recover by itself. In my application this sensor is
controlling some parts of the hvac system in a house.

I have checked the timing and logic levels, everything is perfect.

Is this a known problem? Is there a way to reset the sensor without
disconnecting the power supply?

Answer received from Dallas Semiconductor(*) application engineer:

The part may be going into a test mode because it received the Read SP command, BEh, as 9Eh. This may happen in noisy environments, not optimal driving scheme, long wires.
To reset the sensor, send it a software POR command, 64h (preceded as normal by reset/presence and a skip ROM or match ROM).

The factory test command 9Eh is not described in the datasheet.

Affected parts: DS18B20, DS18S20

*( Dallas Semiconductor, acquired by Maxim Integrated in 2002 , then acquired by Analog Devices in 2021, was a company that designed and manufactured analog, digital, and mixed-signal semiconductors.)

About Terje