Grove - Alcohol Sensor

From Wiki
(Redirected from Twig - Alcohol Sensor)
Jump to: navigation, search

Contents

Introduction

Grove - Alcohol Sensor a complete alcohol sensor module for Arduino or Seeeduino. It is built with MQ303A semiconductor alcohol sensor. It has good sensitivity and fast response to alcohol. It is suitable for making Breathalyzer. This Grove implements all the necessary circuitry for MQ303A like power conditioning and heater power supply. This sensor outputs a voltage inversely proportional to the alcohol concentration in air. Model:SEN21723P
Alcohol sensor 01.jpg

Features

  • Grove Compatible connector
  • Highly sensitive to alcohol.
  • Fast response and resumes quickly after alcohol exposure.
  • Long life.
  • Compact form factor.

Cautions

  • Alcohol sensor is very sensitive semiconductor device. Handle with care.
  • Do not expose to organic silicon steam, alkali or corrosive gases.
  • Do not use freeze or spill water.
  • Maintain proper working voltage.

Specification

Item Min Typical Max Unit
Operating Voltage 4.75 5.0 5.25 V
Current 100 120 140 mA
Detection Gas Alcohol -
Detectable Concentration 20-1000 ppm

Application Ideas

  • Breathalyzer - Alcohol over-limit detection
  • Environmental monitoring equipments

Usage

The Alcohol Sensor MQ303Q requires adequate current(150mA). The power source is from VCC of Grove Connector. The following sketch demonstrates some applications.

Demo 1: Test Alcohol sensor

The following example is to test alcohol sensor with Seeeduino.As the picture on the below indicates, the alcohol sensor is connected to A0-A1 of the Grove - Basic Shield
Twig Alcohol Sensor Connected To Seeeduino via BaseStem.jpg

Upload the following sketch. Please click here if you do not know how to upload.

//MQ303A Testing - A simple sketch to understand the working of Alcohol sensor. Can be used to study how to calibrate threshold values.   

//Alcohol Sensor DAT Pin is connected to Analog Input Pin 0 (A0)
#define analogInDatPin 0

//Alcohol Sensor SCL Pin is connected to Analog Input Pin 1 (A1). In this case it is used as digital ouput.
//15 is mapped to A1
#define heaterSelPin 15

int sensorValue = 0;        

void setup() {
  pinMode(heaterSelPin,OUTPUT);    // set the heaterSelPin as digital output.
  digitalWrite(heaterSelPin,HIGH); //when heaterSelPin is set, heater is switched off.
  Serial.begin(9600);  // open the serial port at 9600 bps
}
void loop() {
  digitalWrite(heaterSelPin,LOW);             //switch on the heater of Alcohol sensor
  sensorValue = analogRead(analogInDatPin);   //read the analog value 

  //Disply the results in serial monitor.
  Serial.print("sensor test value = ");                       
  //sensorValue goes down when alcohol is detected. Hence subtracting from 1023.
  Serial.println(1023-sensorValue); 
  delay(100);  
}

Output result:

1) Sensor value after heating sensor for 5~10 mins and before exposure to alcohol:
MQ303A Alcohol Sensor Twig Heated NotExposedToAlcoholYet.png
2) Sensor value after exposure to alcohol:
Alcohol Sensor AlcoholDetected1.png
Alcohol Sensor AlcoholDetected2.png
  • The value varies between 500 - 905. Hence any value above 650 indicates alcohol vapor in the vicinity.
  • Once exposed to alcohol vapor, it takes some time for the sensor value to decrease completely.
  • Yet, any new exposure will show instant increase in sensor value.

Demo 2: Breathalyzer

A simple breathalyser design is presented below.

  • Connect Alcohol sensor to A0-A1 connector of Base Shield.
  • Connect Serial LCD to D11-D12 connector of Grove - Base Shield.


Twig Alcohol Sensor Breathalyzer.jpg

  • Upload the following sketch.
#include <SerialLCD.h>
#include <NewSoftSerial.h> 

// initialize the slcd library
SerialLCD slcd(11,12); //this is a must, assign soft serial pins

//Alcohol Sensor DAT Pin is connected to Analog Input Pin 0 (A0)
#define analogInDatPin 0

//Alcohol Sensor SCL Pin is connected to Analog Input Pin 1 (A1). In this case it is used as digital ouput.
//15 is mapped to A1
#define heaterSelPin 15

int sensorValue = 0;        

void setup() {
    pinMode(heaterSelPin,OUTPUT);    //set the heaterSelPin as digital output.
    digitalWrite(heaterSelPin,HIGH); //when heaterSelPin is set, heater is switched off.
    slcd.begin();
    //Disply the results in Seeed Serial LCD.
    slcd.setCursor(0,0);
    slcd.print("**Breathalyzer**");

    //  Serial.begin(9600); //debug port: Uncomment if required
}

void loop() {
    digitalWrite(heaterSelPin,LOW);           //switch on the heater of Alcohol sensor
    sensorValue = analogRead(analogInDatPin); // read the analog in value

    //Disply the results in Seeed Serial LCD.
    slcd.setCursor(0,1);
    slcd.print(1023 - sensorValue,DEC);
    slcd.print(" ");

    char scale=((1023 - sensorValue)/77); // (999 / 13). As the display can show upto 13 levels after display levels in decimals.
    for(char level=0;level<scale;level++)
    {
        slcd.print(0xFF);  //All black character
    }

    for(char level=0;level<(13-scale);level++)
    {
        slcd.print(" ");  //Clear remaining characters
    }


    //  Serial.println(1023 - sensorValue,DEC);  //debug port: Uncomment if required
    delay(500);
}

The output result:

Twig Alcohol Sensor Breathalyzer output1.jpg

Twig Alcohol Sensor Breathalyzer output2.jpg

Reference

The MQ303A Sensor is response to Alcohol. To give a better idea of MQ303A working, the following characteristics graph is provided.

  • The moment sensor is heated, sensor value starts to decrease slowly.
  • When sensor is exposed to Alcohol, The sensor reading shows a sharp increase.
  • When Alcohol is removed, the sensor value decreases slowly.


Twig Alcohol Sensor MQ303A Response Characteristics.png

Version Tracker

Revision Descriptions Release date
Grove - Alcohol Sensor v1.0 Initial public release Dec 24, 2010


Resources

Support

If you have questions or other better design ideas, you can go to our forum or wish to discuss.

Personal tools
Namespaces

Variants
Actions
Structure
Seeed Products
Support
Toolbox