Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By xtal
#42380 It looks like your configuration reg are set different and maybe user1,2
I think cfig 7F => 12 bit 5F => 11 bit 3F => 10 bit 1F => 9 bit resolution
normal rcv = TLsb,TMsb,THub,TLub,Cfig,RSV,RSV,RSV,CRC
All your output is showing family code 28? are all your sensors 18B20? ,

01-90-05-ff-ff-7f-ff-10-10 looks like you or code already swapped TMsb,TLsb unless neg temp?
so IF 01 -90 => 0000 0001 1001 0000 0190hex==> 400 * .0625 = 25c
so IF 90 -01 =>1001 0000 0000 0001 --this has to be wrong --sign bits not agree
----------------------------0111 1111 1111 = 7FE +1 =7FF -127.9375c if sign neg correct


You crc's looks bad , but maybe I'm miscalculating



I use the following in PROTON basic
Code: Select allcrc=0
for x=0 to 8
  crcdata = B20str[X]       ' load TLow-THigh - THR -TLR -DSFig -RSV5-RSV6-RSV7-CRC
  gosub crc8                         ' comput crc
next x
C=crc                                      ' good read crc = 0
User avatar
By fotastisch
#42394 Hi!

Thank you very much for your help!
I've tried your suggestion chaeplinand switched to the milesburton library, but the measurements remain the same. I'm more and more convinced, that my sensors might be the problem. That's actually the reason why there are now two sensors right now, just to be sure that it's not just a "broken" sensor.
And yes, all my sensors are supposedly DS18B20s, at least that's how they were advertised and labeled.

I'll follow up on the CRC part tonight and post the results. I did not expect it to be so hard to get it working. ;)
User avatar
By xtal
#42409
Code: Select allcelsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit"); - See more at: http://www.esp8266.com/viewtopic.php?f=29&t=8514&start=4#sthash.JKmwKJm8.dpuf


Are sensors parasitic [DS18b20P ? ] or powered [DS18b20+ ?]
powered can be used as parasitic,,,, parasitic are parasitic only....
1st load proper cfig..............
2nd
looks like this code may be issue (float)raw/16.0 if raw = 0190 hex then /16 = 019 hex = 25C not 89 c
like your 1st output