dht222
2.0.0.0
|
DHT22 2 click is used for measuring the environmental temperature and relative humidity. It uses the CM2322 sensor, with very accurate thermal and humidity measuring capabilities. It can use either 1-Wire or I2C protocol to communicate with the integrated circuit.
We provide a library for the Dht222 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Dht222 Click driver.
void dht222_cfg_setup ( dht222_cfg_t *cfg );
DHT222_RETVAL dht222_init ( dht222_t *ctx, dht222_cfg_t *cfg );
uint16_t dht222_get_temperature ( dht222_t *ctx );
uint16_t dht222_get_humidity ( dht222_t *ctx );
uint16_t dht222_read_data ( dht222_t *ctx, uint8_t address );
DHT22 2 click is used for measuring the environmental temperature and relative humidity. The calibration coefficient is saved in the OTP memory of an integrated MCU. The integrated MCU also provides I2C or 1-Wire interface, selectable by the onboard SMD jumper selectors. The operating voltage can also be selected by the onboard SMD jumper.
The demo application is composed of two sections :
Initialization driver enable's - I2C and start write log.
This is a example which demonstrates the use of DHT22 2 Click board. DHT22 2 Click communicates with register via I2C protocol read data from register, measured temperature and humidity data from the AM2322 sensor. Convert temperature data to degrees Celsius [ �C ] and humidity data to percentarg [ % ]. Results are being sent to the Usart Terminal where you can track their changes. All data logs on usb uart for aproximetly every 5 sec.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.