Alcohol click

Description of product

Alcohol click has a high sensitivity to alcohol and it can be used to detect alcohol in concentrations from 0.04 to 4mg/l.

Alcohol click carries an MQ-3 Semiconductor sensor for alcohol. The click is designed to run on a 5V power supply only. It communicates with the target microcontroller through the AN pin on the mikroBUS™ line. 

MQ-3 sensor features

The gas sensing layer on the sensor unit is made of Tin dioxide (SnO2), an inorganic compound which has lower conductivity in clean air. The conductivity increases as the levels of alcohol gas rise.

Calibrating the sensor

To calibrate the sensor for the environment you’ll be using it in, Alcohol click has a small potentiometer that allows you to adjust the Load Resistance of the sensor circuit.

SPECIFICATION

TypeGas
ApplicationsPortable alcohol detector, breathalyzer for estimating BAC (blood alcohol content)
On-board modulesMQ-3 Semiconductor sensor for alcohol
Key FeaturesDesigned to use a 5V power supply
Key BenefitsPotentiometer for calibration
InterfaceAnalog
Input Voltage3.3V or 5V
CompatibilitymikroBUS
Click board sizeM (42.9 x 25.4 mm)

DOCUMENTATION

Pinout diagram

This table shows how the pinout on Alcohol click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).

NotesPinMikrobus logo.png
mikroBUStm
PinNotes
Sensor analog outputAN1ANPWM16NCNot connected
Not connectedNC2RSTINT15NCNot connected
Not connectedNC3CSTX14NCNot connected
Not connectedNC4SCKRX13NCNot connected
Not connectedNC5MISOSCL12NCNot connected
Not connectedNC6MOSISDA11NCNot connected
Not connectedNC73.3V5V10+5VPower supply
GroundGND8GNDGND9GNDGround

Programming

Code examples for Alcohol click, written for MikroElektronika hardware and compilers are available on Libstock.

Code snippet

The following code snippet shows how to initialize the click, and then read from it, showing the values on the display every 500 ms.

01 void main() {
02 
03  LCD_Init();                                // Initialize Lcd
04  Lcd_Cmd(_LCD_CLEAR);                       // Clear display
05  Lcd_Cmd(_LCD_CURSOR_OFF);                  // Cursor off
06  Lcd_Out(1,1,"Alcohol click");              // Write text in first row
07 
08  ANSELA = 0x04;                             // Set ADC on RA2
09  TRISA = 0x04;                              // Set RA2 as input
10  LATA = 0;                                  // Set PORTA as 0
11  ADC_Init();                                // Initialize ADC
12  delay_ms(100);                             // Pause of 100ms for ADC module stabilization
13 
14  //Initial read ADC and display PPM value on LCD
15  readSensor();                              // Read sensor
16  calculatePPM();                            // Calculating PPM value
17  
18  FloatToStr(ppm,&txt);                      // Conversion float ppm to string txt
19  LCD_Out(2,14,"ppm");                       // Print text on LCD
20  LCD_Out(2,1,txt);                          // Print txt value on LCD
21  
22  while(1) {
23  
24    delay_ms(500);                           // Pause 500ms
25    readSensor();                            // Read sensor
26    calculatePPM();                          // Calculating PPM value
27    FloatToStr(ppm,&txt);                    // Conversion float ppm to string txt
28    LCD_Out(2,1,txt);                        // Print txt value on LCD
29    
30  }
31 }

Key features

  • MQ-3 sensor
    • Concentration: 0.04-4mg/l alcohol
    • Sensitivity: Rs(in air)/Rs(0.4mg/LAlcohol)≥5
  • Interface: Analog
  • 5V power supply

Downloads