Grove - Alcohol Sensor

Introduction

5.0V Analog
Grove - Alcohol Sensor is 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.
Note
The sensor value only reflects the approximated trend of gas concentration in a permissible error range, it DOES NOT represent the exact gas concentration. The detection of certain components in the air usually requires a more precise and costly instrument, which cannot be done with a single gas sensor. If your project is aimed at obtaining the gas concentration at a very precise level, then we do not recommend this gas sensor.

Features

  • Input Voltage: 5V
  • Working Current: 120mA
  • Detectable Concentration: 20-1000ppm
  • Grove Compatible connector
  • Highly sensitive to alcohol.
  • Fast response and resumes quickly after alcohol exposure.
  • Long life.
  • Compact form factor.
Tip
More details about Grove modules please refer to Grove System

Platforms Supported

ArduinoWioBeagleBoneRaspberry PiLinkIt ONE
Caution
The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Usage

Hardware Installation

Grove products have a eco system and all have a same connector which can plug onto the Grove Base Shield. Connect this module to the A0 port of Base Shield, however, you can also connect Gas sensor to Arduino without Base Shield by jumper wires.
Arduino UNOAlcohol Sensor
5VVCC
GNDGND
Analog A1SCL
Analog A0DAT
You can gain the present voltage through the DAT pin of sensor. Sensitivity can be regulated by rotating the potentiometer. Please note the best preheat time of the sensor is above 48 hours. For the detailed information about the Alcohol sensor please refer to the datasheet.

Download Code and Upload

There are two steps you need to do before getting the concentration of gas.
First, connect the module with Grove Shield using A0 like the picture above. And put the sensor in a clear air and use the program below.
#define heaterSelPin 15 void setup() { Serial.begin(9600); pinMode(heaterSelPin,OUTPUT); // set the heaterSelPin as digital output. digitalWrite(heaterSelPin,LOW); // Start to heat the sensor } void loop() { float sensor_volt; float RS_air; // Get the value of RS via in a clear air float sensorValue; /*--- Get a average data by testing 100 times ---*/ for(int x = 0 ; x < 100 ; x++) { sensorValue = sensorValue + analogRead(A0); } sensorValue = sensorValue/100.0; /*-----------------------------------------------*/ sensor_volt = sensorValue/1024*5.0; RS_air = sensor_volt/(5.0-sensor_volt); // omit *R16 Serial.print("sensor_volt = "); Serial.print(sensor_volt); Serial.println("V"); Serial.print("RS_air = "); Serial.println(RS_air); delay(1000); }
Then, open the monitor of Arduino IDE, you can see some data are printed, write down the value of RS_air and you need to use it in the following program. During this step, you may pay a while time to test the value of RS_air.
#define heaterSelPin 15 void setup() { Serial.begin(9600); pinMode(heaterSelPin,OUTPUT); // set the heaterSelPin as digital output. digitalWrite(heaterSelPin,LOW); // Start to heat the sensor } void loop() { float sensor_volt; float RS_gas; // Get value of RS in a GAS float ratio; // Get ratio RS_GAS/RS_air int sensorValue = analogRead(A0); sensor_volt=(float)sensorValue/1024*5.0; RS_gas = sensor_volt/5.0-sensor_volt; // omit *R16 /*-Replace the name "R0" with the value of R0 in the demo of First Test -*/ ratio = RS_gas/RS_air; // ratio = RS/R0 /*-----------------------------------------------------------------------*/ Serial.print("sensor_volt = "); Serial.println(sensor_volt); Serial.print("RS_ratio = "); Serial.println(RS_gas); Serial.print("Rs/R0 = "); Serial.println(ratio); Serial.print("\n\n"); delay(1000); }
Now, we can get the concentration of gas from the figure below.
According to the figure, we can see that the minimum concentration we can test is 20ppm and the maximum is 10000ppm, in a other word, we can get a concentration of gas between 0.002% and 1%. However, we can’t provide a formula because the relation between ratio and concentration is nonlinear.
Notes
a. The value varies between 500 - 905. Hence any value above 650 indicates alcohol vapor in the vicinity.
b. Once exposed to alcohol vapor, it takes some time for the sensor value to decrease completely.
c. Yet, any new exposure will show instant increase in sensor value.
Caution
a. Alcohol sensor is very sensitive semiconductor device. Handle with care.
b. Do not expose to organic silicon steam, alkali or corrosive gases.
c. Do not use freeze or spill water.
d. Maintain proper working voltage.

Resources

Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:
  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.
An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.
Happy hacking