TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139067 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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: 3496 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

Stepper Click

0

Stepper Click is a complete solution for driving bipolar stepper motors with full/half and micro-steps. It features the A3967 IC from Allegro Microsystems with proprietary Satlingtonā„¢ sink drivers on its outputs, which ensure high efficiency and reliable operation of the internal H-Bridges. This IC has the integrated translation section, used to simplify the control: using simple step control inputs from the host MCU, the stepper motor can be driven in both directions, with the predetermined step sizes. In addition, the output current is regulated allowing for noiseless operation of the stepper motor, with no resonance and ringing typically observed at unregulated stepper driver designs.

[Learn More]

RTC 3 Click

0

RTC3 Click carries BQ32000, a real time clock with an integrated trickle charge circuit for automatic switchover to a backup power supply (the circuit maintains the backup charge with an onboard super capacitor).

[Learn More]

MCP2003B Click library

3

MCP2003B click is a mikroBUS add-on board with a bi-directional LIN transceiver. The click has three onboard screw terminals for connecting the transceiver to a LIN network (three wires: LIN, VBB and GND). MCP2003B click communicates with the target board MCU through the mikroBUS UART interface (RXD, TXD).

[Learn More]