Help Needed: Getting Accurate Sensor Readings with Raspberry Pi Pico + DHT22!

Hi everyone,

I have been tinkering with a Raspberry Pi Pico and trying to get stable readings from a DHT22 temperature and humidity sensor. I followed the Core Electronics tutorial and used MicroPython to set everything up. It works — but the readings fluctuate more than expected, especially indoors where temps are stable.

Here’s what I have done:

  • Used 10K pull-up resistor between VCC and data
  • Powered from 3.3V pin
  • Reading every 2 seconds

Sometimes.., it jumps 2–3°C or 5% humidity for no obvious reason. I have double-checked wiring and even tried a second sensor with similar results.

Has anyone faced this issue or can suggest how to smooth the data: ?? Should I average multiple readings or is there a better sensor for more reliable indoor monitoring: ?? I have also gone through these resources Raspberry Pi Pico Tutorials | Raspberry Pi Pico Education Australia, sql course in bangalore but couldn’t get helpful insights.

Appreciate any advice !!

Derek Theler

1 Like

Hi @Derek288719,

Welcome back to the forum!

Thanks for sharing the details and what you’ve already tried. It sounds like you have the basic setup correct, but the DHT22’s fluctuations indoors are a common issue.

To improve your readings, you can average multiple samples to reduce noise, add a 100nF capacitor between VCC and GND to stabilise power, and increase the interval between readings to more than 2 seconds.

Also, sensor placement can affect accuracy, avoid direct sunlight, drafts, and areas with rapid temperature changes. Indoor humidity usually ranges between 30% and 60%, but local variations and condensation, especially in moist areas (e.g. bathrooms), can impact the sensor’s output.

If you continue to have issues after implementing the changes listed above, you can look at the following products we’d recommend:
PiicoDev Atmospheric Sensor BME280

  • Measures temperature, humidity, and barometric pressure
  • Connects via I2C
  • Good accuracy and low power consumption
  • Suitable for indoor/outdoor monitoring and weather stations
  • Stable and reliable readings
  • Well supported with libraries for Raspberry Pi Pico

SHT31 Digital Temperature & Humidity Sensor

  • Measures temperature and humidity only
  • Connects via I2C
  • High precision and fast response time
  • Excellent accuracy and stability indoors
  • Ideal for climate control, air quality monitoring, and data logging
  • Reliable and consistent measurements compared to DHT22