Introduction: Arduino Alcohol Sensor

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.


Arduino or Elegoo Uno R3

Isopropyl Alcohol

MQ-3 Alcohol Gas Sensor

2 220 ohm resistors


3 Female-to-male wires

5 breadboard jumper wires


Step 1: 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:

Here is my code:

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

int value;

void setup() {
pinMode(AOUTpin, INPUT);
pinMode(ledPin, OUTPUT);

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

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

Step 2: Step 3: Sense the Alcohol!

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.

Step 3: Video Demonstration

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