04-01-2024, 09:22
(This post was last modified: 04-01-2024, 09:56 by Palmyweather.)
Hi again
Yes, I notice the first reading is always correct. And it seems to never clear that variable once set. Hence my trial of the multiplier by 2, 10 and 100 which confirmed that the variable never updated.
Currently I am using the following to compile the code:
Arduino IDE: 1.8.5
Arduino AVR board version: 1.6.21
Sadly I am unsure how to enable the debug mode within the DHTxx library.
Probably a pointless test:
To try and confirm if the error is in the "dht.reading" line, I added two lines which set the variables to zero before the reading is done. Conclusion from doing this, it successfully takes one reading before returning zero after that. Therefore I conclude that it is not getting another reading to repopulate the variable, not calling the correct routine.
Serial Output by adding above two lines of code:
Sadly I do not really know enough about the detailed workings of the code to be much help I'm sorry.
What I might try just for fun is buy some "generic" DHT22 sensors and see if I get any different results. Only thing is the time it will take to get from China with no local source.
I will continue with looking for some cost effective SHT10 temperature sensors too, but I do not think that will be easily found these days.
I would like to continue to work with SHT10 or DHT22 because of the distance in cable between sensor and transmitter as it would be challenging to position the ground sensors which are connected to this board while maintaining above ground temperature reading accuracy without the sun causing excessive heat build up during the day.
Thank you for your help,
Matthew
Yes, I notice the first reading is always correct. And it seems to never clear that variable once set. Hence my trial of the multiplier by 2, 10 and 100 which confirmed that the variable never updated.
Currently I am using the following to compile the code:
Arduino IDE: 1.8.5
Arduino AVR board version: 1.6.21
Sadly I am unsure how to enable the debug mode within the DHTxx library.
Probably a pointless test:
To try and confirm if the error is in the "dht.reading" line, I added two lines which set the variables to zero before the reading is done. Conclusion from doing this, it successfully takes one reading before returning zero after that. Therefore I conclude that it is not getting another reading to repopulate the variable, not calling the correct routine.
Code:
#if (TH_SENSOR1 == 1)
// ----- Read temperature from DHT22 (in celsius) -------
void read_DHT22()
{
T_ExtS1 = 0; // Added line for testing
H_ExtS1 = 0; // Added line for testing
dht.reading(T_ExtS1, H_ExtS1);
T_ExtS1 = T_ExtS1 * 10;
H_ExtS1 = H_ExtS1 * 10;
}
#endifSerial Output by adding above two lines of code:
Code:
Sending ID0...
Sensor 0 - Temp: 0.00 Hum: 0.00
Sensor 1 - Temp: 24.20 Hum: 54.10
Sending ID0...
Sensor 0 - Temp: 0.00 Hum: 0.00
Sensor 1 - Temp: 0.00 Hum: 0.00
Sending ID0...
Sensor 0 - Temp: 0.00 Hum: 0.00
Sensor 1 - Temp: 0.00 Hum: 0.00
Sending ID0...
Sensor 0 - Temp: 0.00 Hum: 0.00
Sensor 1 - Temp: 0.00 Hum: 0.00Sadly I do not really know enough about the detailed workings of the code to be much help I'm sorry.
What I might try just for fun is buy some "generic" DHT22 sensors and see if I get any different results. Only thing is the time it will take to get from China with no local source.
I will continue with looking for some cost effective SHT10 temperature sensors too, but I do not think that will be easily found these days.
I would like to continue to work with SHT10 or DHT22 because of the distance in cable between sensor and transmitter as it would be challenging to position the ground sensors which are connected to this board while maintaining above ground temperature reading accuracy without the sun causing excessive heat build up during the day.
Thank you for your help,
Matthew

