Dht11 - 16f877a


Closed Thread
Results 1 to 15 of 15

Thread: Dht11 - 16f877a

Hybrid View

  1. #1
    Join Date
    Feb 2014
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Re: Dht11 - 16f877a

    I have not done it with PBP, but in another life I did it with PICAXE BASIC.

    After being queried, the DHT11 returns 41 Bits of Data. The first bit is an ACK and can be ignored. The next 16 bits are Humidity bits. ONly the first 8 of these bits are used wth the DHT-11. The next 16 bits are Temperature bits and again only the first 8 are used. The next 8 bits are the checksum.

    First Bit - Ignore or use for interrupt

    Bit 1 - 8 Humidity MSByte
    Bit 9 - 16 Hymidity LSByte (Only used with DHT22 - Ignore - All zeros
    Bit 17 - 24 Temperature MSByte
    Bit 25 - 32 Temperature LSByte (Only used with DHT22 - Ignore - All zeros
    Bit 33 = 40 Checksum - use if desired

    The protocol is such that each bit starts with a 50us low, followed by either a 27us high Pulse or a 70us high pulse,where 27us = "0" nd 70us = "1"

    These pulses can be read with pulsin and then tested with an IF statement to determine if a pulse is a 1 or a 0.


    There is only 50us between bits so the PIC only has 50us to read the bit & determine if a 1 or 0 before the next bit arrives.

    I am not going to write & debug the code for you if that is what you are looking for. However, below is a link to the Picaxe Basic code that may be helpful. You should not need the 555 timer or 74HC221 since PBP it is compiled code and runs much, much faster than Picaxe Basic interpreted code.

    http://www.picaxeforum.co.uk/showthr...ighlight=DHT11

  2. #2
    Join Date
    Mar 2014
    Posts
    6


    Did you find this post helpful? Yes | No

    Unhappy Re: Dht11 - 16f877a

    Quote Originally Posted by cyberroth View Post
    I have not done it with PBP, but in another life I did it with PICAXE BASIC.

    After being queried, the DHT11 returns 41 Bits of Data. The first bit is an ACK and can be ignored. The next 16 bits are Humidity bits. ONly the first 8 of these bits are used wth the DHT-11. The next 16 bits are Temperature bits and again only the first 8 are used. The next 8 bits are the checksum.

    First Bit - Ignore or use for interrupt

    Bit 1 - 8 Humidity MSByte
    Bit 9 - 16 Hymidity LSByte (Only used with DHT22 - Ignore - All zeros
    Bit 17 - 24 Temperature MSByte
    Bit 25 - 32 Temperature LSByte (Only used with DHT22 - Ignore - All zeros
    Bit 33 = 40 Checksum - use if desired

    The protocol is such that each bit starts with a 50us low, followed by either a 27us high Pulse or a 70us high pulse,where 27us = "0" nd 70us = "1"

    These pulses can be read with pulsin and then tested with an IF statement to determine if a pulse is a 1 or a 0.


    There is only 50us between bits so the PIC only has 50us to read the bit & determine if a 1 or 0 before the next bit arrives.

    I am not going to write & debug the code for you if that is what you are looking for. However, below is a link to the Picaxe Basic code that may be helpful. You should not need the 555 timer or 74HC221 since PBP it is compiled code and runs much, much faster than Picaxe Basic interpreted code.

    http://www.picaxeforum.co.uk/showthr...ighlight=DHT11

    Thank you very much, but I have not dealt with picaxe.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Dht11 - 16f877a

    This link explains how these sensors work

    http://ruijc.webnode.com/products/le...sensor-reader/

    Show us your code and doubts so we can help you.

    Regards
    Rui

Similar Threads

  1. DHT11? Code/Schematics?
    By wdmagic in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2013, 10:35
  2. DHT11 Temperature/Humidity sensor
    By mircogomiero in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th January 2013, 13:37
  3. 16F877a - Please Help
    By tarexpanda in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd April 2007, 09:28
  4. 16f877a
    By alaaodeh in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 00:38
  5. I need help with 16F877A
    By valerij in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th December 2006, 18:05

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts