We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2018-06-28
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Gas
Downloaded: 5178 times
Not followed.
License: MIT license
Air quality 5 click is a triple MOS sensor on a single Click board, which can detect gas pollution for a number of different gases. The onboard sensor is specially designed to detect the pollution from automobile exhausts as well as the gas pollution from the industrial or agricultural industry.
Do you want to subscribe in order to receive notifications regarding "Air quality 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Air quality 5 click" changes.
Do you want to report abuse regarding "Air quality 5 click".
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for writing data in registers and reading data from registers. The library includes functions for full initialization of the chip, reading 3 sensors (CO, NH3 and NO2 data). The user can check the state of the RDY pin indicating if that data is ready for reading.
Key functions:
void airq5_setConfiguration(uint16_t config)
- The functions for configuration.uint16_t airq5_readSensorData(uint16_t channel_data)
- The functions for reading the sensor data.Example description
The application is composed of three sections:
void applicationTask() { NO2_sensorData = airq5_readSensorData(_AIRQ5_DATA_CHANNEL_NO2); NH3_sensorData = airq5_readSensorData(_AIRQ5_DATA_CHANNEL_NH3); CO_sensorData = airq5_readSensorData(_AIRQ5_DATA_CHANNEL_CO); IntToStr(NO2_sensorData, dataText); mikrobus_logWrite(" NO2 data: ", _LOG_TEXT); mikrobus_logWrite(dataText, _LOG_LINE); IntToStr(NH3_sensorData, dataText); mikrobus_logWrite(" NH3 data: ", _LOG_TEXT); mikrobus_logWrite(dataText, _LOG_LINE); IntToStr(CO_sensorData, dataText); mikrobus_logWrite(" CO data: ", _LOG_TEXT); mikrobus_logWrite(dataText, _LOG_LINE); mikrobus_logWrite(" -------- ", _LOG_LINE); Delay_ms( 500 ); }
Other MikroElektronika libraries used in the example:
Additional notes and information
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.