I am currently working on a Raspberry Pi Pico W project where I need to use the DHT11 sensor to return humidity and temperature however the results are returning -1 for both the temperature and humidity.
I've included a picture of the circuit as well as the code. I would appreciate any help or tips on this!
from machine import Pin, I2C
import utime as time
from dht import DHT11
pin = Pin(13, Pin.OUT, Pin.PULL_DOWN)
sensor = DHT11(pin)
while True:
print("Temperature: {}, Humidity: {}".format(sensor.temperature, sensor.humidity))
time.sleep(1)
I've tried another sensor, rewiring the circuit, and different code variations I've seen online and I am still getting a -1 for both temperature and humidity.