Interfacing PIC18F4550 with DHT22 sensor – CCS C compiler

Interfacing PIC18F4550 microcontroller with DHT22 sensor using CCS PIC C compiler
PIC18F4550 DHT22 sensor hardware circuit

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

PIC18F4550 microcontroller and DHT22(AM2302) sensor circuit + Proteus simulation

Interfacing PIC18F4550 with DHT22(AM2302 – RHT03) sensor circuit:
The following circuit schematic shows complete project circuit.
PIC18F4550 DHT22 sensor circuit
The circuit is simple, there is the microcontroller PIC18F4550, DHT22 sensor and 1602 LCD to display humidity and temperature results.
PIC18F4550 uses its internal oscillator @ 8MHz and mclr pin function is disabled.

Interfacing PIC18F4550 with DH22 (AM2302-RHT03) sensor CCS C code:
The interfacing code is written with CCS PIC C compiler PCWHD 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 PIC18F4550 with DHT22 sensor video:
The following video shows hardware circuit of this project.

Leave a Reply

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