Code Monkey home page Code Monkey logo

Comments (15)

winlinvip avatar winlinvip commented on June 9, 2024 1

It works~ I have done that.
BTW: It's not possible for raspberry-pi to directly drive the DHT11(maybe use C is ok, but python is not), for the DHT11 use Nms interval as the protocol, while the Arduino is good to do such things.

You can use Serial for Raspberrypi to communicate with Arduino. https://github.com/winlinvip/SimpleSerial
Use Arduino to sample the DHT11 and send the data to RaspeberryPi by usb serial port.

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024 1

It seems the protocol between DHT22 and DHT11 is not very different, I can support DHT22, but I haven't get a DHT22, can you test it for me?

The major difference of DHT22 and DHT11 is the startup signal, DHT11 PULL LOW 18ms+, while DHT22 PULL LOW 500us+ or 1ms+.

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

@mbeacom No plan, I have no time to play, 😄
BTW: Seems there are lots of libraries about the DHT22, why not use them?

from simpledht.

mbeacom avatar mbeacom commented on June 9, 2024

Honestly, I was just excited to see your DHT11 package, since I've been following you on GH as of lately and I'm in the middle of working on a personal, side project using the DHT11 and 22s. Haha

Regardless, Thanks for everything @winlinvip !

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

So you are using Arduino to Sample the temperature and humidity by DHT11/22?

from simpledht.

mbeacom avatar mbeacom commented on June 9, 2024

👍 Ongoing sampling with a raspberry pi and Arduino to monitor temperature/RH!

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

I have supported DHT22 in 32bf028, however I didn't test it yet, please use example to test it. Other examples should also work by changing the class SimpleDHT11 to SimpleDHT22.

After testing it, please close this issue. Thanks~

from simpledht.

mbeacom avatar mbeacom commented on June 9, 2024

@winlinvip I will test the patch sometime this evening and let you know!

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

Great, what's the result?

from simpledht.

equake avatar equake commented on June 9, 2024

I'm trying to use this lib with an DHT22 without success. I get error 101 / 102 while trying to fetch temperature.

I can make some tests if you want!

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

@equake Please do some tests.

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

image

I will refine the protocol according to http://akizukidenshi.com/download/ds/aosong/AM2302.pdf

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

I have verify the v1.0.5, it works with DHT11:

Sample DHT11 with RAW bits...
Sample RAW Bits: 0001 1110 0000 0000 0001 1100 0000 0000 0011 1010 
Sample OK: 28 *C, 30 H
=================================
Sample DHT11 with RAW bits...
Sample RAW Bits: 0001 1110 0000 0000 0001 1100 0000 0000 0011 1010 
Sample OK: 28 *C, 30 H

With DHT22:

Sample DHT22 with RAW bits...
Sample RAW Bits: 0000 0010 1011 0001 0000 0001 0001 1111 1101 0011 
Sample OK: 28.70 *C, 68.90 RH%
=================================
Sample DHT22 with RAW bits...
Sample RAW Bits: 0000 0010 1010 1000 0000 0001 0010 0000 1100 1011 
Sample OK: 28.80 *C, 68.00 RH%

Remark: Notice that the DHT11 humidity is H, while DHT22 is RH%, for example:

Humidity:0011 0101=35H=53%RH

from simpledht.

Rayzor53 avatar Rayzor53 commented on June 9, 2024

Doesn't work below freezing. Returns an absurd answer -2856. This with DHT22.

from simpledht.

winlinvip avatar winlinvip commented on June 9, 2024

@Rayzor53 Dup to #14

from simpledht.

Related Issues (20)

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.