Git Product home page Git Product logo

qengineering / dht22-raspberry-pi Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 410 KB

DHT22 sensor on Raspberry Pi with WiringPi

Home Page: https://qengineering.eu/opencv-c-examples-on-raspberry-pi.html

License: BSD 3-Clause "New" or "Revised" License

C++ 100.00%
dht22 dht11 raspberry-pi raspberry-pi-3 raspberry-pi-4 raspberry-pi-64-os wiringpi temperature-sensor relative-humidity-sensors humidity temperature

dht22-raspberry-pi's People

Contributors

qengineering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dht22-raspberry-pi's Issues

prog delivers confused/zero values inbetween

When compiling and running your program with g++

$ g++ ./src/main.cpp ./src/DHT22.cpp -I./include -lwiringPi -o dht22

$ ./dht22

the output looks like

Temp : 12.00 °C,  Humidity : 99.90 %                                                            
Temp :  0.00 °C,  Humidity :  0.00 %                                                            
Temp : 12.00 °C,  Humidity : 99.90 %                                                            
Temp : 24.00 °C,  Humidity : 199.80 %                                                           
Temp :  0.00 °C,  Humidity :  0.00 %                                                            
Temp :  0.00 °C,  Humidity :  0.00 %                                                            
Temp :  0.00 °C,  Humidity :  0.00 %                                                            
Temp : 12.00 °C,  Humidity : 99.90 %                                                            
Temp : 12.00 °C,  Humidity : 99.90 %                                                            
Temp : 12.10 °C,  Humidity : 99.90 %                                                            
Temp : 12.10 °C,  Humidity : 99.90 %                                                            
Temp : 24.20 °C,  Humidity : 199.80 %

Note
I've been reformatting the output a bit and changing the loop delay to 5000ms inmain.cpp.

We can see zero values and sporadic doubled temperature values and +100 humidity values.

Why is that?

Loop interval timing

In the documentation, it says that the loop timing must be >2 seconds while the code only waits 1 seconds. I set my pause to 2.5 seconds and it helped somewhat. Still throws quite a few errors (I am testing 7 of them simultaneously).

Thanks a million for this work! It really helped me.

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.