Interfacing PIC16F84A with DHT22 sensor – CCS C

Interfacing PIC16F84A microcontroller with DHT22(AM2302 – RHT03) relative humidity and temperature sensor

This topic shows how to interface PIC16F84A microcontroller with DHT22 sensor with hardware circuit.
Related topic:
The following topic shows PIC16F84A microcontroller and DHT22 Proteus simulation and some details about this sensor.
PIC16F84A + DHT22(AM2302, RHT03) sensor Proteus simulation

Interfacing PIC16F84A with DHT22 circuit:
The following image shows project circuit schematic.
PIC16F84A DHT22 AM2302 sensor interfacing circuit
The PIC16F84A needs 5V supply between VDD and VSS.

Interfacing PIC16F84A with DHT22 (AM2302-RHT03) humidity and temperature sensor CCS PIC C compiler 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 PIC16F84A with DHT22 sensor video: 
The following video shows hardware circuit of this project.

One comment

  1. Hello.
    Would it be possible to have the .hex file to inject into the pic?
    Thank you.

    Il serait possible d’avoir le fichier .hex à injecter dans le pic ?

Leave a Reply

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