maandag 11 juli 2016

ESP8266 Basic DHT11 Temperature and humidity

I tested a DHT11 Temperature and Humidity sensor
with my ESP8266 board flashed with ESP8266Basic.

For this test i did NOT use the KY-015 Temperature and humidity sensor module (From the Arduino 37in1SensorKit ) with a DHT11. However that module should also work fine.
There are also some ESP8266 development modules that contain a DHT11 module.
I wanted to use a  "bare" DHT11 on my testmodule to later use this in a hardware project.
ESP8266Basic has some commands for the  DHT11 Temperature and Humidity sensor
On this module i found the labels for the pins GPIO3 and GPIO5 are swapped.  (  also when using the  DHT11 ).
With the program below the Temperature and humidity are printed one time

PinDHT11 = 4
'  GPIO5 = 4    GPIO4 = 5 with my test board !

DHT.SETUP( 11 , PinDHT11 )

print "<br>Pin : " & PinDHT11 & "<br>Time : " & time() & "<br>Temperature : " & DHT.TEMP() & "<br>Humidity :" & DHT.HUM()


Geen opmerkingen: