Review Module Wemos TTGO ESP32 + OLED V2.0 + DHT11

I present a TTGO ESP32 module, this device has caught my attention since it is very complete, I ordered one to the Banggood.com online store for testing, the interesting thing is the union of the well known ESP32 module, DHT11 Sensor (Temperature / Relative Humidity ), 0.96 inch white OLED display, charging circuit for Lithium battery, perforated PCB for upgrades and a protective housing all in single device.

Characteristics and Disarming

This version of ESP32 has particular characteristics:

ESP32 module in QFN package

White OLED screen of 0.96 inches by i2c associated with the pins:

  1. OLED_SDA — GPIO4
  2. OLED_SCL — GPIO15
  3. OLED_RST — GPIO16

Circuit and charging interface for the lithium battery.

integrated serial to USB CP2102.

Default code

By default it brings the basic reading code of the DHT11 sensor and displays its values on the white oled display.

By default you have this Example: LilyGO/ESP32-DHT-SSD1306

 

Out of curiosity I have disarmed the module and know what it has inside. It has 2 screw in the back to open it.

Carefully remove the Wemos module from the socket and have a perforated pcb to add more sensors or functions, it has another 4 screws between the perforated pcb and the housing.

The battery apparently has no reference lithium battery or lithium polymer really no idea, I do not know its capacity.

The DHT11 sensor is welded to the perforated PCB, as we can see.

Warning: Please do not make any modifications to the battery, if you do not know the wrongly handled lithium batteries are dangerous, YES Explode, do not modify !!!.

Since there is no detailed information on the DTH11 sensor connection, tracking is connected to pin 22 or exactly GPIO22.

ESP32, Charge circuit and Antenna

Where to buy very cheap

 

Tests Performed

We have done 2 tests with this module with 2 programming platforms for the ESP32 which are Arduino IDE and ESP-IDF.

I will perform the first test in Arduino IDE with ESP32 boards for ease.

The second test with ESP-IDF for me is the most interesting since it is the official development platform for the ESP32 and has more advantages in terms of resource use, although it is a bit more complex to implement, but I recommend it for robust applications. that FreeRTOS has.

Arduino IDE

After some tests, I created this example in arduino IDE, Requires the libraries:

  • Wire.h for DTH11 compatible with ESP32.
  • SSD1306.h for the display oled.

Note: You can download the code at the end of the article from Github.

ESP-IDF 

It may seem complex and difficult but I invite you to use ESP-IDF, I am not an expert in FreeRTOS, but there is great documentation and it is very robust, if you do not like make from terminal commands and prefer an interface you can use “eclipse”.

Officially this example is not finished, I only have the DHT11 sensor reading, I am still testing and configuring the oled display, in esp-idf.

Perform tests of several available examples of ESP-IDF and DHT11, examples used libraries did not work very well, reading thingspeak-esp32-dht11 is a plot, I found a very good example created  hamsternz total gratitude for sharing their knowledge.

ethe example thingspeak-esp32-dht11 take it as a reference, download it and make some modifications, its example is very useful for future tests since it uses very well the sleep mode in esp32, which is really used efficiently in ESP-IDF.

I have removed all communication from the code and only used the sensor reading and created a “DHT_task” task to be cyclical.

Note: You can download the code at the end of the article from Github.

fragmento de código lectura DHT11 en ESP-IDF

Compile code in ESP-IDF “make all”

Download code to ESP32 “make flash”

Display terminal reading of Sensor DHT11, “make monitor”

Unlike libraries this example in its plot and reading of the sensor allows to request the Temperature with a decimal 33.9 ° C, excellent, possibly with some modifications in the arduino libraries can also do it.

 

Testing with libraries SSD1306.h in ESP-IDF

I am currently doing tests with the OLED display and the SSD1306.h libraries, testing a great variety of libraries created by TaraHoleInIt/tarablessd1306in advance thanks for sharing your knowledge, when I have a concrete example with the OLED I will share it.

Test code of SSD1306.h in ESP-IDF.

 

Video: Review Wemos TTGO ESP32 Oled 2.0 Sensor : Arduino IDE & ESP-IDF

Conclusions and Suggestions

Personally it is a good team that meets the characteristics we need in a measuring device, encapsulated that technically protects our ESP32, a sensor, battery and possible expansion.

Thanks to the Banggood.com store for this product.

It is very useful for our IoT tests, could be implemented sleep periods and HTTP or HTTPS or MQTT transmissions, I confess have not investigated the way low consumption of esp32, perhaps with tests we discover how long it lasts.

Conclusion 1: Battery life

I guess they wonder how long the battery lasts, I have not done real or concrete tests, I’ve only done a basic test, I initially downloaded the code of the arduino ide example, which we used above, without sleep mode or low consumption mode, timing the module it has loaded by USB 10 minutes or more and when disconnecting it has lasted on read only 1 hour with 46 minutes until NaN is displayed in both readings and it is turned off.

Consider

I will mention factors that affect battery life not considered in the previous test

  • Display on all the time.
  • No sleep mode or low consumption.
  • No Wifi or Bluetooth communication
  • There are no unused peripherals of ESP32 enabled.
  • Obviously when you enable Wi-Fi the consumption will increase considerably, perhaps this battery will not last a long time.

Suggestions

I understand the ease of programming in Arduino IDE, but I recommend using ESP-IDF, because of the many advantages that Vs Arduino ide presents, ESP-IDF uses FreeRTOS, allows you to use and de-enable hardware, debugging as an Operating system, allows to administer 100% ESP32, has more examples and detailed implementations, is very well documented.

Of course I will continue testing in Arduino IDE, I only present 2 possibilities.

 

Future implementations

This module maybe with a solar panel and in low power mode, we can perform integrations with IoT platforms such as Emoncms, Ubidots, Cayenne, Blynk or Node-RED using MQTT or HTTP protocols.

Maybe add a LoRa module since there is space, or more sensors with i2c protocol or SPI.

Interesting or Recommended Examples

Downloads 

 

Leave a Reply