A DIY temperature/humidity sensor with an ESP8266 + DHT11 + MQTT

Hello everyone!

I’m writing an article for print media (the magazine « Programmez »), and I needed to include a use case with a bit of programming to make it interesting, so I chose an ESP8266 to demo a DIY sensor that sends data to Gladys :slight_smile:

I bought this NodeMCU Lolin V3 Module ESP8266 on Amazon, and I’m rather happy with my purchase :slight_smile:

I connected the device to my computer:

For the programming part, I programmed the board with the Arduino IDE.

I tested the connection to my WiFi network with the ESP8266WiFi library, and everything went well.

Then I connected the DHT11 to Pin D5 + 3V + Ground.

With the DHT.h library, I successfully retrieved the values, which I then pushed to MQTT.

In a few lines, it’s done, I successfully retrieve my values in Gladys:

I will make a detailed tutorial that will of course be published in the magazine (early 2021!), and I will probably make a complementary article on the documentation :slight_smile:

In any case, I was surprised, it really works well and I didn’t have any major problems, which is rare for this kind of tinkering :smiley:

For information, I do the same thing (ESP8266 + DHT11 or DS18x20 + Motion sensor + Light sensor…) having installed the Tasmota firmware on the ESP (configured in MQTT). Integration with Gladys is instantaneous.

Yes, it would be great to have a specific section in the documentation for this kind of thing.
With concrete examples to be able to integrate it into Gladys quickly.

Yes, indeed, a separate topic could have been created, I agree with you.

I could make one, like a tutorial from A to Z if it can be of interest.

Could you please publish the code for your project?