DS18B20 and 85° C temperature failures

Posted on
  • I'd like to point out, that if you plan to use a DS18B20 (sic, might as well be true for a 1820 or 18S20) in a real two wire mode with a parasite power pullup, than the module won't work. You'll end up reading the power up values for the temperature bytes (0x50, 0x05) instead of real values. By looking in the Arduino code I found that the code simply waits if a parasite mode is detected. This has to be implemented. The time to wait depends on the resolution, so please refer to the data sheet.
    As a workaround you may just want to delay up to one second (750ms is max conversion time if 12 bit resolution is used), after the CONVERT_T (0x44) command was issued. This usecase is also documented in the date sheet (convert t command)

  • Let's do it! I've just found arduino implementation you mentioned https://github.com/JChristensen/ds18b20/­blob/master/ds18b20.cpp#L32-L63
    But didn't figured out better workaround for DS18B20.js yet.

  • Hm, same code being invoked within callback works fine.

  • Hi - the DS18B20 module was fixed a week or so go so you can use the callback

    Without the callback Espruino doesn't want to wait for the temperature reading (which can take almost a second!) so it returns the current value and kicks off a new reading.

    It should all be documented on the DS18B20 page: http://www.espruino.com/DS18B20

  • I am using the WebIde for testing the example running at an Wemos D1 Wifi Uno and Espruino v1.89. After 53 getTemp() the board reloads. Also the boards reloads immediately when I enter:
    process.memory() at the interactive window. The temperature chip is: KY0001 of the 37 sensors kit.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

DS18B20 and 85° C temperature failures

Posted by Avatar for heimi @heimi

Actions