TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136887 times)
  2. FAT32 Library (70018 times)
  3. Network Ethernet Library (56002 times)
  4. USB Device Library (46308 times)
  5. Network WiFi Library (41933 times)
  6. FT800 Library (41208 times)
  7. GSM click (29017 times)
  8. PID Library (26429 times)
  9. mikroSDK (26398 times)
  10. microSD click (25386 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

Alcohol 3 click

Rating:

5

Author: MIKROE

Last Updated: 2019-01-29

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Gas

Downloaded: 3118 times

Not followed.

License: MIT license  

Alcohol 3 click is a gas sensor Click board, equipped with the MiCS-5524, a compact metal oxide (MOS) sensor. This sensor reacts to the presence of deoxidizing and reducing gases, such as ethanol (also known as alcohol).

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Alcohol 3 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Alcohol 3 click" changes.

Do you want to report abuse regarding "Alcohol 3 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

Alcohol 3 click

Alcohol 3 click

Native view of the Alcohol 3 click board.

View full image
Alcohol 3 click

Alcohol 3 click

Front and back view of the Alcohol 3 click board.

View full image

Library Description

The library initializes and defines the I2C bus driver and drivers that offer a choice for reads adc data from I2C. The library includes function for reads CO data in the AIR (in ppm and mg/L), function for reads Ethanol data in ppm and reads the percentage of alcohol in the blood (BAC).

Key functions:

  • float alcohol3_getPercentageBAC() - Function for read percentage of alcohol in the blood (BAC).
  • uint16_t alcohol3_ethanolInPPM() - Function for read Ethanol (C2H5OH) data in ppm.
  • uint16_t alcohol3_getCOinPPM() - Function for read CO (Carbon monoxide) data in ppm.

Examples description

The application is composed of the three sections :

  • System Initialization - Initializes I2C module.
  • Application Initialization - Initialization driver init.
  • Application Task - (code snippet) - Reads percentage of alcohol in the blood (BAC) and this data logs to USBUART every 1 sec.
void applicationTask()
{
    uint16_t CO_ppm;
    uint16_t pBAC;
    char demoText[ 50 ];

    mikrobus_logWrite(" --- Alcohol diagnostics ----", _LOG_LINE);
        
    CO_ppm = alcohol3_getCOinPPM();
    WordToStr(CO_ppm, demoText);
    mikrobus_logWrite(" CO in ppm      | ", _LOG_TEXT);
    mikrobus_logWrite(demoText, _LOG_LINE);
    
    pBAC = alcohol3_getPercentageBAC() * 1000;
    WordToStr(pBAC, demoText);
    if( 10 > pBAC && pBAC < 100 )
    {
        mikrobus_logWrite(" BAC            | 0.00", _LOG_TEXT);
        LTrim(demoText);
        mikrobus_logWrite(demoText, _LOG_LINE);
    }
    else if(100 <= pBAC && 1000 > pBAC)
    {
        mikrobus_logWrite(" BAC            | 0.0", _LOG_TEXT);
        LTrim(demoText);
        mikrobus_logWrite(demoText, _LOG_LINE);
    }
    else if ( pBAC >= 1000)
    {
        mikrobus_logWrite(" BAC            | 0.", _LOG_TEXT);
        LTrim(demoText);
        mikrobus_logWrite(demoText, _LOG_LINE);
    }
    else
    {
        mikrobus_logWrite(" BAC            | 0.0000", _LOG_LINE);
    }
    mikrobus_logWrite(" ----------------------------", _LOG_LINE);
    mikrobus_logWrite( " " , _LOG_LINE);
    Delay_ms( 1000 );
}

Other mikroE Libraries used in the example:

  • I2C
  • Conversions
  • UART

Additional notes and informations

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

DC Motor 4 click

0

This library contains API for DcMotor4 Click driver.

[Learn More]

MIC23099 click

0

MIC23099 click represent single AA/AAA cell step-down/step-up regulator with battery monitoring.

[Learn More]

Hall Switch 2 click

0

Hall Switch 2 Click is a compact add-on board that represents a magnetic field-activated dual-relay Click board™. This board features the MHA100KN, a high-performance, low-power Hall-Effect sensor from MEMSIC.

[Learn More]