how to read temperature/humidity sensor attached to an Intel Edison?

Internet of Things IoT Frameworks 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating
_x000D_ _x000D_ I'm trying to create an DHT11-based temperature/humidity sensor with Intel Edison and mraa via Python: The documentation for Python's mraa package was a bit thin on example code. There's a lookup table to associate physical pins to mraa pin numbers. The GP44 pin on the breakout board is mraa pin 31: >>> import mraa >>> mraa.INTEL_EDISON_GP44 31 The gp44 port was configured as an ouput port: >>> gp44_pin = mraa.Gpio(31) >>> gp44_pin.dir(mraa.DIR_OUT) When I read from the gp44 pin it returns zero: >>> gp44_pin.read() 0 Looking at the C examples, it seems that the DHT11 sensor returns a byte array that can be deciphered. I stumbled across some more specific instructions to decode the bytes but, undfortunately, the code examples were specific to the Raspberry Pi and I'm working with Intel Edison. Ideally, I'd like to call methods that return temperature and humidity, but a byte array would would also work since I have the 'decoder ring'. Can you see what needs to be done in order to return the temperature/humidity (or byte array)?

Posted on 16 Aug 2022, this text provides information on IoT Frameworks related to Internet of Things. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago
_x000D_ A sample C code for DHT11 with Intel Edison is there in one of the links you already shared. One of the section "The Software" describes in detail how the sample program is designed to read the data. Also there is a discussion on this thread on issues with DHT11 sensor or any other sensor that uses one wire with Edison or similar boards.

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Important Internet of Things Links