Pro Mini is giving a frequent time out on DTH11 read out


  • Contest Winner

    I received my first Pro Mini's this morning. After carefully soldering the pins. I had a lot of troubles connecting the FTDi to it. But I finally found a good tutorial on Google. Then I made another mistake, I compiled my sketch for the wrong processor frequency, which took me a lot of time before I figured out why I didn't get any good Serial output in my monitor, but finally I was able to upload a sketch and received the correct output in my Serial monitor.

    After all that I have another issue. I hooked up a DTH11 to pin 3 and ran the test sketch. But it's giving me an timeout or checksum error about every 1 out of 10 readings. Is this an Arduino or a power problem? The DHT11 works good on an UNO or a Nano. I've checked that. So I'm guessing that it is some kind of power problem. Do I need to add a pull up resistor or capacitor to the DHT11? And if so what's the circuit? I'm powering from the FTDI.

    Here's a listing from the Serial monitor. I've used the test sketch so the readings are hapening on a 2 second interval.

    Status Humidity (%) Temperature (C)
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    TIMEOUT nan nan
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    TIMEOUT nan nan
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    TIMEOUT nan nan
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    OK 38.0 29.0
    etc.


  • Hardware Contributor

    Try a pullup resistor at the data pin. I have no problems with readings. And make sure to wait long enough, the DHT sensor is very slow.


  • Contest Winner

    I added a 10k pullup between the vcc and the dataline. But I'm still getting the same results, even if I wait 10 seconds between each reading. I timeout or checksum failure every 5 or 6 readings. Could it be possible that my Pro Mini has timing issues? If so how would one check that?

    Update: I just noticed that I posted my question in the wrong forum. it should be in trouble shooting.

    I just hooked up a radio. And the mySensors part seems to be working okay. So I'm calculating the percentage of failed readings and present that is the battery power level. So that I can monito this in Domoticz.

    But I'm still clueless to what is causing this. Maybe a bad badge of DHT11's? Because I tried another that I purchased at the same time. Any help or thoughts are appreciated.


  • Contest Winner

    I've narrowed down the cause of the problem. It has to be the Pro Mini. I just attached the DHT11 to an Arduino Nano. The DHT11 works perfectly on the nano. It doesn't matter if I feed the DHT11 with 3.3V or 5V. I ordered two Pro Mini's. I'll solder the connectors to the other Pro Mini 3.3V tomorrow and see if that one is giving me the same reading failures as the Pro Mini I'm currently using.


  • Contest Winner

    My last guess. I'm not really sure if this is a good or a bad idea. But can I put a 4.7 mu capacitor over the ground en VCC of the DHT11?


  • Admin

    Won't hurt it. 😉


  • Hero Member

    You don't mention the frequency and voltage of your APM. If it's 5V and 16 MHz and multiple APMs fail the same way, then I'm at a loss. If it's lower voltage that could affect the DHT-11; and I suppose that 8 MHz could affect timing.

    I'm trying to imagine what could be different to allow your Nano to work.

    Nano's typically run at 5v/16 MHz even tho they have an additional 3.3v supply on board. And the 3.3v supplies from a Nano and a 3.3v APM could differ - perhaps the DHT-11 is marginal and small differences in voltage make a difference.


  • Contest Winner

    @Zeph I think you're spot on. It's a 3.3V 8Mhz Pro Mini. Could the frequency cause this problem? I tried a lot of different things. Adding a pullup, adding a capacitor.
    The 3.3V shouldn't be the problem, because the minimum voltage of a DHT11 is rated as 2.7V. I measured the vcc output of the Arduino and my meter is giving me a 3.3V reading.


  • Hero Member

    I would not think that the speed SHOULD make a difference. Since you can download programs, and and print to Serial at the expected baud rate, the appropriate seed info should be in the defines.

    Have other people here had success with the DHT-11 on a APM at 3.3v/8MHz?

    Given that I don't yet know where else to look, if I were you, I might try a quick standalone program that just prints the temperature & humidty to Serial every little while using the standard library, then try another library (I believe there are several). If some library does work well, that would give us a clue. If all libraries have the same problem, then, well, we can go from there.

    Have you tried more than one DHT-11? Just in case it is in some way marginal.



  • I run two ProMinis with a DHT22 on 8MHz. I experienced issues when setting the frequency by software lower than 8 MHz. After having initial some troubles I used the library http://arduino.cc/playground/Main/DHTLib which works reliable now for me.


  • Contest Winner

    @tomkxy thank you very much. I really feel stupid that I didn't think of that mysef.

    After first testing the old DHT11 library, I got a lot less errors. But the new one is perfect for 8Mhz Arduino's results are looking great so far. 0 errors. I'm going to hook it up to a battery and let it run for the night. I'm logging the amount of errors as a battery % to Domoticz. That way I can check if the readings are okay. I'll let you know what the outcome is tomorrow. Thank you again!

    I had to change to original humidity sketch a bit so that it can use the other new library. When I have time I'll refactor the library from your url so that it can run besides the DHT library that is part of MySensors. If someone is interested I'll post the Sketches and the refactored library.


  • Contest Winner

    The library which @tomkxy posted works great for 8mhz processors. I have let it run for more than 24 hours without receiving a single timeout or checksum failure.


Log in to reply
 

Suggested Topics

  • 87
  • 3
  • 5
  • 7
  • 5
  • 6

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts