Do you really, really need the data that frequent? You’re not setting up a meth lab or something are you?
As long as you use the DHT11 you’ll always have problems with the sampling rate. It’s old, cheep, slow and basically not built for high frequency sampling. And I’ve noticed that some libraries are slower than others because of built in delays.
But there is still hope for the DS18B20 sensor! If you change the resolution from 12 to 9-bit (0.5 degree Celsius increments) the conversation time drops from ~750 ms to ~100 ms! Another approach to is to get creative with the
setWaitForConversion()
function. I managed to get the time spent for a 12-bit reading down to below 40 ms. Read the comments in my old project:
https://community.blynk.cc/t/cheap-est-rf-433-mhz-bridge-for-home-automation-with-both-tx-and-rx/
That would be a better sensor, especially for humidity.