Jump to content
Sign in to follow this  
shenouda

dht22 (temperature and humidity sensor) python library compatible with Tinker edge R?

Recommended Posts

hello @shenouda

have you tried adafruit dht circuit library? adafruit/Adafruit_CircuitPython_DHT: CircuitPython support for DHT11 and DHT22 type temperature/humidity devices (github.com)

dht22 requires 3 pin connectors (vcc, gnd and gpio), you can use it on tinker edge r

to install the package:

pip3 install adafruit-circuitpython-dht --user

details can be found here: https://github.com/adafruit/Adafruit_CircuitPython_DHT#readme

Share this post


Link to post
Share on other sites
On 2/2/2023 at 7:49 AM, tooz said:

hello @shenouda

have you tried adafruit dht circuit library? adafruit/Adafruit_CircuitPython_DHT: CircuitPython support for DHT11 and DHT22 type temperature/humidity devices (github.com)

dht22 requires 3 pin connectors (vcc, gnd and gpio), you can use it on tinker edge r

to install the package:


pip3 install adafruit-circuitpython-dht --user

details can be found here: https://github.com/adafruit/Adafruit_CircuitPython_DHT#readme

Hi @tooz thank you for your reply.

when I try to do import board i get the following error:

NotImplementedError: Adafruit-PlatformDetect version 3.40.2 was unable to identify the board and/or microcontroller running the Linux platform. Please be sure you have the latest packages running: 'pip3 install --upgrade adafruit-blinka adafruit-platformdetect'

i tried running  'pip3 install --upgrade adafruit-blinka adafruit-platformdetect' but still getting the same error. Do you have any suggestion?

Share this post


Link to post
Share on other sites

hello @shenouda

 tinker edge r is not in the codebase of adafruit blinka, you'll need to put the source of the board to it.

please try using the attachment dht_simpletest.py 

instead of import board, please assign pins directly:

import time

#import board

import adafruit_dht

from microcontroller import pin

 

 

# Initial the dht device, with data pin connected to:

dhtDevice = adafruit_dht.DHT22(pin.GPIO2_B1)

this is to connect dht22 data pin to pin3 of tinker edge r 

https://tinker-board.asus.com/tw/doc_er.html#GPIO

 

er_qsg_06.jpg

 

dht_simpletest.7z

Share this post


Link to post
Share on other sites

thank you @tooz

I have tried running your code but then I get either A full buffer was not returned. Try again.     or      DHT sensor not found, check wiring ?   

the wiring seems to be right.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...