Home / Tutorials / Arduino Tutorial / How to Use the MQ-3 Alcohol Sensor

# How to Use the MQ-3 Alcohol Sensor

The MQ-3 alcohol sensor is useful for projects that tests levels of alcohol, benzine, hexane or LPG in the air but it is most popularly used as a breathalyzer (breath analyzer) for someone who drank beer, wine or other liquor. Learn how to use this sensor in this tutorial.

### Introduction

According to its datasheet, the MQ-3 alcohol sensor detects 25 to 500 ppm of alcohol (ethane). Here’s the graph of voltage vs. alcohol concentration:

Blood alcohol level (BAC) is normally measured in grams per deciliter (g/dL). 1 g/dL is equivalent to 10000 ppm. In the US and Canada, the minimum BAC for driving is 0.08 g/dL or 800 ppm. In most European countries, it’s 0.05 g/dL or 500 ppm.

Note that the graph was derived with a load of 4.7 kΩ. It would be difficult to replicate the results of the graph if we will be using the MQ-3 as a breathalyzer. Instead, we will be using the RS/R0 graph:

Here we see the different curves for each gas the MQ-3 can detect. Rs is the resistance of the board at target gas while R0 is the resistance of the board when only clean air is present.

### MQ-3 Alcohol Sensor Breakout Board

The MQ-3 alcohol sensor breakout board has four pins as shown:

Here’s the schematic diagram for the breakout board:

The alcohol level is readable via the AOUT pin. Since it’s a varying voltage, this pin should be connected to any of the Arduino’s or PIC’s analog pin. To use the MQ-3 alcohol sensor with the Raspberry Pi you need an external analog to digital converter.

The DOUT pin becomes high when the alcohol level exceeds a threshold value. Based on the schematic, the threshold value depends on the value of Rp which is the trimmer on the breakout board. You will need to test the device as to which BAC will trigger DOUT.

### Breath Analyzer with Arduino

To build a reliable alcohol level sensor using the MQ-3, we need to determine the R0 of the device first. We can use this sketch for that:

Once we have R0, we can now use the information from the graph to calculate BAC. Using regression, I found the relationship between RS/R0 and mg/L to be:

$mg/L = 0.189563503 (RS/R0)^{2}- 8.617766543\dot10^{-1} (RS/R0) + 1.079213151$

I then use this formula to calculate the BAC in g/dL.

This is the resulting Arduino sketch. Remember to replace R0 with the results obtained from the previous sketch.

You now have an Arduino-based breathalyzer!

## Arduino RFID RC522 Tutorial

RFID technology has been around for quite a while. But it was only recently that …