Awesome
Your DS18B20 temperature sensor is likely a fake, counterfeit, clone...
...unless you bought the chips directly from Analog Devices (or Maxim Integrated before Analog Devices acquired them, or Dallas Semiconductor in the old days), an authorized distributor (DigiKey, RS, Farnell, Mouser, etc.), or a big retailer, or you took exceptionally good care purchasing waterproofed DS18B20 probes. We bought over 1000 "waterproof" probes or bare chips from more than 70 different vendors on ebay, AliExpress, and online stores -big and small- in 2019. All of the probes bought on ebay and AliExpress contained counterfeit DS18B20 sensors, and almost all sensors bought on those two sites were counterfeit.
Author: Chris Petrich, 11 Nov 2024. License: CC BY. Source: https://github.com/cpetrich/counterfeit_DS18B20/
(Sensor information based on sensors or probes ordered well after 2019 are either indicated as such or tagged with the year of addition, e.g. "(2020)".)
TLDR; How do I know?
If the ROM does not follow the pattern 28-xx-xx-xx-xx-00-00-xx then the DS18B20 sensor is a clone [5].
However, the ROM pattern is not a sufficient test for authenticity. Case in point, if the pattern is 28-xx-xx-xx-00-00-00-xx and the topmark specifies die C4
then the sensor is a clone because that ROM pattern pre-dates the C4
die, cf. Discussion 42. (2024)
There is an Arduino sketch provided to test DS18B20 sensors:
discover-classify_fake_DS18B20.ino
is a menu-driven sketch that performs harmless tests that inidcate if a sensor shows deviations from Dallas/Maxim/Analog DS18B20. It can optionally attempt to match a sensor to a specific Family (see below), largely based on the response to undocumented function codes (use this function at your own risk). The sketch is not designed to work with parasite power. (As of 10 Nov 2024, the two sketchesdiscover_fake_DS18B20.ino
andclassify_fake_DS18B20.ino
from 2019 are removed as they are out of date.)
Nomenclature: The ROM 28-AA-BB-CC-DD-EE-FF-0C would be written 28-FFEEDDCCBBAA in the Linux 1-wire subsystem.
Overview as of 2024
There is the original/authentic DS18B20 (Family A1) which has stood the test of the time, and then there are clones that are either primarily designed to appear as authentic, or designed with innovative or at least useful features.
Within the first group we have Families A2 (obsolete) and A3 (a recent addition) that seem to have been designed to enter the market as counterfeits with the intent to deceive the customer. Family A3 copies every aspect of the originals that had been tested for in the 2019 Arduino sketches of this repository in addition to matching the data in the "Temperature data" plot, i.e. the temperature offset at 0 °C and the conversion time (which, by the way, is among the slowest of all clones). However, unlike Family A2 (which pre-dates this repository), they stopped there with their efforts to replicate the original (the hallmark of a student project...). While I am flattered to see that somebody actually designed and manufactures microchips to my specifications I do consider this a waste of developer skill and advancement in technology. Also in the first group is Family B1v2, which is a recent variant of Family B1 with the 2-byte user memory removed to make it act more like an authentic DS18B20: a somewhat sad course of development; Family G that, as far as I can tell, doesn't add anything significant but introduces quirks that are either funny (cf. byte 6) or will lead to system failure in parasite power mode (like, pulling the data line low(!)); and Family H, which looks a bit like Family G without the quirks. Granted, Families G and H perform 12-bit temperature conversions twice as fast as the authentic DS18B20, so maybe they deserve credit for that.
The second group of clones is the bright side. We see that
- GXCAS (Family B1 excluding B1v2), 7Q-Tek (Family B2), Mysentech (Family D), and Novosense (Family E) have added 2 or 3 bytes of user memory to their clones (Family E has dedicated function codes to read, write, and store them in EEPROM),
- Family C, Mysentech (Family D1), and Xinbole (Family F) introduced clones that perform 12-bit temperature conversion in under 30 ms, i.e. 5% of the guaranteed conversion time of the authentic DS18B20 (granted, Family D1 has poor temperature performance),
- Xinbole (Family F) has an extended temperature mode that allows temperatures to be measured up to 150 °C, and
- Mysentech (Family D2) can enter a 14-bit mode with 0.016 °C resolution.
I really appreciate the hidden gems in some of the chips and the efforts of the engineers behind them. However, none of this should be understood as an endorsement as I have not tested whether the sensors live up to the specification in their respective datasheets, let alone the specifications in the Maxim/Analog datasheet.
Why should I care?
Besides ethical concerns, some of the counterfeit sensors actually do not work in parasitic power mode, have a high noise level, temperature offset outside the advertised ±0.5 °C band, do not contain an EEPROM, have bugs and unspecified failure rates, or differ in another unknown manner from the specifications in the Maxim datasheet. Clearly, the problems are not big enough to discourage people from buying probes on ebay, but it may be good to know the actual specs when the data are important or measurement conditions are difficult.
What are we dealing with?
Definitions differ, but following AIR6273, a counterfeit is an unauthorized copy, imitation, substitute, or modification misrepresented as a specific genuine item from an authorized manufacturer [13]. As of 2019, the main problem is imitations (clones) that are labeled to mislead the unsuspecting buyer. Fortunately, DS18B20 clones are nearly trivially easy to identify: Marking on the chip printed rather than lasered? No mark in the rear indent? Probably a conterfeit. Content of the "scratchpad register" doesn't comply with the datasheet? Probably a counterfeit. Behaves systematically different from known authentic chips? Probably a counterfeit.
What do they look like?
Above is an example of an authentic, Maxim-produced DS18B20 sensor in TO-92 case.
- As of writing (2019), the topmark of original Maxim chips is lasered rather than printed.
- The first two rows,
DALLAS 18B20
, specify that this part is a DS18B20 (Dallas Semiconductor being the original producer), parasitic power-only chips bear the maringDALLAS 18B20P
. - The
+
in the 4th row indicates that the part is RoHS compliant ([1]). - The 3rd row specifies production year and week number of the year (in this case, week 32 of 2019), and
- the last two characters in row 3 specify the revision of the die (currently
C4
). - In row 4, the three-digit number followed by two characters are a form of batch code that allows Maxim to trace back the production history.
- In chips produced 2016 or later I've only come across character combinations
AB
andAC
[5].
- In chips produced 2016 or later I've only come across character combinations
- The marking inside the indent on the rear of the case is
P
(Philippines?) on all chips 2016 through 2019, on most chips in 2020 (2020), and on most(?) chips going back at least as far as 2009 [5].THAI <letter>
(Thailand?) where<letter>
is one ofI
,J
,K
,L
,M
,N
,O
,S
,T
,U
,V
,W
,X
and possibly others, at least on some chips produced in 2011 [5]. The<letter>
uses a different font than the letters making upTHAI
.- possibly additional markings or no markings on some chips since 2020 (cf. Issue 21, Issue 22) (2020)
- From what I've seen on the TO-92 package, there is exactly one batch code associated with a date code for chips marked
P
in the indent [5]. This does not hold true for chips markedTHAI
in the indent [5].
To avoid confusion: the relevant Maxim part number of the chips investigated here is DS18B20+
, i.e. TO-92 package and RoHS compliant. Not everything said on this page may apply to the DS18B20+PAR
parasitic power-only variant (I cannot tell since I have only looked at a handfull of those). For the sake of brevity, the chips are referred to as DS18B20
as written in the datasheet [1].
How do I know if I am affected?
If the DS18B20 have been bought from authorized dealers though a controlled supply chain and are marked as being produced by either Maxim or Analog Devices then the chips are legit.
Otherwise, (I) one can test for compliance with the datasheet. (One should actually, as even authentic parts may have been mishandled along an unauthorized distribution chain. But that's yet another issue.) If a sensor fails any of those tests, it is a fake (unless Maxim's implementation is buggy [4]). (II) one can compare sensor behavior with the behavior of Maxim-produced DS18B20. Those tests are based on the conjecture that all Maxim-produced DS18B20 behave alike. This should be the case at least for sensors that share a die code (which has been C4
since at least 2009 [5]) [5].
Regarding (I), discrepancy between what the current datasheet says should happen and what the sensors do include [1,5]
- Family B: reserved bytes in scratchpad register can be overwritten (by following instructions in the datasheet)
- Family C: the sensor is fixed in 12-bit mode (i.e., byte 4 of the scratchpad register is always
0x7f
) - Family C: the number of EEPROM write cycles is very small (order of 10 rather than >50k)
- Family B1, D1: ROM can be changed in software, i.e. it is not lasered
- Family A2, B2, D1: significant number of sensors with offsets outside the ±0.5 C range at 0 °C
- Family D: sensor does not respond in parasitic mode (applies to most sensors of Family D)
- Family D: the temperature reading right after power-up is 25 rather than 85 °C
- Family D: sensor does not perform low-resolution temperature conversions faster
- Family D: reserved bytes 5 and 7 of the scratchpad register are not
0xff
and0x10
, respectively - Family D1: retains temperature measurements during power cycles
- Family E: has custom scratchpad register
- Family F: completion of temperature conversion cannot be polled
- Family F: can measure temperatures up to 150 °C (rather than 125 °C)
- Family A3: polling for completion of temperature conversion works only after some delay
Hence, as of 2019, every fake sensor available did not comply with the datasheet in at least one way. (As of 2024, this cannot be said of Families G or H.)
Regarding (II), there is one pathetically simple test for differences with Maxim-produced DS18B20 sensors that most counterfeit sensors fail [5]:
- It is a fake if its ROM address does not follow the pattern 28-xx-xx-xx-xx-00-00-xx [5]. (They ROM is essentially a 48-bit counter with the most significant bits still at 0 [5].) Only Family A3 makes an effort to thwart this rule, but as of 2024, they are overdoing it. Also, with the exception of rare Family A2 and Families A3, B1v2, and H, none of the clones set reserved byte 6 in the scratchpad register correctly. Only the clones of Family A2 and A3 respond correctly to undocumented function codes regarding the Trim values.
In addition to obvious implementation differences such as those listed above under (I) and (II), there are also side-channel data that can be used to separate implementations. For example, the time reported for a 12 bit-temperature conversion (as determined by polling for completion after function code 0x44 at room temperature) is characteristic for individual chips (reproducible to much better than 1% at constant temperature) and falls within distinct ranges determined by the circuit's internals [5]:
- 11 ms: Family D1
- 21-23 ms: Family E (2024)
- 28-30 ms: Family C
- 226-320 ms: Family G (2024)
- 325-505 ms: Family A2
- 460-525 ms: Family D2
- 580-615 ms: Family A1
- 577-626 ms: Family A3 (2024)
- 585-730 ms: Family B
Hence, there will be some edge cases between Families A1, A3, and B, but simply measuring the time used for temperature conversion will often be sufficient to determine if a sensor is counterfeit.
An important aspect for operation is a sensor's ability to pull the data line low against the fixed pull-up resistor. Turns out this abilitly differs between families. The datasheet guarantees that a sensor is able to sink at least 4 mA at 0.4 V at any temperature up to 125 °C [1]. Providing a current of 4 mA (1.2 kOhm pull-up resistor against 5 V), the following low
voltages were achieved by the sensors at room temperature (note that only 5 to 10 sensors were measured per Family):
- Family A1: 0.058 - 0.062 V
- Family B2: 0.068 - 0.112 V (all but one sensor: 0.068 - 0.075 V)
- Family C: 0.036 - 0.040 V
- Family D2: 0.121 - 0.124 V
All sensors are well within specs at room temperature but clustering of data by Family is apparent, indicating that the hardware was designed independently. It could be interesting to repeat these measurements above 100 °C.
Alternatively,
- It is a fake if the date--batch combination printed on the case of the sensor is not in the Maxim database (need to ask Maxim tech support to find out). (Note that there are counterfeits that use "authentic" date--batch combination, so maybe forget this option.)
Note that none of the points above give certainty that a particular DS18B20 is an authentic Maxim product, but if any of the tests above indicate "fake" then it is most defintely a clone [5].
What families of DS18B20-like chips can I expect to encounter?
In addition to DS18B20 originally produced by Dallas Semiconductor and continued by Maxim Integrated after they purchased Dallas (Family A1, below), there are TO-92 clones produced independently by at least 5 other companies as of 2019 (Families B1, B2, C, D, E) [5]. The separation into families is based on patterns in undocumented function codes that the chips respond to as similarities at that level are unlikely to be coincidental [5]. Chips of Family B1 seem to be produced by GXCAS and calibrated and sold independently by GXCAS and UMW. Chips of Family B2 are produced by Beijing 7Q Technology (7Q-Tek). Both UMW and 7Q-Tek have corresponding datasheets on their respective web pages. Family D1 seems to be fading from sight, having been replaced by Family D2. Chips of Family A2 were a rare find, behave surprisingly similar to authentic chips but have poor temperature accuracy. Chips of Family E are a new addition to this page as of 2022, and Families F, G, H, A3, and B1v2 were added in 2024.
In our ebay purchases in 2018/19 of waterproof DS18B20 probes from China, Germany, and the UK, most lots had sensors of Family B1, while one in three purchases had sensors of Family D. None had sensors of Family A1 or C. Neither origin nor price were indicators of sensor Family. When purchasing DS18B20 chips in TO-92 package, Family D2 was clearly dominant with Family B2 coming in second, and a small likelihood of obtaining chips of Families A1 or C.
In the ROM patterns below, tt and ss stand for fast-changing and slow-changing values within a production run [5], and crc is the CRC8 checksum defined in the datasheet [1].
Decapping DS18B20
This collage shows photos of the dies of all DS18B20 Families we encountered in 2019. All photos are at the same scale, approx. 1.4 mm in width. We broke the TO-92 case open with pliers, detached the die from the plastic case by boiling in colophony, and removed the colophony with acetone in an ultrasonic bath. Photos were taken with a rather ancient USB camera.
Family A1 is the authentic Maxim-produced DS18B20 (C4
die). All other families are clones. Note the similarities between the dies of Families D1 and D2 (consistent with their similarity in software) and the signifcant differences between Families B1 and B2 (as opposed to their similarity in software).
Family A1: Authentic DS18B20
Obtained no probes containing these chips on ebay or AliExpress in 2019, but obtained chips from a few vendors in 2019
- ROM pattern [5]: 28-tt-tt-ss-ss-00-00-crc
- Scratchpad register:
(<byte 0> + <byte 6>) & 0x0f == 0
after all successful temperature conversions, and0x00 < <byte 6> <= 0x10
[2,3,5]. I.e.,<byte 6> = 0x10 – (<byte 0> & 0x0f)
. - According to current behavior [5] and early datasheets [9], the power-up state of reserved
<byte 6>
in the Scratchpad register is0x0c
. - Returns "Trim1" and "Trim2" values if queried with function codes 0x93 and 0x68, respectively [4]. The bit patterns are very similar to each other within a production run [4]. Trim2 is currently less likely to equal 0xff than Trim1 [5]. Trim2 was 0xDB or 0xDC since at least 2009, and has been 0x73/0x74 since the fall of 2016 (all with
C4
die) [5]. (In parasitic power-only chips, Trim2 is 0xDB or 0xDC as of 2020.)- Trim1 and Trim2 encode two parameters [5]. Let the bit pattern of Trim1 be
[t17, t16, t15, t14, t13, t12, t11, t10]
(MSB to LSB) and Trim2 be[t27, t26, t25, t24, t23, t22, t21, t20]
. Then,- offset parameter =
[t22, t21, t20, t10, t11, t12, t13, t14, t15, t16, t17]
(unsigned 11 bit-value) [5], and - curve parameter =
[t27, t26, t25, t24, t23]
(unsigned 5 bit-value) [5].
- offset parameter =
- Within a batch, the offset parameter seems to spread over 20 to 30 units while all sensors within the batch share the same curve parameter [5].
- The offset parameter shifts the temperature output over a range of approx. 100 °C (0.053 °C per unit), while the curve parameter shifts the temperature over a range of 3.88 °C (0.12 °C per unit), at least in current versions of the chip [5]. Example values of 2019 are
offset = 0x420
andcurve = 0x0E
, i.e. they lie pretty central within their respective ranges.
- Trim1 and Trim2 encode two parameters [5]. Let the bit pattern of Trim1 be
- Temperature offset of current batches (2019) is as shown on the Maxim FAQ page, i.e. approx. +0.1 °C at 0 °C [6] (i.e., not as shown on the datasheet [1,9]. The plot on the datasheet stems from measurements at the time of introduction of the sensor 10+ years ago [5,10].). Very little if any temperature discretization noise [5].
- Polling after function code 0x44 indicates a spread of 584-615 ms between sensors for a 12-bit temperature conversion at room temperature [5]. Conversion time is easily repeatable for individual chips. Lower resolutions cut the time in proportion, i.e. 11 bit-conversions take half the time. The trim parameters affect the conversion time.
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed (in both normal and parasitic power modes). [5].
- It appears the chip returns a temperature of 127.94 °C (=0x07FF / 16.0) if a temperature conversion was unsuccessful [5] (e.g. due to power stability issues which arise reproducibly in "parasitic power" mode with multiple DS18B20 if Vcc is left floating rather than tied to ground. Note that the datasheet clearly states that Vcc is to be tied to GND in parasitic mode.).
- Example ROM: 28-13-9B-BB-0B -00-00- 1F
- Example ROM: 28-CA-D6-10-10 -00-00- FE (2024)
- Initial Scratchpad: 50/05/4B/46/7F/FF/0C/10/1C
- Example topmark: DALLAS 18B20 1932C4 +786AB
- Example topmark: DALLAS 18B20 2411C4 +852AD (2024)
- Indent mark:
P
(date codes 1150 through 2019) - Indent mark: possibly options besides
P
since 2020 (cf. Issue 21) (2020)
Family A1-Fishy: Authentic but Stolen?
Obtained no probes containing these chips on ebay or AliExpress in 2019, but obtained chips from one vendor in 2019
If I were to make a wild guess I would say these chips were diverted somewhere toward the end of the Maxim production pipeline (stolen?) [5]. Fun fact: the vendor advertised these chips as QT18B20, so as sold these were actually counterfeits of DS18B20 clones. These chips are marked as produced in Thailand rather than Philippines.
- ROM pattern [5]: 28-tt-tt-Cs-03-00-00-crc
The chips follow the description of Family A1 above with the following exceptions [5]:
- Both alarm registers are set to 0x00 (scratchpad bytes 2 and 3).
- The conversion resolution is set to 9 bits (i.e., both configuartion bits are 0).
- Both trim values are 0x00, resulting in wrong temperatures (i.e., very low) and conversion times in the range of 400 to 500 ms.
- Once trim values are set to something reasonable, the time for temperature conversion is within the range specified for Family A1 above.
- Example ROM: 28-9B-9E-CB-03 -00-00- 1F
- Initial Scratchpad: 50/05/00/00/1F/FF/0C/10/74
- Example topmark: DALLAS 18B20 1136C4 +957AE
- Example topmark: DALLAS 18B20 1136C4 +957AF
- Example topmark: DALLAS 18B20 1136C4 +152AE
- Example topmark: DALLAS 18B20 1136C4 +152AF
- Example topmark: DALLAS 18B20 1136C4 +152AG
- Example topmark: DALLAS 18B20 1136C4 +152AI
- Indent mark:
THAI <letter>
Family A2: Good Copy with Poor Temperature Performance
Obtained no probes containing these chips on ebay or AliExpress in 2019, but obtained chips from one vendor in 2019
These chips are not Maxim-produced.
- ROM pattern [5]: 28-00-ss-00-tt-tt-tt-crc, 28-ss-00-ss-tt-tt-tt-crc, 28-ss-00-00-tt-tt-00-crc
The chips follow the description of Family A1 above with the following exceptions [5]:
- The ROM pattern is incompatible with what Maxim produces.
- The Trim2 value is
0xFB
or0xFC
, i.e. incompatible with a known [5] Maxim production suggested by the date code. (Note that this means the curve parameter is 0x1f, i.e. the highest (unsigned) value possible [5]. Also, the offset parameter spreads over 200 units rather than a range typical for Family A1 [5].)- The curve parameter is a signed 5 bit value that shifts the temperature over a range of 31 °C (1 °C per unit) [5]. I.e., a curve parameter of 0x1f (-1 in decimal) is at the center of the range.
- The time for temperature conversion spans a remarkably wide range from 325 to 502 ms between chips [5]. This range remains wide and outside the bounds of Family A1 even when applying more recent trim settings [5]. Conversion time increases noticably with temperature (approx. 10% over 100 °C) [5]. A conversion time of <500 ms is compatible with claims in the 7Q-Tek QT18B20 datasheet [12].
- Does not return power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode [5].
- Typical temperature offset at at 0 °C is -3.5 to -1.8 °C [5]. (Anecdotally: error seems to be smaller at higher temperatures [5].) Very little if any temperature discretization noise [5].
- Alarm settings (i.e., scratchpad bytes 2 and 3) appear to have random content [5].
- Some chips retain their scratchpad content across a 100 ms power cycle [5].
- One specimen tested did not function properly in parasitic mode.
- Some chips have bit errors in the ROM which lead to CRC errors [5]. (2020)
- The topmark is printed rather than lasered, and there is no mark in the indent.
- Example ROM: 28-19-00-00-B7-5B-00-41
- Initial Scratchpad: 50/05/xx/xx/7F/FF/0C/10/xx
- Example topmark: DALLAS 18B20 1808C4 +233AA
- Example topmark: DALLAS 18B20 1838C4 +233AA (2020)
- Indent mark: none
Family A3: Designed to Deceive
Obtained neither chips nor probes in 2019. Bought chips in 2024, also observed in the wild (cf. Discussion 42)
This family was added to the list in 2024. It seems to have been designed to pass all tests of the 2019 Arduino sketches on this site.
- ROM patterns [5]: 28-tt-tt-tt-00-00-00-crc
- Note that genuine chips with this ROM pattern were produced over 15 years ago.
- Note that a ROM of this pattern predates the
C4
die. I.e., a chip with a topmark DALLAS 18B20 andC4
die together with this ROM is not genuine.
- Scratchpad register
<byte 6> = 0x0C
at power-up, and<byte 6> = 0x10 – (<byte 0> & 0x0f)
after temperature conversion, [5]. - Returns data on undocumented function code 0x68 ("Trim2"), [5]. Returns data on undocumented function code 0x93 but defaults to
0xFF
("Trim1"), [5].- Curve parameter is unsigned and affects the temperature reading at a similar magnitude as Family A1. [5]
- "Trim2" does not match known values of Family A1. [5]
- Offset parameter is implemented differently than in Family A1. [5]
- Curve parameter is unsigned and affects the temperature reading at a similar magnitude as Family A1. [5]
- Default alarm register settings differ from Family A1 (
0x7F
and0x80
) [5]. - A sample of 20 sensors had an average temperature offset of +0.11 °C at 0 °C with a spread comparable to other Families [5]. Noise of individual sensors was comparable to sensors of other Families [5].
- Polling for completion of the temperature conversion produces valid readings only after a slight delay (≤ 1 ms) following the initation of temperature conversion, [5]. This contrasts with all other sensors of Families A-E and G that implement this feature.
- Delayed polling after function code 0x44 indicates approx. 589-621 ms for a 12-bit temperature conversion and proportionally less at lower resolution [5].
- Sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode. [5].
- Example ROM: 28-3E-43-87 -00-00-00- 18 (cf. Discussion 42)
- Example ROM: 28-CA-BA-61 -00-00-00- A3
- Example ROM: 28-06-64-2B -00-00-00- 46
- Initial Scratchpad: 50/05/7F/80/7F/FF/0C/10/93
- Example topmark: DALLAS 18B20 2402C4 +817AB (cf. Discussion 42)
- Example topmark: HXY 18B20 2340
- Example topmark: MSKSEMI 18B20 2420
Family B1: GXCAS 18B20, Matching Datasheet Temperature Offset Curve
Obtained probes from a number of vendors in 2019, obtained chips from two vendors in 2019. One vendor sent chips marked UMW rather than DALLAS
- ROM patterns [5]:
- 28-AA-tt-ss-ss-ss-ss-crc (GXCAS-branded)
- 28-tt-tt-ss-ss-ss-ss-crc (UMW-branded)
- Scratchpad register
<byte 6>
does not change with measured temperature (default0x0c
) [5]. - DS18B20 write scratchpad-bug (0x4E) / UMW scratchpad [5,12,14]:
- If 3 data bytes are sent (as per DS18B20 datasheet, TH, TL, Config) then
<byte 6>
changes to the third byte sent, - if 5 data bytes are sent (as per UMW datsheet, TH, TL, Config, User Byte 3, User Byte 4), the last two bytes overwrite
<byte 6>
and<byte 7>
, respectively.
- If 3 data bytes are sent (as per DS18B20 datasheet, TH, TL, Config) then
- Does not return data on undocumented function code 0x68 [5]. Does return data from codes 0x90, 0x91, 0x92, 0x93, 0x95, and 0x97 [5]. Return value in response to 0x97 is
0x22
[5]. - ROM code can be changed in software with command sequence "96-Cx-Dx-94" [5]. (The UMW datasheet states that the ROM code can be changed but does not specify how [14].) Family code (
0x28
) cannot be changed [5]. - Substitutes
0x0c
for actual value of<byte 6>
if scratchpad register is read before temperature conversion has finished in parasitic power mode. - Temperature offset as shown on the Maxim datasheet (-0.15 °C at 0 °C) [6]. Very little if any temperature discretization noise [5].
- Polling after function code 0x44 indicates approx. 589-728 ms for a 12-bit temperature conversion and proportionally less at lower resolution [5].
- Sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode. [5].
- The die has "GXCAS" written on it.
- Example ROM: 28 -AA- 3C-61-55-14-01-F0
- Example ROM: 28-AB-9C-B1 -33-14-01- 81
- Initial Scratchpad: 50/05/4B/46/7F/FF/0C/10/1C
- Example topmark: DALLAS 18B20 1626C4 +233AA
- Example topmark: DALLAS 18B20 1804C4 +051AG
- Example topmark: DALLAS 18B20 1810C4 +051AG
- Example topmark: DALLAS 18B20 1921C4 +921AC (2020)
- Example topmark: DALLAS 18B20 1926C4 +926AC (2020)
- Example topmark: GXCAS 18B20E 1847D02
- Example topmark: UMW 18B20 1935C4
- Indent mark: none
Family B1v2: Why this Update?
Obtained neither chips nor probes in 2019. Obtained chips in 2024, also see Issue 40
These chips seem to have appeared on the market ca. 2024 as reported in Issue 40. While the undocumented features seem to match those of Family B1, the behavior of the scratchpad register has changed to better match Family A1.
- ROM patterns [5]: 28-tt-tt-ss-ss-ss-ss-crc
- Differences from Family B1:
- Scratchpad register
<byte 6>
acts like Family A1. I.e.,<byte 6> = 0x10 – (<byte 0> & 0x0f)
, [5] and Issue 40. - Writing of alarm registers and configuration register do not pollute other values in scratchpad register, [5] and Issue 40.
- Scratchpad register does not store User Bytes if 5 data bytes are sent, i.e.
<byte 7>
is fixed at0x10
. [5].
- Scratchpad register
- Does not return data on undocumented function code 0x68 [5]. Does return data from codes 0x90, 0x91, 0x92, 0x93, 0x95, and 0x97 [5]. Return value in response to 0x97 is
0x22
[5]. - ROM code can be changed in software with command sequence "96-Cx-Dx-94" [5]. Family code (
0x28
) cannot be changed [5]. - Temperature offset as shown on the Maxim datasheet (-0.15 °C at 0 °C) [6]. Very little if any temperature discretization noise [5].
- Polling after function code 0x44 indicates around 650 ms for a 12-bit temperature conversion and proportionally less at lower resolution [5].
- Sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode. [5].
- Example ROM: 28-E4-FA-2F -57-23-0B- AF (cf. Issue 40)
- Example ROM: 28-0D-72-9A -20-23-07- C3
- Example ROM: 28-94-77-5F -33-23-09- 37
- Initial Scratchpad: 50/05/4B/46/7F/FF/0C/10/1C
- Example topmark: GXCAS 18B20T 2310006
- Example topmark: XINBOLE DS18B20 2310C4 +3E1AC
- Indent mark: none
Family B2: 7Q-Tek QT18B20 with -0.5 °C Temperature Offset at 0 °C
Obtained both probes and chips of this series from a number of vendors in 2019. Three vendors sent chips marked 7Q-Tek rather than DALLAS
- ROM patterns [5]: 28-FF-tt-ss-ss-ss-ss-crc
- Scratchpad register
<byte 6>
does not change with measured temperature (default0x0c
) [5]. - DS18B20 write scratchpad-bug (0x4E) / QT18B20 scratchpad [5,12]:
- If 3 data bytes are sent (as per DS18B20 datasheet, TH, TL, Config) then
<byte 6>
changes to the third byte sent, - if 5 data bytes are sent (as per QT18B20 datsheet, TH, TL, Config, User Byte 3, User Byte 4), the last two bytes overwrite
<byte 6>
and<byte 7>
, respectively.
- If 3 data bytes are sent (as per DS18B20 datasheet, TH, TL, Config) then
- Does not return data on undocumented function code 0x68 [5]. Does return data from codes 0x90, 0x91, 0x92, 0x93, 0x95, and 0x97 [5]. Return value in response to 0x97 is
0x31
[5]. - ROM code cannot be changed in software with command sequence "96-Cx-Dx-94" [5].
- In at least some more recent samples, the default alarm register settings differ from Family A1 (
0x55
and0x00
) [5]. (2024) - Substitutes
0x0c
for actual value of<byte 6>
if scratchpad register is read before temperature conversion has finished in parasitic power mode. - Typical temperature offset at at 0 °C is -0.5 °C [6]. Very little if any temperature discretization noise [5].
- In 2024, a sample of 10 sensors had an average temperature offset of -0.24 °C at 0 °C [5]. (2024)
- Polling after function code 0x44 indicates approx. 587-697 ms for a 12-bit temperature conversion and proportionally less at lower resolution [5].
- Sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode. [5].
- The die has "7Q-Tek" written on it (using the Chinese character for digit 7).
- Example ROM: 28 -FF- 7C-5A-61-16-04-EE
- Example ROM: 28 -FF- E8-E8-54-E2-1F-24 (2024)
- Initial Scratchpad: 50/05/4B/46/7F/FF/0C/10/1C
- Initial Scratchpad: 50/05/55/00/7F/FF/0C/10/21 (2024)
- Example topmark: DALLAS 18B20 1626C4 +233AA
- Example topmark: DALLAS 18B20 1702C4 +233AA
- Example topmark: DALLAS 18B20 1810C4 +138AB
- Example topmark: DALLAS 18B20 1829C4 +887AB
- Example topmark: DALLAS 18B20 1832C4 +827AH
- Example topmark: DALLAS 18B20 1833C4 +058AA
- Example topmark: DALLAS 18B20 1908C4 +887AB
- Example topmark: DALLAS 18B20 1912C4 +001AC (NB: this date/batch combination is also used on genuine chips [5])
- Example topmark: DALLAS 18B20 2012C4 +887AB (2020)
- Example topmark: 7Q-Tek 18B20 1861C02
- Example topmark: 18B20 2214 (2024)
- Indent mark: none
Family C: Small Offset at 0 °C
Obtained no probes but obtained chips from a few vendors in 2019
- ROM patterns [5]: 28-FF-64-ss-ss-tt-tt-crc
- Scratchpad register
<byte 6> == 0x0c
[5]. - Does not return data on undocumented function code 0x68 or any other undocumented function code [5].
- Typical temperature offset at 0 °C is +0.05 °C [6]. Very little if any temperature discretization noise [5].
- EEPROM endures only about eight (8) write cycles (function code 0x48) [5].
- Reported power mode (parasitic/normal) in response to function code 0xB4 may be wrong, depending on the order power pin and data line are powered (e.g. if power pin is at GND while Data is powered and the power pin is then connected to Vcc, the chip will continue to report parasitic power mode) [5].
- Polling after function code 0x44 indicates 28-30 ms (thirty) for a 12-bit temperature conversion [5]. Temperature conversion works also in parasitic power mode [5].
- Operates in 12-bit conversion mode, only (configuration byte reads
0x7f
always) [5]. - Default alarm register settings differ from Family A1 (
0x55
and0x00
) [5].
- Example ROM: 28 -FF-64- 1D-CD-96-F2-01
- Initial Scratchpad: 50/05/55/00/7F/FF/0C/10/21
- Example topmark: DALLAS 18B20 1331C4 +826AC
- Example topmark: DALLAS 18B20 1810C4 +158AC
- Example topmark: DALLAS 18B20 1924C4 +158AC
- Indent mark: none
Family D1: Noisy Rubbish with Big Cap
Obatined probes from two vendors in early 2019, obtained chips from one vendor in 2019
- ROM patterns [5]: 28-tt-tt-77-91-ss-ss-crc and 28-tt-tt-46-92-ss-ss-crc
- Scratchpad register
<byte 7> == 0x66
,<byte 6> != 0x0c
and<byte 5> != 0xff
[5]. - Does not return data on undocumented function code 0x68 [5]. Responds back with data or status information after codes
- 0x4D, 0x8B (8 bytes), 0xBA, 0xBB, 0xDD (5 bytes), 0xEE (5 bytes) [5], or
- 0x4D, 0x8B (8 bytes), 0xBA, 0xBB [5].
- First byte following undocumented function code 0x8B is [5]
0x06
: Sensors do not work with Parasitic Power. Sensors leave data line floating when powered parasitically [5].0x02
: Sensors do work in parasitic power mode (and report correctly whether they are parasitically powered).
- It is possible to send arbitrary content as ROM code and for bytes 5, 6, and 7 of the scratchpad register after undocumented function codes 0xA3 and 0x66, respectively [5]. The family code of the device can be changed [5].
- Temperature errors up to 3 °C at 0 °C [6]. Very noisy data [5].
- Polling after function code 0x44 indicates approx. 11 ms (eleven) for conversion regardless of measurement resolution [5].
- Chips contain a high-value capacitor rather than an EEPROM to hold alarm and configuration settings [5]. I.e., the last temperature measurement and updates to the alarm registers are retained between power cycles that are not too long [5].
- The capacitor retains memory for several minutes unless the Vcc pin is connected to the GND pin, in which case memory retention is 5 to 30 seconds [5].
- Chips are sensitive to the way power is applied [5]. E.g. to power up from all pins attached to GND, it seems to be a good idea to leave Data and power pin floating for a bit (e.g., 100 ms) before actually applying a voltage to the power pin and Data [5].
- Initial temperature reading is 25 °C or the last reading before power-down [5]. Default alarm register settings differ from Family A1 (
0x55
and0x05
) [5].
- Example ROM: 28-48-1B-77 -91- 17-02-55 (working parasitic power mode)
- Example ROM: 28-24-1D-77 -91- 04-02-CE (responds to 0xDD and 0xEE)
- Example ROM: 28-B8-0E-77 -91- 0E-02-D7
- Example ROM: 28-21-6D-46 -92- 0A-02-B7
- Initial Scratchpad: 90/01/55/05/7F/7E/81/66/27
- Example topmark: DALLAS 18B20 1807C4 +051AG
- Example topmark: DALLAS 18B20 1813C4 +827AH (2020)
- Example topmark: DALLAS 18B20 1827C4 +051AG
- Indent mark: none
Family D2: Interesting, No Parasitic Power
Obtained both probes and chips from a large number of vendors in 2019
- ROM patterns [5]: 28-tt-tt-79-97-ss-ss-crc, 28-tt-tt-94-97-ss-ss-crc, 28-tt-tt-79-A2-ss-ss-crc, 28-tt-tt-16-A8-ss-ss-crc, 28-tt-tt-56-B5-ss-ss-crc (2020), 28-tt-tt-07-D6-ss-ss-crc (2020)
- Scratchpad register
<byte 7> == 0x66
,<byte 6> != 0x0c
and<byte 5> != 0xff
[5].<byte 7>
can have other values, including 0xAA or 0x00, [5] and Discussion 36. (2024)- Scratchpad registers
<byte 5>
,<byte 6>
, and<byte 7>
can be written with function code 0x66 [15]. (2024)
- Does not return data on undocumented function code 0x68 [5]. Responds back with data or status information after codes
- 0x4D, 0x8B (9 bytes), 0xBA, 0xBB, 0xDD (3 bytes), 0xEE (3 bytes) [5], or
- 0x4D, 0x8B (9 bytes), 0xBA, 0xBB [5].
- First byte following undocumented function code 0x8B is
0x00
[5]. - Undocumented function code 0x8B queries an undocumented 9-byte configuration register, with many of those bytes affecting the temperature reading [5]. Undocumented function code 0xAB is used to update the 9 bytes of this configuration register [5]. (2024)
- A 14-bit temperature mode [15] can be enabled by setting
<bit 0>
of<byte 0>
in the undocumented configuration register [5]. (2024) - Sensors do not work with Parasitic Power. Sensors draw data line low while powered parasitically [5].
- 2019: Temperature errors up to 3 °C at 0 °C [6]. Data noisier than genuine chips [5].
- In 2024, a sample of 10 sensors had an average temperature offset of -0.09 °C at 0 °C with an inter-sensor spread from -0.25 to +0.44 °C, which is a large spread compared to other Families [5]. However, individual sensors were not noisier than sensors of other Families. (2024)
- Polling after function code 0x44 indicates approx. 462-523 ms for conversion regardless of measurement resolution [5]. The series with
97
andA2
/A8
in the ROM converts in 494-523 ms and 462-486 ms, respectively [5]. Chips withA2
orA8
in byte 4 of the ROM seem to have appeared first in 2019. - Initial temperature reading is 25 °C [5]. Default alarm register settings differ from Family A1 (
0x55
and0x05
) [5].- Default alarm register settings differ from Family A1 (
0x00
and0x00
), [5] and Discussion 36. (2024)
- Default alarm register settings differ from Family A1 (
- Example ROM: 28-90-FE-79 -97- 00-03-20
- Example ROM: 28-FD-58-94 -97- 14-03-05
- Example ROM: 28-FB-10-79 -A2- 00-03-88
- Example ROM: 28-29-7D-16 -A8- 01-3C-84
- Example ROM: 28-DF-54-56 -B5- 01-3C-F5 (2020)
- Example ROM: 28-AF-EC-07 -D6- 01-3C-0A (2020)
- Example ROM: 28-75-02-80 -33- 8B-06-DC (2024)
- Initial Scratchpad: 90/01/55/05/7F/xx/xx/66/xx
- Initial Scratchpad: 90/01/00/00/7F/xx/xx/xx/xx (2024)
- Example topmark: DALLAS 18B20 1812C4 +051AG
- Example topmark: DALLAS 18B20 1827C4 +051AG
- Example topmark: DALLAS 18B20 1916C4 +051AG
- Example topmark: DALLAS 18B20 1923C4 +051AG
- Example topmark: DALLAS 18B20 1943C4 +051AG
- Example topmark: DALLAS 18B20 1828C4 +233AA
- Example topmark: DALLAS 18B20 2008C4 +817AB (2020)
- Example topmark: SE18B20 2130 (2022)
- Example topmark: MY18B20 S380 (2024)
- Indent mark: none
Family E: NOVOSENSE NS18B20
Obtained neither chips nor probes in 2019. Bought chips clearly marked NS18B20 in 2022 and 2024
This family has been added to the list as of 2022. The datasheet seems to suggest that the chips started production in 2019.
- ROM patterns [5]: 28-00-tt-tt-ss-ss-ss-crc
- Scratchpad register
<byte 6>
is always<byte 6> = 0x10 – (<byte 0> & 0x0f)
, i.e. unlike Family A1<byte 6> = 0x10
is the value at power-up [5]. - Returns two-byte Custom Scratchpad on function code 0xDE and signals busy during write to EEPROM on function code 0x28 [5], as specified in the NS18B20 datasheet [17].
- Does not return data on undocumented function codes 0x68 and 0x93, [5].
- A sample of 10 sensors had an average temperature offset of +0.02 °C at 0 °C with a spread comparable to other Families [5]. Noise of individual sensors was comparable to sensors of other Families [5]. (2024)
- Temperature conversion is 20 to 25 ms, independent of the selected resolution [5]. (The NS18B20 datasheet specifies maximum 50 ms irrespective of resolution.)
- Sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode. [5].
- Example ROM: 28 -00- 74-28 -59-43- 0F-7A
- Example ROM: 28 -00- 2A-50 -0C-41- 02-DB
- Initial Scratchpad: 50/05/4B/46/7F/FF/10/10/BD
- Example topmark: NS18B20 203B00
- Example topmark: NS18B20 412D01
- Indent mark: none
Family F: The Variant
Obtained neither chips nor probes in 2019. Bought chips in 2024
This family was added to the list in 2024.
- ROM patterns [5]: 28-tt-tt-ss-ss-ss-ss-crc
- Scratchpad register
<byte 6> = 0x0C
fixed, [5]. - Returns three bytes on undocumented function code 0x19, [5].
- Does not return data on undocumented function codes 0x68 and 0x93, [5].
- Extended temperature mode (up to 150 °C) can be enabled by setting
<bit 7>
of<byte 4>
in the scratchpad register, [5],[18]. - EEPROM not implemented, [18].
- Default alarm register settings differ from Family A1 (
0x55
and0x00
) [5]. - A sample of 10 sensors had an average temperature offset of -0.11 °C at 0 °C with a spread comparable to other Families [5]. Noise of individual sensors was comparable to sensors of other Families [5]. (2024)
- Conversion resolution always reported as 12 bit, [5].
- Completion of temperature conversion cannot be polled (functionality not implemented), [5],[18].
- Typical conversion time 27 ms as per datasheet, [18].
- Parasitic power mode does not work with Vcc pulled to GND, [5]. Instead, parasitic power mode works with Vcc left floating, [5],[18].
- Returns a power-up temperature of 85 °C if scratchpad register is read before temperature conversion has completed in parasitic power mode. [5].
- Some sensors leave the data line floating if scratchpad register is read before temperature conversion has completed in parasitic power mode, and will eventually reset to a power-up temperature of 85 °C. [5].
- Example ROM: 28-03-60 -00-00-01- 24-D0
- Initial Scratchpad: 50/05/55/00/7F/FF/0C/10/21
- Example topmark: XINBOLE DS18B20T 2430C4 +4F3AC
- Indent mark: none
Family G: The Joker
Obtained neither chips nor probes in 2019. Bought chips in 2024
This family was added to the list in 2024.
- ROM patterns [5]: 28-tt-tt-tt-tt-tt-tt-crc (seemingly random)
- Scratchpad register
<byte 6> = 0x0C
at power up, and<byte 6> = 0x20 – (<byte 0> & 0x0f)
after temperature conversion, [5]. Yes, they really lie0x10
above Family A1. - Returns one byte on undocumented function code 0x8E, [5].
- Does not return data on undocumented function codes 0x68 and 0x93, [5].
- Default alarm register settings differ from Family A1 (
0x55
and0xAA
) [5]. - Contains a large buffer capacitor such that a 100 ms power cycle is too short to reset the scratchpad register, [5].
- A sample of 27 sensors had an average temperature offset of -0.22 °C at 0 °C with a spread comparable to other Families [5]. Noise of individual sensors was comparable to sensors of other Families [5].
- Polling after function code 0x44 indicates approx. 227-293 ms for a 12-bit temperature conversion and proportionally less at lower resolution [5].
- Sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Pulls data line low(!) if conversion is interrupted by reading scratchpad register in parasite power mode, and will eventually recover to complete the conversion afterwards (up to >1000 ms later). [5].
- Example ROM: 28-C7-9E-A3-59-83-D9-74
- Example ROM: 28-95-77-37-3F-4A-FB-1F
- Example ROM: 28-CE-71-E6-6F-8C-E5-3C
- Initial Scratchpad: 50/05/55/AA/7F/FF/0C/10/AF
- Example topmark: ZHHXDZ HX18B20 24+6
- Example topmark: JSMSEMI 18B20 3X31
- Example topmark: HT18B20 ARTZ #465142
- Indent mark: none
Family H: Different ADC
Obtained neither chips nor probes in 2019. Obtained a single chip in 2024
This family was added to the list in 2024. The one sample I got was part of a "batch" of sensors labeled HT18B20: they were Tape & Reel packaged, and this one sensors was different than the others. So, if you don't want to know what you're getting, ask for a HT18B20.
- ROM patterns [5]: 28-tt-tt-tt-tt-tt-tt-crc (difficult to say based on one sample)
- Scratchpad register
<byte 6> = 0x0C
at power up, and<byte 6> = 0x10 – (<byte 0> & 0x0f)
after temperature conversion, [5]. - Does not return data on undocumented function codes 0x68 and 0x93 or any other function codes [5].
- Default alarm register settings differ from Family A1 (
0x55
and0xAA
) [5]. - Contains a large buffer capacitor such that a 100 ms power cycle is too short to reset the scratchpad register, [5].
- The one sample investigated had a temperature offset of -0.12 °C at 0 °C [5]. Noise of the sensor was comparable to sensors of other Families [5].
- Polling after function code 0x44 indicates 101 ms, 141 ms, 198 ms, and 279 ms at a resolution of 9, 10, 11, and 12 bits, respectively, i.e. a factor of 1.4 rather than a factor of 2 between the resolution settings [5].
- In principle, the sensor indicates when in parasitic power mode, temperature conversion in parasitic power mode is working (based on cursory test) [5].
- Switch back-and-forth between parasitic power and normal power is not reliably indicated by the sensor [5].
- Leaves data line floating if conversion is interrupted by reading scratchpad register in parasite power mode and will report conversion result if queried afterwards. [5].
- Example ROM: 28-0C-80-53-5C-AA-8E-A2
- Initial Scratchpad: 50/05/55/AA/7F/FF/0C/10/AF
- Example topmark: HT18B20 ARTZ #465142
- Indent mark: none
Obsolete as of 2019
Obtained neither probes nor chips in 2019
-
ROM patterns [5,7]: 28-tt-tt-ss-00-00-80-crc
- Example ROM: 28-9E-9C-1F -00-00-80- 04
(apparently still sold to others in 2019 (cf. Issue 17))
-
ROM patterns [5,11]: 28-61-64-ss-ss-tt-tt-crc
- Example ROM: 28 -61-64- 11-8D-F1-15-DE
(appear to be Family C.) (2022)
-
ROM patterns [5]: 28-EE-tt-tt-ss-ss-ss-crc
- Example ROM: 28 -EE- 58-49-25-16-01-45 (2020)
- Example topmark: DALLAS 18B20 1619C4 +827AH (2020)
- Example topmark: DALLAS 18B20 1709C4 +827AH (2020)
(received a few chips in 2020: they act like Family B2 at first glance.)
-
Family A1 with die versions prior to
C4
- Example die code:
B7
(some older chips (pre-2009) had buggy hardware circuits (dies), most infamously the
B7
die [4], cf. Issue 19). - Example die code:
Solution to the 85 °C-Problem
There is a simple, undocumented, way to discriminate between the power-up 85 °C-reading and a genuine temperature reading of 85 °C in DS18B20 of Family A and some others [5]: <byte 6>
of the scratchpad register. If it is 0x0c
, then the 85 °C-reading is a power-up reading, otherwise it is a true temperature measurement.
GXCAS 18B20
The DS18B20 clone of Beijing Zhongke Galaxy Core Technology Co., Ltd., trading as GXCAS, seems to be distributed independently by GXCAS and UMW (Family B1). According to their web page, GXCAS has only been around since January 2018. While GXCAS does not have a datasheet online, the datasheet on the UMW web page emphasizes the addition of two user-defined bytes in the scratchpad register, and the possibility of changing the ROM address [14]. A number of these chips bear fake DS18B20 topmarks. GXCAS is clearly proud of their product as they write their company name prominently onto the die.
7Q-Tek QT18B20
The QT18B20 is a DS18B20 clone developed and sold by Beijing 7Q Technology Inc, trading as 7Q-Tek (Family B2). The datasheet of the QT18B20 emphasizes the addition of two user-defined bytes in the scratchpad register [12]. Unlike the data sheet of the DS18B20, it does not state that the ROM code is lasered. A large number of these chips bear fake DS18B20 topmarks. 7Q-Tek is clearly proud of their product as they write their company name prominently onto the die.
While it is unclear who designed or produced chips of Family A2, Family A2 appears to have been an inspiration for the Family B2 7Q-Tek QT18B20, based on the following observations:
- The QT18B20 datasheet claims that a temperature conversion takes <500 ms [12]. This is consistent with the actual behavior of Family A2. (While the UMW datasheet claims the same [14], one of the datasheets appears to have been used as a template for the other.)
- According to the datasheet version history, the earliest version of the QT18B20 datasheet did not mention user-defined bytes [12]. Family A2 does not have user-defined bytes in the scratchpad register.
- The die ciruit of Family A2 resembles the style of both the die of Family A1 (produced by Maxim) and the die of Family B2 (produced by 7Q-Tek). The die size is significantly different from Family A1, so it's not a Maxim-produced DS18B20.
Mysentech MY18E20
The MY18E20 clone of Minyuan Sensing Technology, trading as Mysentech, appears to be the sensor of Family D2. Family D1 is probably a variant also produced by Mysentech. Mysentech has a datasheet that seems to be largely consistent with the behavior of this chip [15] and they have technical FAQ pages related to this sensor (dated December 2022) [16]. Apparently, Mysentech was founded in 2017. (2024)
NOVOSENSE NS18B20
The NS18B20 is a DS18B20 clone of Suzhou Novosense Microelectronics Co., Ltd. (Family E). (2022)
Xinbole DS18B20T
Shenzhen Xinbole Electronics Co. (XBLW) has a datasheet that accurately describes the somewhat unusual behavior of the sensor of Family F. (2024)
MAX31820
Maxim Integrated also produce the MAX31820 temperature sensor. The MAX31820 is a DS18B20 with limited supply voltage range (i.e. up to 3.7 V) and smaller temperature range of high accuracy [1,8]. Like the DS18B20, it uses one-wire family code 0x28 [1,8]. Preliminary investigations have not (yet) revealed a test to distinguish between DS18B20 of Family A1 and Maxim-produced MAX31820 in software [5].
Methods
By popular request (Issue 11), this section is supposed to give background to (some of) the results and conclusions above. I'll add to it very slowly as time permits.
Investigations were on DS18B20 rather than the DS18B20-PAR variant or the DS18S20. We have only a hand full of DS18B20-PAR and DS18S20 sensors while we have hundreds of DS18B20. Also, all sensors were in the TO-92 case.
Sample basis for analysis of Family A1
Above figure shows the range of production dates and ROM codes (serial numbers) of the Family A1 sensors investigated that were bought as chips. Also included is a single-digit number of chips contained in probes that we opened to read off the topmark. The production date according to the date code is on the x-axis, the serial number according to the ROM is on the y-axis, the dots are the individual chips (N>200 but individual batches appear as smeared-out blobs), the gray area highlights 2019. We have chips produced from 2009 through 2020 and all chips have a C4
die, no chips have date codes of 2010, 2014, or 2015. (The serial number of a chip with ROM 28-13-9B-BB- 0B -00-00-1F is 0x0BBB9B13 and would thus fall between 0x0B and 0x0C on the y-axis.) We see that there is a long term relationship between serial number and date code (dashed line): the serial number increases by approximately 16,500,000 (i.e., approx. 2^24) per year. However, this relationship is only a general guide as can be seen by the degree of scatter around the line and in the enlargement in the inset: of the sensors produced in 2019 that we purchased there were three instances where sensors with a later date code contained an earlier serial number.
We seem to have purchased one of the last batches produced in 2016 with Trim2 calibration constants 0xDB or 0xDC, and one of the first batches with Trim2 calibration constants 0x73 or 0x74. Hence, the change probably took place between weeks 32 and 47 of 2016. (This is a statement about the DS18B20 rather than the DS18B20-PAR.)
Temperature data
Above figure shows (a) the temperature reading we got from each sensors in an ice-water bath at 0 °C, (b) the amount of noise in successive readings in the ice-water bath, and (c) conversion time for temperature measurements at nominally room temperature (measurements were actually performed anywhere between 0 and 30 °C). A high resolution version of the figure is available at images/Sensor_measurements_by_family.png. Data for (a) and (b) are typically based on 20 successive measurements taken once every 10 s after the sensor had equilibrated in an ice-water bath. Data in (c) are based on as few as a single measurement per sensor as in our experience conversion timing does not scatter, i.e. a single measurement is sufficient to assess the conversion time of a sensor at the current temperature.
Data were measured at +5 V. (2024)
Data are grouped along the x-axis as follows:
- A1: Family A1 obtained from official distributor, i.e. both autheticity and proper handling is guaranteed
- A1 (3rd party distributor): Family A1 obtained from other retailers big or small, including those selling on ebay and AliExpress, and including any sensors contained in probes
- A2: Family A2
- B1 (GXCAS): Family B1, based on their ROM apparently distributed by GXCAS
- B1 (UMW): Family B1, based on their ROM apparently distributed by UMW
- B2: Family B2
- C: Family C
- D1: Family D1
- D2 (xy): Family D2 where the number xy in brackets is 5th byte of the ROM (i.e. byte 4).
Sensors within each group are shown in what I presume is their order of manufacturing, based primarily on the ROM and corroborated somewhat by the order we purchased them.
Data of Family A1 sensors with
0x00
trim values are not shown.
The Maxim-specified temperature error is ±0.5 °C at 0 °C, and this interval is marked in the plot (a) by thin dashed lines. We see that Family A1 sensors have readings typically in the range of -0.1 to +0.2 °C, Family A2 has -2 °C, Family B1 between 0 and -0.5 °C, Family B2 around -0.5 °C, Family C around 0 °C (not enough data points to say for sure), Family D1 between -1 and +1 °C or worse, and Family D2 -- well, it's difficult to say from the data: they started off really badly with performance similar to Family D1 and may or may not have improved since (would need to measure more sensors to say for sure. Limited measurements in 2024 indicated that they are much better than Family D1). Measurements were taken once every 10 seconds to avoid artifacts from self heating of sensors contained in probes (i.e. we found that reading once a second increases the temperature returned).
An ideal sensors would only show discretization noise, i.e. have readings fluctuate between the two values that surround the actual temperature. This noise is shown in plot (b) as the standard deviation (std(T)
) of nominally 20 temperature measurements. If all measurements are the same, std(T)
is zero. If exactly one measurements differs by one discretization step (i.e. by 0.0625 °C) from the other 19 then std(T)
is 0.014 °C, shown as the lower dashed line. If data are evenly split between two adjacent values then std(T)
is 0.031 °C, shown as the upper dashed line. Data points between 0 and the lower dashed line indicate that more than 20 samples were used for that sensor, and data above the upper line indicate that readings fluctuated over a range of at least 2 discretization steps. We see that sensors of Families A, B, and C have essentially only discretization noise. In contrast, Family D1 produces shockingly noisy garbage (i.e. the actual measurement resolution is less than 12 bit), and sensors of Family D2 are also noisy at a level above the discretization noise.
The time required for temperature data conversion is specified as maximum 750 ms in the datasheet (12 bit conversion). The actual time required has (at a given temperature) a well-reproducible, characteristic value for each sensor. This time is shown in plot (c). Family A1 takes around 600 ms for a conversion, while Families A2 and B show a comparatively large inter-sensor variability. Families C and D1 are remarably fast at 30 and 11 ms, respectively, while Family D2 takes around 500 ms or a little less. Although all sensors we measured were faster than 750 ms at room temperature, some sensors of Family B got close to the limit.
Warning
Sending undocumented function codes to a DS18B20 sensor may render it permanently useless, for example if temperature calibration coefficients are overwritten [5]. The recommended way of identifying counterfeit sensors is to check whether the ROM does not follow the pattern 28-xx-xx-xx-xx-00-00-xx [5]. (While the ROM can be overwritten in Families B1 and D1 to mimic genuine sensors, we have not come across sensors with spoofed ROM [5].)
(Information on chips of Families A, B, C, D, E, F, G, and H comes from my own investigations of sensors in conjunction with the references below as indicated by reference number [1-6,8-10,12-18]. All tests were performed at 5 V with 1.2 kOhm pull-up. Decapping was performed jointly with Nga P. Dang, and measurements of temperature offsets and timing with Irina Sæther and Megan O'Sadnick.)
Sources
Sensors or probes with authentic or cloned DS18B20 were purchased from the follwing sources. Note that only sensors purchased from offical Maxim distributors are authentic chips that are guaranteed to have been handled correctly. Free samples provided by Maxim Integrated through their online ordering system are gratefully acknowledged.
Official Distributors: Maxim Integrated, Digikey, Farnell, Mouser, RS Components ebay: 5hk1584, alice1101983, alphago-it, andnov73, areyourshop-003, b2cpowershop2010, bernard_netelectroshop, binggogo, careforyou123, cheaptronic24, christians-technik-shop, czb6721960, d-9845, deepenmind, diy-arduino, diybox, eckstein-komponente, enigma-component-shop, e*shine, efectronics, ele-parts, fr_aurora, fzeroinestore, geekapparels, good-module, happybuddhatrading, hermann_shopp, icmarket2009, jk_parts, justpro, kingelectronics15, london_shoppings_1, lovesell2013, lucas89-8, makershop, mecklenburg8, modul_technik, moore_estates, nouteclab, *orchid, polida2008, puretek-innovations, rammie_74, scuary1, sensesmart, sensus, sevenshop888, shenglongsi, sparco888, survy2014, tancredielettronica, umtmedia, worldchips, xiaolin4, xuan33_store, yantzlf AliExpress: All goods are free shipping Store, AOKIN DiyMaker, Cuiisw Module Store, Eiechip, Fantasy Electronic, FSXSEMI, Great-IT, Great Wall Electronics, HWA YEH, Liyuan Electronic, Mega Semiconductor, Red Yellow Store, RoarKit Store, Sensor World, SHENGSUN Sensor, Shenzhen High Quality Products, shop912692, TENSTAR, WAVGAT, Win win., YLGA, YX Electronic Other: Adafruit, AZ-Delivery, Banggood, Taizhou Best Electric Equipment, Conrad Electronic, DFRobot, DROK, Elektroimportøren, Elfa Distrelec, Shanghai Jiutian Automation Equipment, Kjell & Company, LCSC, Dongguan Nangudi Electronics, Quest Components, Shenzhen RBD Sensor Technology, Reichelt Elektronik, Shenzhen Senstech Electronic Technology, SparkFun, Tayda Electronics, TELMAL, Dongguan Tianrui Electronics, YourDuino
References
- DS18B20 "DS18B20 Programmable Resolution 1-Wire Digital Thermometer", Datasheet 19-7487 Rev 6 7/19, Maxim Integrated.
- DS18S20 "DS18S20 High-Precision 1-Wire Digital Thermometer", Datasheet, Maxim Integrated.
- AN4377 "Comparison of the DS18B20 and DS18S20 1-Wire Digital Thermometers", Maxim Integrated
- AN247 "DS18x20 EEPROM Corruption Issue", Maxim Integrated
- Own investigations 2019-2024, unpublished.
- Petrich, C., M. O'Sadnick, Ø. Kleven, I. Sæther (2019). A low-cost coastal buoy for ice and metocean measurements. In Proceedings of the 25th International Conference on Port and Ocean Engineering under Arctic Conditions (POAC), Delft, The Netherlands, 9-13 June 2019, 6 pp. (link)
- Contribution of user m_elias on https://forum.arduino.cc/index.php?topic=544145.15
- MAX31820 "1-Wire Ambient Temperature Sensor", Datasheet, Maxim Integrated.
- DS18B20 "DS18B20 Programmable Resolution 1-Wire Digital Thermometer", Datasheet 043001, Dallas Semiconductor, 20pp.
- DS18B20 "DS18B20 Programmable Resolution 1-Wire Digital Thermometer", Preliminary Datasheet 050400, Dallas Semiconductor, 27pp. (Wayback Machine)
- Piecemeal from various blogs and posts.
- QT18B20 "QT18B20 Programmable Resolution 1-Wire Digital Thermometer", Datasheet Rev 061713, 7Q Technology.
- AIR6273 "Terms, Definitions, and Acronyms Counterfeit Materiel or Electrical, Electronic, and Electromechanical Parts", SAE Aerospace Information Report, July 2019.
- UMW DS18B20 UMW DS18B20 datasheet.
- MY18E20 Mysentech home page (English) with link to datasheets.
- MY18E20 FAQ Mysentech FAQ (Chinese).
- NS18B20 "High-precision Single-BUS Digital Temperature Sensor", NS18B20 Datasheet Rev. 1.0, Novosense.
- DS18B20T Datasheet, Xinbole.