Git Product home page Git Product logo

picodht22's Introduction

PicoDHT22

Micropython DHT22 class using PIO

P.S. Some people have problem with the power on time to activate the DHT22. The spec specify 2 seconds. The current one is 200ms. Please change it has it fit!

*** UPDATE *** Sept22 Micropython includes its own version DHT22 module Then the module is now named PicoDHT22

picodht22's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

picodht22's Issues

Import from self

from DHT22 import DHT22

That doesn't work. You need to import from another module, and usualy you do this importing in the beginning of the file. If you just want to call the DHT22 class, just call it directly, it's right above there.

Checksum always 1 off

Hey, I am using this with my Pico, but I keep getting "sensor error". After some checking I saw that the sum of my first 4 result bytes is always 1 higher than the parity byte (except for very few exceptions). For example: [3, 72, 2, 37, 113] with 3+72+2+37 = 114 ≠ 113
In regard to the consistency of this, I gather that my implementation cannot be so wrong, but still it is not right. Could it be that the pull-up resistor is too small? It has 9.8kΩ, which in my opinion is not too far off.
Btw, without the resistor I have the same issue.

OSError: [Errno 12] ENOMEM on Pico W

When using new Pico W together with the DHT22 sensor I get a reading the first time I run the code. The second time and all the following I get the ENOMEM error. I need to physically disconnect and reconbnect the usb to be able to get a reading once more.

Code I run:

from DHT22 import DHT22
from machine import Pin

data_pin = Pin(2, Pin.IN, Pin.PULL_UP)
sensor = DHT22(data_pin)
print(sensor.read())

And the output for two runs:

MicroPython v1.19.1 on 2022-07-05; Raspberry Pi Pico W with RP2040

Type "help()" for more information.
>>> %Run -c $EDITOR_CONTENT
(27.2, 59.8)
>>> %Run -c $EDITOR_CONTENT
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "DHT22.py", line 156, in read
  File "DHT22.py", line 141, in read_array
OSError: [Errno 12] ENOMEM
>>> 

Droping decimal for dh11

Hi is there some reason to drop decimal part of temerature for DHT11?

I modified the code to include it, and had parallel DHT11 and DHT22 connected,one next to the other, and then the temperature value was same.

temperature=value[2]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.