Easy expansion of a DHT11 ESP8266-01 module

Various webstores sell (very cheap) a module with an DHT11, that takes a plug-in ESp8266-01, thus creating an easy way to ‘IoT’ the temperature and humidity in your house, or any place you want.

The module only uses 1 pin out of 4, but is a quick way to setup an ESP8266-01 application as it has a 3v3 regulator. As such it is also an easy base to use for projects that require a couple of more I/O pins.

Ofcourse one could solder wires directly to the head of the ESP8266-01, but a better solution is to create a little PCB in between  the module and the ESP8266.

For that, we need a couple of long headers and some scrap veroboard or strip board. This creates enough space to mount a small PCB as a ‘floor’ between the module and the ESP8266-01.

Veroboard and stripboard both have their pros  and cons: Veroboard needs you to connect the individual copper islets, but you don’t have to cut between the pins of the header, whereas stripboard doesn’t require you to connect individual islets, but you need to carefully cut the tracks between the 0.1″ spaced header columns.

Eventually you should be able to come up with something like this:

In this picture I expanded the module with a DS18B20, which explains the resistor at the top (is already replaced by an 0805 SMD resistor).

The DHT11 connects to GPIO2 and I have used GPIO0 for the DS18B20. If we look at the circuit of the module, we see that it has no pull up resistors on GPIO0 and GPIO2.

The reason for that is that the module is presumably for the ESP8266-01S that already has pull ups on GPIO0 and GPIO2, bt as I was using the regular ESP8266-01, there were no pull-ups.
The DHT11 module may boot without pullups and the DHT11 may render readings, but there will probably be an increased amount of false (‘nan’)  readings.
That can be solved by adding the appropriate 10k pull-ups to the board.
Here e.g. I have added an SMD resistor between the signal pin of the DHT11 and Vcc, which is a pull up on GPIO2 just as well.

Anyway, the extra PCB in between makes a further 3 pins available: GPIO0, GPIO1 and GPIO3. The latter 2 are ofcourse the Tx and Rx pin.
In order to use those as regular I/O pins, one needs to add the following two statements in the program:

pinMode(1, FUNCTION_3);
pinMode(3, FUNCTION_3);

A final remark on this module: realise that the DHT11 is placed close to the microprocessor, that generates heat and radiowaves. Those do affect the temperature reading. This can be up to 8-9 degrees difference. Bending out the DHT11 sensor -as shown in one of the pictures- gives much more reasonable readings.

The  method described here can also be used for some other ESP8266-01 modules that are available, such as the relay module , the DS18B20 module and the Neopixel controller (same link)

Advertisements