Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Temperature Sensor Options
#12

This evening I started to play with the routine within the WeatherDuino software which manages the DHT22 readings, with results I feel are interesting when the multiplier is adjusted.

Original code:
 
Code:
#if (TH_SENSOR1 == 1)
    // -----  Read temperature from DHT22 (in celsius) -------
    void read_DHT22()
    {
      dht.reading(T_ExtS1, H_ExtS1);
      T_ExtS1 = T_ExtS1 * 10;
      H_ExtS1 = H_ExtS1 * 10;
    }
  #endif

If I change the "*10;" to "*2;", each time the data is displayed, the numbers are doubled: 5.06, 10.12, 20.24, 40.48...
If the "*10;" is changed to "*100;", there is no clear pattern to the number outputs.

When analysing the serial output data when the routine multiplier is set to the default of "*10;", I note that the decimal point shift in a similar pattern to how it is being multiplied and the numbers doubled when I set the multiplier to 2.
 
Code:
Sending ID0...
  Sensor 0 - Temp: 0.00  Hum: 0.00
  Sensor 1 - Temp: 27.40  Hum: 59.20

Sending ID0...
  Sensor 0 - Temp: 0.00  Hum: 0.00
  Sensor 1 - Temp: 274.00  Hum: 0.00

In my tests, I note that once the humidity value exceeds 100, it will always return a 0.00 or a 99.90 result on the serial output.

Could the answer be within this test done within the routine file for these random numbers to be coming from the sensor? It is almost like a variable remembering/retaining the last value and not replacing it before it is processed again.


Attached Files Image(s)
       
Reply


Messages In This Thread
Temperature Sensor Options - by Palmyweather - 10-12-2023, 03:27
RE: Temperature Sensor Options - by Shred - 11-12-2023, 10:43
RE: Temperature Sensor Options - by werk_ag - 17-12-2023, 00:48
RE: Temperature Sensor Options - by Palmyweather - 22-12-2023, 20:07
RE: Temperature Sensor Options - by werk_ag - 28-12-2023, 23:21
RE: Temperature Sensor Options - by Palmyweather - 29-12-2023, 08:43
RE: Temperature Sensor Options - by werk_ag - 30-12-2023, 04:54
RE: Temperature Sensor Options - by Palmyweather - 30-12-2023, 08:37
RE: Temperature Sensor Options - by werk_ag - 31-12-2023, 00:05
RE: Temperature Sensor Options - by Palmyweather - 31-12-2023, 06:11
RE: Temperature Sensor Options - by Palmyweather - 30-12-2023, 08:40
RE: Temperature Sensor Options - by Palmyweather - 31-12-2023, 06:26
RE: Temperature Sensor Options - by werk_ag - 04-01-2024, 06:13
RE: Temperature Sensor Options - by Palmyweather - 04-01-2024, 09:22
RE: Temperature Sensor Options - by werk_ag - 05-01-2024, 03:30
RE: Temperature Sensor Options - by Palmyweather - 05-01-2024, 07:47
RE: Temperature Sensor Options - by werk_ag - 08-01-2024, 19:43
RE: Temperature Sensor Options - by Palmyweather - 09-01-2024, 08:46
RE: Temperature Sensor Options - by Palmyweather - 15-01-2024, 00:15
RE: Temperature Sensor Options - by werk_ag - 15-01-2024, 01:54
RE: Temperature Sensor Options - by Franco - 14-04-2026, 03:18



Users browsing this thread: 1 Guest(s)