I am unable to read DHT sensor on PIN 4 & 5, it works OK on pin 0.
I have tested pins 4 & 5 as an input buy pulling high and reading value and as an output by connecting a LED, both work fine and as expected
There is nothing else connected to pins 4 & 5, attempting to measure() on 4 or 5 results in a ETIMEDOUT error:
Code: Select all
>>> import dht
>>> import machine
>>> d = dht.DHT22(machine.Pin(4))
>>> d.measure()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "dht.py", line 13, in measure
OSError: [Errno 110] ETIMEDOUT
>>> import dht
>>> import machine
>>> d = dht.DHT22(machine.Pin(5))
>>> d.measure()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "dht.py", line 13, in measure
OSError: [Errno 110] ETIMEDOUT
>>> d = dht.DHT22(machine.Pin(0))
>>> d.measure()
>>> d.temperature()
28.99999
I also just tested on pin 15, that also fails, pins 0 & 2 work ?!