Upgrade your safety measures with highly accurate and reliable ethanol gas detection solution
A
A
Hardware Overview
How does it work?
Alcohol 2 Click is based on the 3SP-Ethanol-1000 from SPEC Sensors, which can sense ethanol concentration up to 1000ppm. The sensor has a very short response time; however, the longer it is exposed to a particular gas, the more accurate data it can provide. This is especially true when calibration is performed. The sensor is sensitive to small dust particles, condensed water, and other impurities, which might prevent gas from reaching the sensor. It is advised to protect the sensor when used in critical applications. In ideal conditions, the lifetime of this sensor is indefinite, but in real-life applications, the expected operating life is more than five years (10 years at 23 ± 3 ˚C; 40 ± 10 %RH). Although very reliable and accurate, this sensor is great for building relative gas sensing applications. For example, it can detect increased levels of ethanol gas. However, when developing applications for the absolute gas concentration, the sensor must be calibrated, and the measurement data needs to be compensated. Factors such as humidity and temperature can affect measurements; the sensor reaction curve to a specific measured gas (ethanol in this case) is not completely linear, and other gases might affect the measurement (cross-sensitivity to other gases). For this reason, a range of calibration routines must be done in the working environment conditions to calculate the absolute
gas concentration. Alcohol 2 click uses the LMP91000, a configurable AFE potentiostat IC for low-power chemical sensing applications, from Texas Instruments. It provides the complete sensor solution, generating the output voltage proportional to the sensor current. A trans-impedance amplifier (TIA) with a programmable gain is used to convert the current through the sensor, covering the range from 5μA to 750 μA, depending on the used sensor. The voltage between the referent electrode (RE) and the working electrode (WE) is held constant, with the bias set by the variable bias circuitry. This type of sensor performs best when a fixed bias voltage is applied. The sensor manufacturer recommends a +100mV fixed bias for the sensor on this Click board™. The bias voltage and the TIA gain can be set via the I2C registers. In addition, an embedded thermal sensor in the AFE IC can be used for the result compensation if needed. It is available via the VOUT pin as the analog voltage value with respect to GND. The Click board™ has two additional ICs onboard. The first is the MCP3221, a 12-bit successive approximation register A/D converter from Microchip. The second IC is the OPA344, a single-supply, rail-to-rail operational amplifier from Texas Instruments. It is possible to use the onboard switch, labeled as AN SEL, to select the IC to which the VOUT pin from the
LMP91000 AFE is routed. If the switch is in the ADC position, the VOUT pin will be routed to the input of the MCP3221 ADC. This allows the voltage value at the VOUT pin to be read via the I2C interface as digital information. When the switch is in the AN position, it will route the VOUT pin of the LMP91000 AFE IC to the input of the OPA344. The output of the OPA344 op-amp has a stable unity gain, acting as a buffer so that the voltage at the VOUT pin of the AFE can be sampled by the host MCU via the AN pin of the mikroBUS™. The RST pin on the mikroBUS™ is routed to the MEMB pin of the LMP91000, and it is used to enable the I2C interface section, thus making it possible to use more than one chip on the same I2C bus. When driven to a LOW logic level, the I2C communication is enabled, and the host device (host MCU) can issue a START condition. The RST pin should stay at LOW during the communication. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can use the communication lines properly. Also, this Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used as a reference for further development.
Features overview
Development board
PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive
mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI
GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.
Microcontroller Overview
MCU Card / MCU

Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
48
RAM (Bytes)
8196
You complete me!
Accessories
Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Software Support
Library Description
This library contains API for Alcohol 2 Click driver.
Key functions:
alcohol2_write_byte- This function writes one byte to the registeralcohol2_read_byte- This function reads one byte from the registeralcohol2_read_alcohol- This function reads Alcohol data.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief Alcohol2 Click example
*
* # Description
* The demo application gets Alcohol data and logs data to USBUART.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes device configuration.
*
* ## Application Task
* Gets Alcohol (C2H5OH) data and logs data to USBUART every 500ms.
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "alcohol2.h"
// ------------------------------------------------------------------ VARIABLES
static alcohol2_t alcohol2;
static log_t logger;
static float alcohol_value;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
alcohol2_cfg_t cfg;
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
alcohol2_cfg_setup( &cfg );
ALCOHOL2_MAP_MIKROBUS( cfg, MIKROBUS_1 );
alcohol2_init( &alcohol2, &cfg );
alcohol2_write_byte( &alcohol2, ALCOHOL2_MODECN_REG, ALCOHOL2_DEEP_SLEEP_MODE );
alcohol2_write_byte( &alcohol2, ALCOHOL2_LOCK_REG, ALCOHOL2_WRITE_MODE );
alcohol2_write_byte( &alcohol2, ALCOHOL2_TIACN_REG, ALCOHOL2_EXT_TIA_RES | ALCOHOL2_100_OHM_LOAD_RES );
alcohol2_write_byte( &alcohol2, ALCOHOL2_REFCN_REG, ALCOHOL2_VREF_INT | ALCOHOL2_50_PERCENTS_INT_ZERO | ALCOHOL2_BIAS_POL_NEGATIVE | ALCOHOL2_0_PERCENTS_BIAS );
log_printf( &logger, "Alcohol 2 is initialized\r\n" );
Delay_ms ( 300 );
}
void application_task ( void )
{
alcohol_value = alcohol2_read_alcohol( &alcohol2 );
log_printf( &logger, "Alcohol value : %f \r\n", alcohol_value );
Delay_ms ( 500 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END
Additional Support
Resources
Category:Gas


































