Alcohol Detection Using Linkit One

Introduction

 
A breathalyzer is a device for estimating blood alcohol content (BAC) from a breath sample. Breath analyzers do not directly measure blood alcohol content or concentration, which requires the analysis of a blood sample. Instead, they estimate BAC indirectly by measuring the amount of alcohol in one's breath.
 
Let us create a simple breathalyzer with LinkIt One microcontroller. The new IoT board LinkIt ONE co-designed by Mediatek and Seed Studios is an open-source, high-performance board for prototyping Wearables and IoT devices. It is a small board based on SoC that comes with onboard Wi-Fi, GSM, and GPRS that makes it a powerful board for connected devices.
 
Here are some more LinkIt one article which will help you to get familiar with it.
Requirements
 
Requirements
 
Figure 1: Requirements
  • LinkItOne microcontroller board.
  • Grove Alcohol Sensor
  • Buzzer
  • USB Cable
Grove Alcohol Sensor
 
Alcohol Sensor Board
 
Figure 2: Alcohol Sensor Board
 
Alcohol Sensor
 
Figure 3: Alcohol Sensor
 
Alcohol sensor is a semiconductor sensor for alcohol detection and it is built with an MQ303A semiconductor alcohol sensor. Grove alcohol sensor has a grove interfacing which is suitable for Arduino or Seeeduino. You can also use this with Raspberry Pi2 if you are using a GrovePi. This sensor has good sensitivity and fast response to alcohol hence you can make your own portable alcohol detector with this. This sensor outputs a voltage inversely proportional to the alcohol concentration in air.
 
Specifications
  • Power requirements: 5 VDC @ ~120 mA (heater on)
  • Detection Gas: Alcohol
  • Concentration: 20-1000ppm Alcohol
  • Interface: 1 TTL compatible input (SEL), 1 TTL compatible output (DAT)
  • Dimension: 40×20×12mm
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.
Connections
 
See Connections
 
Figure 4: See Connections
  1. Connect LinkIt One to your computer using a USB A to micro B cable.
  2. Connect the Alcohol sensor into the A0 port of Grove Base Shield.
  3. In the Arduino IDE, go to the Tools pull-down menu at the top, select Board, and make sure “LinkIt One” is checked.
  4. Then pull down the Tools menu again, and select appropriate Serial Port.
  5. Connect the Buzzer to the D2 port of Grove Base Shield.
If you have multiple serial ports to choose from and aren’t sure which to choose, try unplugging the board from your computer and plugging the board back again to see which port gets added.
 
Code
  1. int buzzer = 2;  
  2. int sensor = A0;  
  3. // The setup routine runs once when you press reset  
  4. void setup()  
  5. {  
  6.     pinMode(buzzer, OUTPUT); // Initialize the digital pin2 as buzzer output  
  7.     Serial.begin(9600); // Initialize serial communication at 9600 bits per second  
  8. }  
  9. // The loop routine runs over and over again forever  
  10. void loop()  
  11. {  
  12.     var sensorValue = analogRead(sensor); // Read the input on analog pin 0 ('sensor')  
  13.     Serial.println(sensorValue); // Print out the value on serial monitor  
  14.     if (sensorValue > 650)  
  15.     {  
  16.         // If sensorValue is greater than 200  
  17.         digitalWrite(buzzer, HIGH);  
  18.     }  
  19.     else  
  20.     {  
  21.         digitalWrite(buzzer, LOW);  
  22.     }  
  23. }  
The Grove Alcohol sensor is very sensitive in detecting alcohol. I tested this breathalyzer by bringing an empty alcohol bottle near to this and instantly the Buzzer started playing. You can also make the same using the MQ3 sensor with the Pololu carrier board but you have to do little soldering and breadboarding with that.
 
Important
  • An alcohol sensor is a very sensitive semiconductor device, you should take proper care while handling this.
  • 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.
  • Do not expose to organic silicon steam, alkali or corrosive gases.
  • Do not use freeze or spill water. Maintain proper working voltage.