Interfacing PIC16F877A with DHT22 sensor using CCS C

Interfacing PIC16F877A with DHT22(AM2302-RHT03) digital humidity and temperature sensor
PIC16F877A DHT22 sensor hardware circuit

This topic shows how to interface PIC16F877A microcontroller with DHT22 sensor with hardware circuit.
Related topic:
The following topic shows PIC16F877A microcontroller and DHT22 Proteus simulation and some details about this sensor.

PIC16F877A and DHT22(AM2302, RHT03) sensor Proteus simulation

Interfacing PIC16F877A with DHT22(AM2302, RHT03) sensor circuit:
The following circuit schematic shows complete project circuit.
PIC16F877A DHT22 sensor circuit
The PIC16F877A needs +5V supply voltage between its VDD and VSS pins.
The circuit is simple, there is the microcontroller PIC16F877A, DHT22 sensor and 1602 LCD to display humidity and temperature results.

Interfacing PIC16F877A with DHT22(AM2302, RHT03) sensor CCS C code:
The interfacing code was tested with CCS C compiler version 5.051.
If you want to understand the code please read the DHT22 datasheet.
Variables Time_out and k are used to test reading time to avoid wrong data reception or microcontroller hanging.

Interfacing PIC16F877A with DHT22 sensor video:
The following video shows hardware circuit of this project.

One comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.