Ashok Ra

LPCXpresso804 - Sensor Demo

Discussion created by Ashok Ra on Jul 22, 2018

This is a quick demo tutorial about interfacing DHT22 with LPC804.

The LPC804 are an ArmCortex-M0+ based, low-cost 32-bit MCU family operating at CPU frequencies of up to 15 MHz. The LPC804 supports 32 KB of flash memory and 4 KB of SRAM.
I have used the LPCXpresso804 development kit here .
The IoT adapter board is handmade one , it has esp8266 module interface to send the data to cloud.
LPC side PIN P0_13 is used for 1wire interface with DHT
               PIN P0_8 and P0_9 is used for UART Debug interface
DHT22 data line is pulled up with 10k resistor. when we want to read the data from DHT22 , the LPC pulls the data low for 18ms then poll the pin for acknowledge (Pin as Input) The DHT responds with Low for nearly 40us. After that sampling the data at right interval receives all 5 bytes. The last byte contains the checksum which is addition of other 4 bytes.
Byte0 - Humidity HIGH byte
Byte1 - Humidity LOW byte
Byte2 - Temperature HIGH byte
Byte3 - Temperature LOW byte
Division by 10 will give proper data with one decimal point. (example 27.8 C)
after processing the data will be send to PC via serial debug interface.
The working demo is here Watch Now