Monday, August 29, 2016

DS18B20 temperature sensor and ESP8266

For a small project I had to measure temperature with some waterproof sensor and of course that my first choice was the DS18B20 waterproof sensor and for microcontroller an NodeMCU because I needed also the web server functionality. 


The DS18B20 sensors doesn't have the pull up resistor so I've added one with 4K7 value between DATA and VCC.

The fun is that adding only one sensor I couldn't read its value, but adding two of them in parallel everything was perfect. I've changed the pull resistor in range 1K to 9K4 , I've added a capacitor of 100nF between VCC and GND like it is in this module ( which by the way is working perfect alone with not other sensor in parallel).

Using the same library and sensors with Arduino works perfect, so it looks like my sensors have a problem ( all three of them) or the library need some adjustments for the ESP8266.


Lucky me that the project involved two DS18B20 sensors so for now I will use them like this.

Conclusion: If you have the same problem as I did just add another DS18B20 in paralel.


Picture from http://www.tweaking4all.com/




PS: I also tried the parasite mode ( is using only 2 wires instead for 3) but I had the same result.


Picture from http://www.tweaking4all.com/


To do: Connect this module with an 1 meter cable and check if is still working.

[ Later Edit ]. Looks like the probes were defective. After I've changed them everything is working now. I can connect one or more then one without problems.

3 comments:

  1. What a bad luck you've had , I've never had that problem with my sensors DS18B20

    ReplyDelete
    Replies
    1. Hi Leo, did you used the waterproof version and long cable ?

      Delete
    2. I use the two types, the waterproof, 1 mtr long cable , to take measures on the outside, and the soldier chip on the motherboard, for measurements indoors.

      Delete