Have integrated Raspberry pi4 with a DHT sensor. The data pin is connected to pin GPIO 26
Have tried connecting the VCC to both 3.3V and 5V
Have tried with both Adafruit_DHT.DHT11 and Adafruit_DHT.DHT22 in the code for the same sensor but I get None None
import Adafruit_DHT
# Sensor should be set to Adafruit_DHT.DHT11,
# Adafruit_DHT.DHT22, or Adafruit_DHT.AM2302.
sensor = Adafruit_DHT.DHT22
pin = 26
while True:
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
print(temperature, humidity)
Output:
None None
Is the sensor broken??Should I replace it or is there any other solution??
pin = 26
topin = 37
(gpio 26). – programandoconro