esp8266-01 using dht11 sensor not working

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
pytyler
Posts: 1
Joined: Sun Apr 11, 2021 10:01 pm

esp8266-01 using dht11 sensor not working

Post by pytyler » Sun Apr 11, 2021 10:31 pm

I am using esp8266-1m-20210202-v1.14.bin on a esp8266, esp-01 and have a dht11 3 pin sensor connected to GPIO2
I have tried:
from machine import Pin
from dht import DHT11
import time
sensor = DHT11(Pin(2))
sensor.measure()
dht_temperature = sensor.temperature()
dht_humidity = sensor.humidity()
print('temperature:',dht_temperature)
print('humidity:',dht_humidity)

and I get:
dht.py line 16 in measure
OSError:[Errno110] ETTIMEDOUT
Is there a way to get it to read temperature and humidity using the esp-01 module?

Post Reply