Closed Alabaca closed 2 years ago
Reading with a value of 0 may mean there's a connection issue between the ESP and DHT. Check your wiring and pin configuration (maybe 2 should be changed to D2?) I don't really know how the pins are mapped on a basic ESP8266-01 module
This code works fine, and the hardware is the same. The PIN mapped looks equal to yours...
It happens to me too, but I have a NodeMCU and my DHT11 is connected to D4
Reading with a value of 0 may mean there's a connection issue between the ESP and DHT. Check your wiring and pin configuration (maybe 2 should be changed to D2?) I don't really know how the pins are mapped on a basic ESP8266-01 module
I don't think it's a wiring or configuration problem, there has to be something wrong with the code or the server, because I didn't change the wirings from the previous ones
Hi all. I'm not very strong in programming but the output is next
float newTemp = dht.readTemperature();
float newHum = dht.readHumidity();
// if ((temp >= temp_min_value) && (temp <= temp_max_value)) { // if ((newTemp >= temp_min_value) && (newTemp <= temp_max_value)) { // temp = temp_weight newTemp + (1.0f - temp_weight) temp; // keep weighted measurement value // } else { temp = newTemp; // keep current temp // } // } // else - keep newTemp as is
// if ((hum >= hum_min_value) && (hum <= hum_max_value)) { // if ((newHum >= hum_min_value) && (newHum <= hum_max_value)) { // hum = hum_weight newHum + (1.0f - hum_weight) hum; // keep weighted measurement value // } else { hum = newHum; // keep current hum // } // } // else - keep newHum as is
// Set DHT11 or DHT22 accordingly
Thanks! This was a very simple fix to be honest 😄
Hi, try using the latest code, in theory it's fixed now. Tell me if i can close this issue.
❤️
Hi, try using the latest code, in theory it's fixed now. Tell me if i can close this issue.
❤️
Hi. Seems to be working fine.
Hi, it really is working now:
But to be honest this ESP performs really slow with the DHT11 module, with very slow mining performance that don´t even appear on the wallet... Since is the first version of the ESP8266, I will assume that it does not have the power to do both things at the same time, and use it without the DHT11.
Thanks for the effort, and at least it contributes to make some improvements on the code.
For me you can close the issue.
I have just upload the new ESP8266 release, and activate the DHT since I'm using a Shield DHT11 with a ESP-01.
My code is like this:
ifdef USE_DHT
float temp = 0.0; float hum = 0.0; float temp_weight = 0.9; // 1 for absolute new value, 0-1 for smoothing the new reading with previous value float temp_min_value = 10.0; float temp_max_value = 40.0; float hum_weight = 0.9; // 1 for absolute new value, 0-1 for smoothing the new reading with previous value float hum_min_value = 0.1; float hum_max_value = 100.0;
// Install "DHT sensor library" if you get an error
include
// Change D3 to the pin you've connected your sensor to
define DHTPIN 2
// Set DHT11 or DHT22 accordingly
define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
endif
Have no errors compiling and uploading, but the results came Zero from the sensors
Running a simple skecth using the same configuration on the DHT I can have readings
Can this be something related with the code, or some parameters extra for this hardware?