Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect frequency limit for DHT11 #206

Open
cryptoAlgorithm opened this issue Sep 4, 2023 · 0 comments
Open

Incorrect frequency limit for DHT11 #206

cryptoAlgorithm opened this issue Sep 4, 2023 · 0 comments

Comments

@cryptoAlgorithm
Copy link

  • Arduino board: Raspberry Pi Pico (RP2040 B1)

  • Arduino IDE version (found in Arduino -> About Arduino menu): PlatformIO earlephilhower core

  • List the steps to reproduce the problem below (if possible attach a sketch or
    copy the sketch code in too):

  1. Read values from the sensor in a loop: dht.readHumidity() or dht.readTemperature()
  2. Observe that values do not change at a frequency higher than 0.5Hz

It appears that this is due to an artificial ratelimit imposed by the DHT::read(...) method. Specifically, MIN_INTERVAL is hardcoded to 2000 for all types of sensors, which I assume is due to the DHT22's maximum read frequency of 0.5Hz. However, other sensors supported by this library, such as the DHT11, can read at a higher rate of 1Hz, so this value should instead be set based on the sensor type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant