Arduino Alcohol Sensor

by kas146 in Circuits > Arduino

967 Views, 1 Favorites, 0 Comments

Arduino Alcohol Sensor

sensor.jpg
isopropyl.jpg
alcohol.jpg
breadboard1.jpg
fritzing sketch.png

For this project I have created am alcohol detector with my Elegoo Uno R3. The total cost for this project is around $55.

I originally had started with this project because in addition to being a full time student I also work at a restaurant as a bartender, and I thought of how to create my own breathalyzer in a sense. While this should not be used in place of a breathalyzer, it is a cool way to detect any vapors of alcohol.

To set up, I hooked up my Uno R3 and poured a small dish of Isopropyl Alcohol, about 2 oz.

I have included a diagram of my Uno setup, but it should be noted that where the sensor is connected is wrong, because I personally could not find the right fritzing sensor, but the picture of the sensor has the correct hookups.

Supplies

Arduino or Elegoo Uno R3
https://www.amazon.com/dp/B01D8KOZF4/?coliid=I2JL2...

Isopropyl Alcohol

MQ-3 Alcohol Gas Sensor
https://www.circuitspecialists.com/agas-01_mq-3_al...

2 220 ohm resistors

Red LED

3 Female-to-male wires

5 breadboard jumper wires

breadboard

Step 2: Code

I found code for a different MQ-3 sensor that has four prongs online, but my sensor only has three prongs on it, so I had to alter the code slightly in order for my system to work. I set up the sensor to turn on the red LED light if it detected a value of 500 or more, and to turn the light off if it detected under a value of 500.

Here is the link to the code I found online: http://www.learningaboutelectronics.com/Articles/M...

Here is my code:

byte sensor = 5;
const int AOUTpin=0;
const int DOUTpin=8;
int ledPin= 11;

int value;

void setup() {
Serial.begin(115200);
pinMode(AOUTpin, INPUT);
pinMode(ledPin, OUTPUT);
}

void loop() {
{
value= analogRead(AOUTpin);
Serial.print("Alcohol value: ");
Serial.println(value);
delay(100);
if (value >= 500){
digitalWrite(ledPin, HIGH);
}
else{ digitalWrite(ledPin, LOW);
}
}
}

I have also attached a .ino file for the code.

Downloads

Step 3: Sense the Alcohol!

lighton.jpg
lightoff.jpg

With the breadboard and Uno R3 setup, and the code uploaded, you should now have a working sensor!

If you hover the sensor over the isopropyl alcohol then the light should turn on.

If you take the sensor away from the alcohol, the light should turn off.

Video Demonstration

stoyk part01 demo

Here is a video demonstration of my system, and what you should get if you create one yourself.