TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136553 times)
  2. FAT32 Library (69756 times)
  3. Network Ethernet Library (55855 times)
  4. USB Device Library (46195 times)
  5. Network WiFi Library (41815 times)
  6. FT800 Library (41009 times)
  7. GSM click (28931 times)
  8. PID Library (26386 times)
  9. mikroSDK (26296 times)
  10. microSD click (25304 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Ammonia click

Rating:

5

Author: MIKROE

Last Updated: 2020-07-24

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Gas

Downloaded: 1837 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Ammonia click

Ammonia click

Native view of the Ammonia click board.

View full image
Ammonia click

Ammonia click

Front and back view of the Ammonia click board.

View full image

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 :

  • System Initialization - Initializes SPI module, LOG structure, sets CS and PWM pins as output and MISO and AN pins as input.
  • Application Initialization - Initalizes SPI or ADC driver, turns on the heater, and makes an initial log.
  • Application Task - (code snippet) This is an example that shows the capabilities of the ADC 9 click by reading ADC value and displaying it via UART.
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:

  • I2C
  • ADC
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

TempHum 18 click

0

Temp&Hum 18 Click is a compact add-on board that represents temperature and humidity sensing solutions. This board features the HS3003, a highly accurate, fully calibrated relative humidity and temperature sensor from Renesas. It features proprietary sensor-level protection, ensuring high reliability and long-term stability. Integrated calibration and temperature-compensation logic provides fully corrected RH and temperature values via standard I2C output. No user calibration of the output data is required. The high accuracy, fast measurement response time, and long-term stability make this Click board™ ideal for various temperature and humidity-related applications and a vast number of applications ranging from portable devices to products designed for harsh environments.

[Learn More]

eFuse 2 click

5

eFuse 2 Click is a compact add-on board that contains an integrated FET hot-swap device. This board features the TPS259631, a highly integrated circuit protection and power management solution from Texas Instruments.

[Learn More]

Gyro 2 click

0

The Gyro 2 click is a three-axis digital angular rate sensor which can sense the angular movement and velocity in three perpendicular axes.

[Learn More]