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: 2020-07-24
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Gas
Downloaded: 2261 times
Not followed.
License: MIT license
Ammonia click is an Ammonia detection (NH3) sensor, based on the MQ-137 gas sensor. This gas sensor has a sensitive layer made of SnO2, which changes its resistance when exposed to ammonia. The sensor is able to sense NH3 concentration in the range of 5 ppm to 200 ppm.
Do you want to subscribe in order to receive notifications regarding "Ammonia click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Ammonia click" changes.
Do you want to report abuse regarding "Ammonia click".
Library Description
The library covers all the necessary functions to control Ammonia click board. User can, turn heater on or off and read ADC value.
Key functions:
void ammonia_heater ( uint8_t state );
- Function is used to turn the heater on or off.uint32_t ammonia_data_read ( );
- Function is used to read ADC value.uint32_t ammonia_adc_read( );
- Function reads ADC values.Examples description
The application is composed of three sections :
void application_task ( )
{
if ( interface_sel == AMMONIA_INTF_SPI )
{
spi_value = ammonia_data_read( );
LongWordToStr( spi_value, log_txt );
Ltrim( log_txt );
mikrobus_logWrite( "ADC value: ", _LOG_TEXT );
mikrobus_logWrite( log_txt, _LOG_LINE );
}
else
{
adc_value = ammonia_adc_read( );
WordToStr( adc_value, log_txt );
Ltrim( log_txt );
mikrobus_logWrite( "ADC value: ", _LOG_TEXT );
mikrobus_logWrite( log_txt, _LOG_LINE );
}
mikrobus_logWrite( "--------------------", _LOG_LINE );
Delay_ms( 1000 );
}
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.