Frustrated UDOO - DHT22

Discussion in 'Troubleshooting' started by ariadrianto, Feb 27, 2014.

  1. ariadrianto

    ariadrianto New Member

    Joined:
    Feb 22, 2014
    Messages:
    4
    Likes Received:
    0
    My UDOO spec :
    1. UDOO Dual
    2. 8 gb MicroSD
    3. Ubuntu 12.04
    4. Compile from other PC
    5. DHT22

    I've test this DHT22 with Arduino Mega and It works smoothly. Showing humidity and temperature.
    This is example code just copy and paste :
    #include "DHT.h"
    DHT dht;

    void setup()
    {
    Serial.begin(9600);
    Serial.println();
    Serial.println("Status\tHumidity (%)\tTemperature (C)\t(F)");

    dht.setup(2); // data pin 2
    }

    void loop()
    {
    delay(dht.getMinimumSamplingPeriod());

    float humidity = dht.getHumidity();
    float temperature = dht.getTemperature();

    Serial.print(dht.getStatusString());
    Serial.print("\t");
    Serial.print(humidity, 1);
    Serial.print("\t\t");
    Serial.print(temperature, 1);
    Serial.print("\t\t");
    Serial.println(dht.toFahrenheit(temperature), 1);
    }


    and then I put this DHT22 on UDOO port. Same code, same DHT22. But the result is always showing "nan".
    I really frustrated using UDOO.
    Please help me, is there something I missed ?
     

    Attached Files:

  2. delba

    delba Administrator Staff Member

    Joined:
    May 8, 2013
    Messages:
    1,063
    Likes Received:
    9
  3. dantavious

    dantavious New Member

    Joined:
    Nov 29, 2013
    Messages:
    32
    Likes Received:
    0
    Hi,
    The good news is the DHT22 works great with UDOO. I have it working where it is providing TEMP and HUMIDITY for my bedroom and communicating that data real time to a web interface via NODE.JS. As I have seen different libraries for the DHT22, I am not sure which one you are using. I will be able to provide additional data once I am at home. But it does work.
     
  4. mkopack

    mkopack Member

    Joined:
    Jun 14, 2013
    Messages:
    451
    Likes Received:
    21
    ariadrianto: Remember that the Udoo is 3.3V on the pins, Arduino Mega is 5V. Make sure you're providing the proper V-in to the DHT22 and that it's set up for 3.3V data IO.
     
  5. alexisj

    alexisj New Member

    Joined:
    Aug 26, 2013
    Messages:
    10
    Likes Received:
    0
    Dantavious, can you share with us how you setup that? It's sound great!
     
  6. berta17

    berta17 New Member

    Joined:
    Jan 18, 2015
    Messages:
    6
    Likes Received:
    0
    I have the same problem, I've tried different libraries but with no sucess.
    Has anyone found a library that works properly?
    Dantavious?
     
  7. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi berta17,
    first of all follow the mkopack's suggestion:
    If you're not experienced with wiring, here is a simple guide to solve your problem: http://udoo.org/tutorial/arduino-shields-with-udoo/
    If your problem regards the communication with the server instead, I hope Dantavious is going to share his solution, 'cause it will be surely helpful for the other users.
     
  8. berta17

    berta17 New Member

    Joined:
    Jan 18, 2015
    Messages:
    6
    Likes Received:
    0
    Hi Andrea, the datasheet says that power supply can be 3.3-5.5V so i think the problem is in the libraries.
    I'm quite a beginner but I'll share the solution if I can find it
     
  9. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there berta17,
    I was talking about UDOO I/O pins.
    According to the datasheet that you can find on the page about UDOO Dual/Quad (http://udoo.org/udoo-dual-and-quad/) the standard power supply is 12v.
    Regarding UDOO I/O pins: are 3.3V only compliant. Providing shields with higher voltage, like 5V, could damage the board. Use only shields Arduino DUE compatible (3.3V). Otherwise, just do a bit of wiring (http://udoo.org/tutorial/arduino-shields-with-udoo/).
     
  10. berta17

    berta17 New Member

    Joined:
    Jan 18, 2015
    Messages:
    6
    Likes Received:
    0
    ok, I supply the sensor with 3.3V so it shouldn't be the problem.
    Thank you again for the support
     
  11. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Your welcome!
     

Share This Page