Enhance your future Arduino project by incorporating the MQ3 alcohol sensor module, which adds a sense of smell for alcohol. This module is capable of detecting the presence of alcohol in the surrounding air and measuring its concentration. If you aspire to create a personal breathalyzer to gauge the alcohol level in someone’s breath, the MQ3 alcohol sensor module is an ideal option to consider.
MQ3 Alcohol Sensor
The MQ3 alcohol sensor is a popular choice among the MQ sensor series. It utilizes a Metal Oxide Semiconductor (MOS) technology. These sensors, also known as Chemiresistors, detect alcohol by measuring the change in resistance of the sensing material when it comes into contact with alcohol.
Operating at 5V DC, the MQ3 alcohol sensor has a power consumption of approximately 800mW. It is capable of detecting alcohol concentrations within the range of 25 to 500 parts per million (ppm).
The concentration of 1 ppm (parts per million) represents a ratio of one part of a substance to one million parts of the total mixture or environment. In the context of gas concentration, it means that for every one million gas molecules, one molecule is of the substance being measured, while the rest are other molecules or components.
Internal structure of MQ3 Alcohol Sensor
The MQ3 alcohol sensor features a heater-driven design with a protective structure. It is covered with two layers of fine stainless steel mesh called an “anti-explosion network” to prevent any potential explosions when detecting flammable gases like alcohol.
The protective mesh also acts as a filter, allowing only gaseous elements to pass through while filtering out suspended particles. When the outer mesh is removed, the sensor reveals its internal structure. The star-shaped structure consists of the sensing element and six connecting legs that extend beyond the Bakelite base.
Two of the leads are responsible for heating the sensing element and are connected by a Nickel-Chromium coil, a conductive alloy. The remaining four leads, connected with platinum wires, serve as signal carriers. These wires are linked to the body of the sensing element and detect slight variations in the current flowing through it.
The sensing element itself is a tubular structure made of Aluminum Oxide (AL2O3) ceramic with a coating of Tin Dioxide (SnO2). Tin Dioxide is the crucial material responsible for sensing alcohol. The ceramic substrate enhances heating efficiency and ensures continuous heating of the sensor area to its operational temperature.
In summary, the MQ3 alcohol sensor consists of a Heating System composed of a Nickel-Chromium coil and an Aluminum Oxide-based ceramic, while the Sensing System consists of Platinum wires and a Tin Dioxide coating.
How Does the MQ3 Alcohol Sensor Work?
The MQ3 alcohol sensor operates based on the principle of gas sensing using a SnO2 (Tin Dioxide) semiconductor layer. When the sensor is heated to a high temperature, oxygen molecules are adsorbed onto the surface of the SnO2 particles.
In clean air or absence of alcohol, the oxygen molecules attract electrons from the conduction band of tin dioxide, creating an electron depletion layer beneath the surface. This depletion layer acts as a potential barrier, making the SnO2 film highly resistive and hindering the flow of electric current.
However, when alcohol is present in the surrounding environment, it reacts with the adsorbed oxygen, causing a reduction in the surface density of adsorbed oxygen molecules. This reduction in oxygen availability lowers the potential barrier, allowing electrons to be released into the tin dioxide material. Consequently, the current can flow more freely through the sensor.
By measuring the change in current flow or resistance, the MQ3 alcohol sensor can detect the presence and concentration of alcohol in the air. The resistance or current measurement can be converted into an alcohol concentration value using calibration curves specific to the sensor.
MQ3 Alcohol Sensor Module Hardware Overview
The MQ3 alcohol sensor module is designed for easy usage and provides two types of outputs. It offers both a binary indication of the presence of alcohol and an analog representation of its concentration in the surrounding air.
The analog output voltage of the sensor, available at the A0 pin, is directly proportional to the concentration of alcohol. As the alcohol concentration increases, the output voltage also increases. Conversely, as the concentration decreases, the output voltage decreases accordingly. The relationship between alcohol concentration and output voltage is illustrated in the provided animation.
To convert the analog signal into a digital form, the module incorporates an LM393 High Precision Comparator. The digitized output is accessible at the Digital Output (D0) pin.
The module includes a potentiometer that allows for sensitivity adjustment of the digital output (D0). By setting a threshold value using the potentiometer, you can configure the module to output a LOW signal when the alcohol concentration exceeds the threshold, and a HIGH signal otherwise.
Additionally, the module is equipped with two LEDs. The Power LED indicates the module’s operational status, illuminating when the module is powered on. The Status LED serves as an indicator when the alcohol concentration surpasses the predefined threshold, illuminating to provide a visual notification.
Technical Specifications
Here are the specifications:
Operating voltage | 5V |
Load resistance | 200 KΩ |
Heater resistance | 33Ω ± 5% |
Heating consumption | <800mw |
Sensing Resistance | 1 MΩ – 8 MΩ |
Concentration Range | 25 – 500 ppm |
Preheat Time | Over 24 hour |
MQ3 Alcohol Sensor Module Pinout
Here is the pinout overview of the MQ3 alcohol sensor module:
- VCC: This pin is used to supply power to the module. Connect it to the 5V output of your Arduino or any other appropriate power source.
- GND: This pin is the ground connection for the module. Connect it to the ground (GND) pin of your Arduino or the common ground of your circuit.
- D0: This pin serves as an indication of the presence of alcohol. It provides a digital output that becomes LOW when the alcohol concentration exceeds the threshold value set by the potentiometer. Otherwise, it remains HIGH.
- A0: This pin generates an analog output voltage that is proportional to the concentration of alcohol detected by the sensor. The output voltage increases with higher alcohol concentration and decreases with lower concentration.
Make sure to connect the VCC and GND pins appropriately for power supply and grounding, and utilize the D0 and A0 pins according to your project requirements.
Calibrating the MQ3 Alcohol Sensor
To calibrate the MQ3 alcohol sensor, follow these steps:
- Start by fully warming up the sensor. If the sensor has been in storage for a long period (a month or more), it needs to be warmed up for 24-48 hours. During this time, ensure that the sensor is powered on and operating.
- If the sensor has been recently used, a warm-up period of 5-10 minutes is sufficient. Allow the sensor to stabilize during this time.
- During the warm-up period, the sensor readings may initially be high and gradually decrease until they stabilize. This is a normal behavior of the sensor.
- Once the sensor has stabilized, it is ready for calibration.
- Prepare a known concentration of alcohol in the air. This can be achieved by using a calibrated alcohol source or a controlled environment with a known concentration of alcohol vapor.
- Place the sensor in the environment with the known alcohol concentration and allow it to measure the concentration for a sufficient duration. Take note of the sensor readings during this period.
- Compare the sensor readings to the known alcohol concentration. If there is a consistent deviation, you can adjust the readings by applying a calibration factor.
- To apply the calibration factor, you can either modify your code or perform the calibration in software by adjusting the sensor readings based on the known concentration.
- Repeat the calibration process if necessary to ensure accuracy.
Remember that calibration may be required periodically, especially if the sensor has been in storage or if you notice significant deviations in its readings.
Parts Required
Component Name | Buy Now |
Arduino Uno REV3 | Amazon |
MQ-3 Special Alcohol Ethanol Gas Sensor Module | Amazon |
Breadboard | Amazon |
Experiment 1 – Measuring Alcohol Concentration using Analog Output (A0)
In this experiment, we will utilize the analog output of the MQ3 alcohol sensor to measure the alcohol concentration and estimate the level of alcohol intoxication.
Wiring
To begin, connect the MQ3 alcohol sensor to your Arduino board. Connect the VCC pin of the sensor to the 5V pin of the Arduino, and connect the GND pin of the sensor to the Arduino’s Ground pin. Lastly, connect the A0 output pin of the sensor to Analog pin #0 on the Arduino.
Refer to the image below for the wiring setup.
Determining the Threshold Values
To estimate the level of alcohol intoxication, you will need to record the sensor readings before and after consuming alcohol.
Upload the provided sketch to your Arduino and take the readings.
If consuming alcoholic beverages is not legally permitted or if you prefer an alternative testing method, you can use an isopropyl alcohol bottle or a hand sanitizer bottle for your experiments. It’s important to avoid getting alcohol directly on the sensor. Instead, gently squeeze the bottle to release alcohol vapors and allow them to enter the sensor for readings.
#define MQ3pin 0 float sensorValue; //variable to store sensor value void setup() { Serial.begin(9600); // sets the serial port to 9600 Serial.println("MQ3 warming up!"); delay(20000); // allow the MQ3 to warm up } void loop() { sensorValue = analogRead(MQ3pin); // read analog input pin 0 Serial.print("Sensor Value: "); Serial.println(sensorValue); delay(2000); // wait 2s for next reading }
Upon running the sketch, you should observe readings similar to the following:
- In the absence of alcohol (approximately 120)
- In the presence of alcohol (approximately 500)
Please note that this process may require some trial and error. Once you have obtained the readings, you can use them as thresholds to trigger specific actions or responses based on the alcohol concentration detected by the sensor.
Arduino Code
The provided sketch below is designed to estimate the level of alcohol intoxication based on the following threshold values:
- If the sensor reading is less than 120, it indicates sobriety.
- If the sensor reading falls within the range of 120 to 400, it indicates drinking within legal limits.
- If the sensor reading is greater than 400, it indicates being drunk.
/* Replace these values with your own readings */ #define Sober 120 // Define max value that we consider sober #define Drunk 400 // Define min value that we consider drunk #define MQ3pin 0 float sensorValue; //variable to store sensor value void setup() { Serial.begin(9600); // sets the serial port to 9600 Serial.println("MQ3 warming up!"); delay(20000); // allow the MQ3 to warm up } void loop() { sensorValue = analogRead(MQ3pin); // read analog input pin 0 Serial.print("Sensor Value: "); Serial.print(sensorValue); // Determine the status if (sensorValue < Sober) { Serial.println(" | Status: Stone Cold Sober"); } else if (sensorValue >= Sober && sensorValue < Drunk) { Serial.println(" | Status: Drinking but within legal limits"); } else { Serial.println(" | Status: DRUNK"); } delay(2000); // wait 2s for next reading }
Upload this code to your Arduino board and open the serial monitor to view the sensor readings and the corresponding level of alcohol intoxication. The output will indicate whether the person is sober, drinking within legal limits, or drunk based on the sensor reading.
Experiment 2 – Detecting the Presence of Alcohol using Digital Output (D0)
In our second experiment, we will utilize digital output to detect the presence of alcohol.
Wiring
To set up the circuit for this experiment, we will reuse the previous circuit. Simply disconnect the connection to the ADC pin and connect the D0 pin on the module to digital pin #8 on the Arduino.
The following image illustrates the wiring configuration.
Setting the threshold
The module includes a built-in potentiometer that allows us to establish an alcohol concentration threshold. Above this threshold, the module will output LOW, and the status LED will illuminate.
To set the threshold, expose the sensor to alcohol vapors and rotate the potentiometer clockwise until the Status LED turns on. Then, gradually rotate the potentiometer counterclockwise until the LED switches off.
With this adjustment, your module is now ready for use.
Arduino Code
Now, proceed to upload the provided sketch below to your Arduino.
#define MQ3pin 8 int sensorValue; //variable to store sensor value void setup() { Serial.begin(9600); // sets the serial port to 9600 Serial.println("MQ3 warming up!"); delay(20000); // allow the MQ3 to warm up } void loop() { sensorValue = digitalRead(MQ3pin); // read digital output pin Serial.print("Digital Output: "); Serial.print(sensorValue); // Determine the status if (sensorValue) { Serial.println(" | Alcohol: -"); } else { Serial.println(" | Alcohol: Detected!"); } delay(2000); // wait 2s for next reading }
Upload the code to your Arduino board and open the serial monitor to observe the sensor readings. The output will indicate whether alcohol is detected or not based on the digital input.