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

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

Picture from

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.

Saturday, August 27, 2016

A good book about ESP8266

One thing that I did in the last two months was to collaborate with Packt Publishing to be technical supervisor for a book about the ESP8266.

Book is written by Marco Schwartz and can be purchased from Amazon.

The summary of the book is in the following pictures.

Friday, August 5, 2016

Mqtt broker on ESP8266 #4

[Later edit]. On you will find instructions on how to install the ESP8266 MQTT broker on your EPS8266 and how to use the MQTT service provided by

I have more progress in ESP8266 as MQTT broker.

What I have for now on this ESP8266 module:

  • MQTT broker functionality
  • Bridging data to/from and another MQTT broker ( usually a cloud MQTT instance)
  • websockets connectivity ( I can now connect with my Homy application directly to the ESP8266 acting as an MQTT broker)
  • OTA (Over The Air) updates. Every time I have a new software update the ESP8266 is updating itself so, I can say that I have continuous integration (CI) and continuous deployment(CD). Also all the modules are activated over the air.
With all those function in place I still have 34kb of heap available for other features and yes is running on an ESP with a minimum 1Mb of memory. ESP8285 is a good candidate for running the broker.

Is working also on and old ESP-01 with 512kb but without OTA functionality.

Previous posts on the same subject:

IoT with ESP8266: Mqtt broker on ESP8266 #1