Post your best Lua script examples here

User avatar
By pataga
#18294 Hi, just saw the reports of problems with DHT11 and I just tested mine with default nodemcu firmware, no problems.

On the back of my DHT11, there is a label that clearly indicates VCC range 3.5V to 5.5V, even though the datasheet lists 3V - 5.5V. I earlier had trouble interfacing a DHT11 with a teensy board at 3.3V and it did work with an arduino mini at 5V.

So, I powered the DHT11 directly off the Lipoly battery (4.2V max), and used a standard circuit for interfacting 5V logic to 3.3V logic using a logic level nmosfet (2N7002 in my case, BSS138 also works).

DHT11 VCC -> Vbat
DHT11 data -> 3K3 resistor to Vbat
DHT11 gnd -> ESP8266 gnd
10uf and 100nF ceramic caps in parallel from DHT11 VCC to gnd
FET D -> DHT11 data
FET G-> 3V3 ( regulated supply for ESP8266)
FET S -> ESP8266 gpio2
3k3 resistor across FET G and FET S

Works fine for me.