Non è molto preciso

sono riuscito a farlo funzionare
ma ho notato che non è molto preciso,
ha un errore di 2 gradi centigradi
ho una temperatura di 19 gradi lui ne segna 21
come posso rimediare?

Fiorenzo Ruscelli

i managed to get it to work
but I noticed that it is not very accurate,
it has an error of 2 degrees Celsius
I have a temperature of 19 degrees and he scores 21
how can i fix it?

The DHT11measures temperature with an accuracy of ±2°C (see DHT11 basic temperature-humidity sensor + extras : ID 386 : $5.00 : Adafruit Industries, Unique & fun DIY electronics and kits), so the error you report is to be expected. If you want a more accurate temperature and RH sensor, then you could try the Sensirion SHT21 which measures temperature with an accuracy of ±0.3°C.
XOD library for the SHT2x series: wayland/sht2x-rh-temp — XOD

You can try testing it over a range of temperatures. If it is always 2 degrees off, just subtract 2 degrees. As wayland pointed out, this is within the accuracy of the sensor you have chosen, so readings might possibly just bounce around ±2°, or you might get lucky and just be consistently the same 2 degrees off. It might also be possible that is reads +2° at one end of its range, and -2° at the other end of its range. As long as it is not random, you can probably do some math to get more accurate output. Changing to a different sensor (even the same model) might change the math needed since the sensor is not designed to be more accurate, and each one might return different results.