Tableau de clic Alcohol 3
Tableau de clic Alcohol 3
Overview
L' Alcohol 3 Click Board™ est un capteur de gaz équipé du MiCS-5524, un capteur compact à oxyde métallique (MOS). Ce capteur réagit à la présence de gaz désoxydants et réducteurs, tels que l'éthanol (également appelé alcool). Son impédance change à la suite d'une réaction catalytique, ce qui lui permet d'être utilisé dans une configuration de diviseur de tension. Cette tension peut être échantillonnée par un convertisseur A/N (ADC) précis, ce qui permet de lire les données directement sur l'interface I2C.
Le capteur MiCS-5524 lui-même est un capteur robuste, qui peut être utilisé dans des environnements difficiles pour la détection des fuites de gaz, dans les applications de contrôle de l'haleine, la détection précoce des incendies, etc.
The Alcohol 3 Click Board™ contains the required resistances used to form a voltage divider with the sensor, as well as the accurate SAR type ADC with a 12-bit resolution which allows the voltage to be converted, using 5V from the mikroBUS™ rail as a voltage reference. Featuring the MiCS-5524, a robust and reliable gas sensor that requires a minimal number of additional components, the MCP3221, an accurate 12-bit ADC by Microchip, proven in many Click board™ designs so far, Alcohol 3 click represents an ideal solution for the rapid development of all kinds of breathalyzer applications, gas leakage applications, fire detection applications, CO detectors, and similar reducing gasses detecting applications.
How Does The Alcohol 3 Click Board™ Work?
The Alcohol 3 Click Board™ is equipped with the MiCS-5524 sensor, a compact MOS sensor from SGX Sensortech. This sensor consists of a micromachined metal oxide semiconductor diaphragm, with an integrated heating resistor. The resistor produces heat which catalyzes the reaction, which in turn affects the electrical resistance of the oxide layer itself. The temperature of the heater is quite high: it is in the range from 350 °C to 550 °C. After the initial preheating period, the sensor can detect gas changes in time intervals below two seconds.
The resistance of the MiCS-5524 sensor does not change linearly with the gas concentration, so a proper calibration must be performed prior to using it for absolute gas concentration measurement applications. The impedance changes the most when used with low gas concentrations. As the atmosphere gets saturated with gas, the impedance changes slower. This should be taken into an account, especially when developing applications for estimating blood alcohol content (BAC) from a breath sample (also known as breathalyzers).
The MiCS-5524 sensor is a simple device: it has only four connections. Two pins are the connections of the internal heating element, while the other two pins are the MOS sensor connections. The application is reduced to calculating a proper resistor for the voltage divider. The datasheet of the MiCS-5524 sensor offers typical values for its resistance when used in clean air (artificial conditions). The sensitivity is then expressed as the ratio between the resistance of the sensor in clean air and resistance at a concentration of 60 ppm CO.
The middle tap between the sensor (as a resistor) and the fixed resistance is used to provide an output voltage. It directly depends on the resistance of the sensor, allowing it to be used as the input into the MCP3221, a low-power 12-bit A/D converter with an I2C interface, from Microchip. This ADC allows the output voltage to be translated into digital information, which can be accessed over the I2C pins on the mikroBUS™ socket. By using the power supply voltage as the voltage reference for the conversion, this ADC further reduces the complexity of the design, still offering a good conversion quality, thanks to its low noise input. Due to the sensor's inert nature, this ADC is more than fast enough, although it can provide up to 22.3 Ksps when operated in the I2C Fast mode.
The I2C communication voltage level can be adjusted so that the Click board™ can be used with both 3.3V and 5V MCUs. The provided SMD jumper labelled as VCC SEL can be used to select the desired voltage level. However, the Click board™ requires +5V for a proper operation, regardless of the logic voltage level selection jumper.
Specifications
Type | Alcohol,Gas |
Applications | It can be used for various alcohol breath tester applications, early fire and gas leakage warning applications, VOC concentration warning applications, and similar |
On-board modules | MiCS-5524 sensor, a compact MOS sensor from SGX Sensortech; MCP3221, a low-power 12-bit A/D converter with I2C interface, from Microchip |
Key Features | Robust and reliable MOS sensor, a high-quality 12-bit ADC from Microchip onboard, can detect a range of different redux gasses, ideal for a breathalyzer application development, etc |
Interface | I2C |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Input Voltage | 3.3V or 5V |
Pinout Diagram
This table shows how the pinout on the Alcohol 3 Click Board™ corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes | Pin | Pin | Notes | ||||
---|---|---|---|---|---|---|---|
NC | 1 | AN | PWM | 16 | NC | ||
NC | 2 | RST | INT | 15 | NC | ||
NC | 3 | CS | RX | 14 | NC | ||
NC | 4 | SCK | TX | 13 | NC | ||
NC | 5 | MISO | SCL | 12 | SCL | I2C Clock | |
NC | 6 | MOSI | SDA | 11 | SDA | I2C Data | |
Power Supply | +3V3 | 7 | 3.3V | 5V | 10 | +5V | Power Supply |
Ground | GND | 8 | GND | GND | 9 | GND | Ground |
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED indicator |
JP1 | VCC SEL | Left | Power supply voltage selection |
Software Support
We provide a library for the Alcohol 3 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for reading ADC data from I2C. The library includes a function for reading CO data in the AIR (in ppm and mg/L), a function for reading Ethanol data in ppm and reading the percentage of alcohol in the blood (BAC).
Key Functions
float alcohol3_getPercentageBAC()
- Function for reading the percentage of alcohol in the blood (BAC).uint16_t alcohol3_ethanolInPPM()
- Function for reading Ethanol (C2H5OH) data in ppm.uint16_t alcohol3_getCOinPPM()
- Function for reading CO (Carbon monoxide) data in ppm.
Example Description
The application is composed of three sections :
- System Initialization - Initializes the I2C module.
- Application Initialization - Initialization driver init.
- Application Task - (code snippet) - Reads percentage of alcohol in the blood (BAC) and this data logs to USB-UART 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 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
Conversions
UART
Additional Notes and Information
Depending on the development board you are using, you may need a 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.
Software Support
We provide a library for the Alcohol 3 Click Board™ on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library initializes and defines the I2C bus driver and drivers that offer a choice for reading ADC data from I2C. The library includes a function for reading CO data in the AIR (in ppm and mg/L), a function for reading Ethanol data in ppm and reading the percentage of alcohol in the blood (BAC).
Key Functions
float alcohol3_getPercentageBAC()
- Function for reading the percentage of alcohol in the blood (BAC).uint16_t alcohol3_ethanolInPPM()
- Function for reading Ethanol (C2H5OH) data in ppm.uint16_t alcohol3_getCOinPPM()
- Function for reading CO (Carbon monoxide) data in ppm.
Example Description
The application is composed of three sections :
- System Initialization - Initializes the I2C module.
- Application Initialization - Initialization driver init.
- Application Task - (code snippet) - Reads percentage of alcohol in the blood (BAC) and this data logs to USB-UART 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 ); }
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
I2C
Conversions
UART
Additional Notes and Information
Depending on the development board you are using, you may need a 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.
Frequently Asked Questions
Have a Question?
Be the first to ask a question about this.