MQ3 Gas Detector for Ethanol

  
The MQ3 is one of a series of gas detectors and is sensitive to alcohol (ethanol). The same sketch used for the MQ2 can be used and for a discussion on theses gas sensors see my post here.

When placed over a half full glass of wine it gave a reading around 200 and when placed over a small amount of whiskey a reading of around 450 was obtained. This reading over whiskey triggered the digital output.


/* GAS Sensor MQ-3
This sensor detects flammable gasses
the board has four pins
connect AO to Arduino pin A0
connect DO to Arduino pin 2
connect Gnd to Arduino Gnd
connect Vcc to Arduino 5 volts
*/
int sensorPin = A0; // select the input pin for the potentiometer
int DOPin = 2; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor

int ledPin =13;
void setup() {

// declare the ledPin as an OUTPUT:
pinMode(DOPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}

void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
Serial.print("Analog Output = ");
Serial.println(sensorValue);
// turn the ledPin on if triggered
//
if (digitalRead(DOPin) ==HIGH){
digitalWrite(ledPin, LOW);
Serial.println("Digital Output = OFF");
}
else {
digitalWrite(ledPin, HIGH);
Serial.println("Digital Output = ON");
}
delay(1000);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s