DHT11 and DHT22

Hi to all.
Is anyone have example for Intel Edison. Because I was try so many sketches and libraries and didn’t work.
In DHTtester example i have the error:

C:\Users…\Documents\Arduino\libraries\DHT\DHT.cpp: In constructor ‘DHT::DHT(uint8_t, uint8_t, uint8_t)’:
C:\Users…\Documents\Arduino\libraries\DHT\DHT.cpp:18:46: error: ‘microsecondsToClockCycles’ was not declared in this scope
_maxcycles = microsecondsToClockCycles(1000); // 1 millisecond timeout for
^
Error compiling.

Any help :smile:

Hi, in case you are familiar with Particle at particle.io, you can check out a project I made this week to try out Blynk:

3 Likes

Hi I am trying to follow your code but I get an error, which DHT.h did you use as there are a few out there as I think this is my problem

I used https://github.com/adafruit/DHT-sensor-library
but it’s been updated since then (last modified 6 days ago).

We used to have to play with the ‘count’ argument passed in the constructor to get it to work - but now it’s automagically derived:

// Note that count is now ignored as the DHT reading algorithm adjusts itself
// basd on the speed of the processor.

replacing the “30” value with “15” gives accurate readings all along

DHT22 datasheet recommends >2 seconds for collecting data from the sensor


I tried with this code, wemos D1 mini and DHT22, but I still get

exit status 1
Error compiling for board WeMos D1 R2 & mini.

you need to provide more information if you want help.

1 Like

There is a direct, working example for the DHT11 & WeMos (just an ESP) in the new Example Browser

I use this code and it gives me “‘BlynkTimer’ does not name a type”
https://examples.blynk.cc/?board=WeMos%20D1&shield=ESP8266%20WiFi&example=More%2FDHT11

@zulfiqaradil it normally means you are using old libraries as BlynkTimer was quite a recent introduction.

@Costas I delete all the old libraries and I am still getting “error: ‘BlynkTimer’ does not name a type”
What I need to do to resolve this

Did you use the Arduino IDE to add / remove libraries?

As per the docs, it’s a manual operation to install all the required libraries but as BlynkTimer was introduced into the main Blynk library from 0.4.7 it should work if you have this or newer.

What version appears in Serial Monitor?

@Costas On when you typing last reply I read through again your previous message and I figure it out I was having old Blynk library and now I delete old on and reinstall new one and compiled successfully. Thanks

1 Like

When using DHT11 and DHT22 sensors it might be a good idea to use Arduinos libraries instead of Adafruits to minimize the reading time. Check out the last couple of post in this thread:

1 Like

Here is my output and its look like they have some sudden spikes although it should be stable and also is there any way to change graph time stamps into 12Hrs formats…Currently its showing in 24Hrs format…
Currently I just keep it running as is and I will update here my graph after few hours of readings and also I just observe this ESP8266 some time loose connection and on my same network I hookup another ESP8266 along with its some GPIO connected with my Lights and fans and its working all time solid.

No it’s not.

Interesting.

You need to precisely duplicate the solid system and then add SuperChart, anything else is meaningless because a single line of code that differs between solid and not solid could be the cause.

After one hour of deep test here is my output log and its looks like its not stable you can also observe the spikes in temperature graph at 7:49pm, 8:00pm, 8:25PM, 8:39PM 8:48PM and also on when I set graph in live mode bo0th values get flat at bottom.

@Costas For example if I change the time interval by increasing to update on server I think we can resolve this sudden spikes issue but how can I change the timer.run();

Yes those spikes that typically show a huge 0.5% (not 0.5 degree) increase.
If you run to the pub does it always take you exactly 12m42s?

1 Like