TOP Contributors

  1. MIKROE (2660 codes)
  2. Alcides Ramos (356 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 (137010 times)
  2. FAT32 Library (70134 times)
  3. Network Ethernet Library (56028 times)
  4. USB Device Library (46352 times)
  5. Network WiFi Library (41966 times)
  6. FT800 Library (41291 times)
  7. GSM click (29055 times)
  8. mikroSDK (26489 times)
  9. PID Library (26452 times)
  10. microSD click (25413 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: 1890 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

MIC 3 click

0

The MIC 3 Click is a Click board™ that features the SSM2167-1RMZ-R7, a Microphone Preamplifier, from Analog Device. This Click board™ is a low voltage Microphone preamplifier with Variable compression and noise gating.

[Learn More]

USB to I2C 2 click

0

USB to I2C 2 Click is a compact add-on board that contains a general-purpose USB to I2C serial interface. This board features the FT201X, a full-speed USB to I2C protocol converter from FTDI. The FT201X converts USB2.0 full-speed to an I2C serial interface capable of operating up to 3.4MBit/s, with low power consumption (typical 8mA). The entire USB protocol is handled on the chip itself, where no USB-specific firmware programming is required. It also has a fully-integrated 2048 byte Multi-Time-Programmable (MTP) memory for storing device descriptors and CBUS I/O user-desirable configuration. This Click board™ includes the complete FT-X series feature set and enables USB to be added into a system design quickly and easily over an I2C interface.

[Learn More]

UART Mux click

0

The UART Mux click is a Click board™ that switches the UART pins (RX and TX) from the mikroBUS™ to one of the four available outputs.

[Learn More]