This is a summary of the operations that are done to use the DHT11. The DHT11 uses a single wire for transmitting and receiving data. This bus requires an external pull-up resistor of about 5kOhms to operate. All writing of bits over this bus is done by changing the DDR bit, not the PORT bit. To send a 0, make the DDR bit an 1 to make it an output and make the PORT bit is 0. This will put a 0 on the bus. To send a 1, make the DDR bit a 0 to make it an input and make the PORT bit a 0. This will cause the bus to float and the pull-up will make it a 1. To let the DHT11 control the bus for reading data from it, make the DDR and PORT bits both 0. The PORT bit can be made 0 at the start and doesn't have to be changed after that. Just change the DDR bit to send 0's or 1's, and make DDR a 0 when reading. To start the measurement, the microcontroller sends a low pulse and then waits for the DHT11 to respond with a low pulse. Make the bus zero and wait 18ms Make the bus one and wait 30us Now enter a loop reading the bus state. Stay in it as long as the bus is a 1. Once the bus becomes a 0, leave that loop and enter another loop reading the bus state and stay in it until the bus becomes a 1 again. When that happens exit the loop. The device will now start sending a stream of 40 bits (5 bytes). The bits arrive MSB first for each byte. For each bit do the following: 1. Enter a loop reading the bus state and stay as long as the bus is a 1. 2. Once the bus is a 0, enter a loop reading the bus state and stay as long as the bus is a 0. 3. Delay 50us and then read the value of the bus. 4. If the bus is a 1, the bit is 1. If the bus is a 0, the bit is 0. 5. Store the bit value somewhere and repeat this for each of the 40 bits. Read five bytes of data (40 bits) from the device. Byte 1: Humidity high byte (bits 15:8) Byte 2: Humidity low byte (bits 7:0) Byte 3: Temperature integer value Byte 4: Temperature fractional value (0 to 9) Byte 5: Checksum The temperature in degrees Celcius is returned in the 3rd and 4th bytes. The 3rd byte is the integer part, and bits 3:0 in the 4th byte is the single digit to the right of the decimal point. For example, a temperature of 27.5C bytes 3 and 4 would by 0x1B, 0x05. The humidity is returned in the 1st and 2nd bytes as a 16-bit integer representing the humidity percentage times 10. The 1st byte contains the most significant 8 bits, the 2nd byte contains the least significant bits. For example a humidity of 83.7% would be represented as 837 base 10 = 0x0345. So bytes 1 and 2 would contain 0x03 and 0x45.