Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By StarkJohan
#18849 I also get 127.94 celsius pretty consistently when using parasitic powering of the sensor, I really don't understand why though. Try normal power mode, it works just fine for me and the actual power consumption in deep sleep is the same (at least regarding to my el cheapo multimeter reading 0.735mA with the LED still attached on the olimex board).
User avatar
By karman
#24989 DS1820 works fine on older firmware (Feb) but on the new ones you can detect the sensor, but reading it just return 255 every time.

anyone else been able to get to work on latest firmware ?
User avatar
By Midori
#35349 viewtopic.php?f=29&t=2302&start=15

Probably I found the solution of this issue.
Please put the incantation in your code to a trial, like this.

Code: Select allOneWire  ds(2);  // on pin 2 (a 4.7K resistor is necessary)

void setup(void) {
  digitalWrite(2, HIGH);   // <- incantation code: same number as OneWire port
  pinMode(2, OUTPUT);   //<- incantation code: same number as OneWire port
  Serial.begin(9600);
}


It may be that the original library made OneWire port "open drain" mode.

DS18B20 needs 1mA to convert temperature.
But "open drain" mode cannot provide this current.
The "pinMode" function resolves this issue by changeing the port mode to OUTPUT.
If you use parasitic mode, Strong Pull-up is necessary during conversion.
This Strong Pull-up is accomplished by high-side transistor of output port.

I don't know which code in the library causes problem.
But I observed behavior of signal voltage by oscilloscope.
I found the voltage dropping after conversion command.
After I added "digitalWrite" and "pinMode" in setup routine, the voltage dropping didn't occur.
I wish this issue is resolved by correction of the library.
Sorry, I can't.