DHT on the pyboard

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

DHT on the pyboard

Post by devnull » Fri Mar 29, 2019 9:51 am

I have been using the AM2322 on the ESP/ESP32 for several years successfully.

I have just tried to read the device on the pyboard and are unable to get any data:

Code: Select all

import dht, pyb
dhti = dht.DHT22(pyb.Pin('Y6',pyb.Pin.IN,pyb.Pin.PULL_UP))
dhti.measure()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "dht.py", line 16, in measure
OSError: [Errno 110] ETIMEDOUT
Pins 3&4 (SCL>GND) are linked and connected to ground so that it uses the native connection mode, same as on the ESP8266

I know this device is working for sure as the same device plugged into the ESP8266 returns it's data correctly ?!

Any suggestions ?

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: DHT on the pyboard

Post by devnull » Sat Mar 30, 2019 10:14 am

Could anyone confirm whether they have the DHT driver successfully running on the pyboard / pyboard D as I am getting nowhere.

I have tried reconfiguring the pin as Open Drain Output but still nothing, immediate failure with timeout as above

Thanks

User avatar
devnull
Posts: 473
Joined: Sat Jan 07, 2017 1:52 am
Location: Singapore / Cornwall
Contact:

Re: DHT on the pyboard

Post by devnull » Sat Mar 30, 2019 11:10 am

Solved, need a physical pullup, the internal pull does not appear to work in this mode.

Post Reply