1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

DHT11 and oshonsoft PIC code

Discussion in 'Oshonsoft' started by ivsto, Jan 9, 2013.

  1. ivsto

    ivsto New Member

    Joined:
    Jan 22, 2012
    Messages:
    4
    Likes:
    0
    Hi everybody,
    do You have some experience with DHT-11 ?

    Thank you in advance!!

    Ivan
     
  2. ivsto

    ivsto New Member

    Joined:
    Jan 22, 2012
    Messages:
    4
    Likes:
    0
    • Informative Informative x 1
  3. Superdat

    Superdat Member

    Joined:
    Mar 3, 2015
    Messages:
    122
    Likes:
    5
    Hi
    I've just (as in today) managed to get a dht22 to work. Not having a mobile phone, I can't get a Yahoo account to check the link above. I used Oshonsoft AVR IDE with Attiny44. Unlike some ppl I wasn't aware of any errors in the datasheet. Most problems were down to me, although some of the restrictions of Oshonsoft Basic caused me a few headaches. I have 2 versions now, one to lcd showing RH, temp and dew point. The other to 8 x 7 segment led via max7219 showing temp and dew point. Negative dew point could be handled better, I haven't got this quite right.
    If anyone is interested in my method just ask.

    The rest of this thread has been moved, if you want code for DHT22 for Oshonsoft IDE AVR/PIC
    see post #7 on the link below.

    http://www.electro-tech-online.com/threads/dht11-and-pic-code.145245/#post-1227059

    Real World Feedback 16/9/2015
    Now that the nights are getting darker I've started preparing for some astrophotography.
    The 1st night was about 15C and I thought the dew point shown was a bit low @ about -7C
    2nd night it started of OK about 17C dp 8C then as the temperature dropped it suddenly became -7C.
    Checked the code today the problem lies in the adjustment for negative dew point with a positive air temperature. I got the values for these from an online calculator which must use a different formula to the one I used.
    I put the formula used in code into a spread sheet and sure enough the same errors occurred.

    The following fixed it.
    If humin > 50 And tempin < 10 Then hsign = 0x01
    If humin > 60 And tempin < 7 Then hsign = 0x01
    If humin > 70 And tempin < 5 Then hsign = 0x01
    If humin > 80 And tempin < 3 Then hsign = 0x01
    If humin > 90 And tempin < 1 Then hsign = 0x01

    If you want more accuracy than this, put the formula Td = T - ((100 - RH)/5.) into a spread sheet then alter the temperature (t) and Humidity (RH) to find the negative dew point for
    humidity/temp combinations.
     
    Last edited: Sep 16, 2015

Share This Page