Arduino-----> MQ-3 Alcohol Sensor
5V -----> Vcc
GND -----> GND
Analog (A0) -----> A0
Digital 8 -----> D0
Code://the code is entirely created by: SHEEKAR BANERJEE (at December 2017)
//Dept. of CSE, IUBAT
//AI-ML-IOT Solution Engineer and Researcher
const int AOUTpin=0;
const int DOUTpin=8;
int limit;
int value;
void setup() {
Serial.begin(115200);//sets the baud rate
pinMode(DOUTpin, INPUT);
}
void loop()
{
value= analogRead(AOUTpin);
limit= digitalRead(DOUTpin);
Serial.print("Alcohol value: ");
Serial.println(value);
Serial.print("Limit: ");
Serial.print(limit);
delay(500);
Results:Value --> 0-299 ---> Normal
Value --> 300-400 ---> Mild Alcoholic
Value --> More than 400
I tested the sensor with a hand sanitizer's exit-hole. Because the hand sanitizer contains 70% of alcohol. That was quite a brilliant alternated decision to use hand sanitizer for testing instead of using real alcohol. Because I don't drink!!!
Comments