Devices & Components
Arduino Uno Rev3
Gravity: Analog Alcohol Sensor (MQ3) For Arduino
Software & Tools
Arduino IDE
Project description
Code
Program of MQ3 Alcohol Sensor with Arduino UNO R3
arduino
1const int AOUTpin=0;//the AOUT pin of the alcohol sensor goes into analog pin A0 of the arduino 2const int DOUTpin=8;//the DOUT pin of the alcohol sensor goes into digital pin D8 of the arduino 3 4int limit; 5int value; 6 7void setup() { 8Serial.begin(115200);//sets the baud rate 9pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino 10pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino 11} 12 13void loop() 14{ 15value= analogRead(AOUTpin);//reads the analaog value from the alcohol sensor's AOUT pin 16limit= digitalRead(DOUTpin);//reads the digital value from the alcohol sensor's DOUT pin 17Serial.print("Alcohol value: "); 18Serial.println(value);//prints the alcohol value 19Serial.print("Limit: "); 20Serial.print(limit);//prints the limit reached as either LOW or HIGH (above or underneath) 21delay(500); 22}
Downloadable files
Circuit Diagram of MQ3 Alcohol Sensor
Circuit Diagram of MQ3 Alcohol Sensor

Circuit Diagram of MQ3 Alcohol Sensor
Circuit Diagram of MQ3 Alcohol Sensor

Comments
Only logged in users can leave comments