Alcohol Gas Sensor ( MQ-3 ) SEN42 ,R16

Alcohol Gas Sensor ( MQ-3 ) SEN42 ,R16

This alcohool sensor is suitable for detecting alcohol concentration on your breath, just like your common breathalyzer.

Getting started with Alcohol Gas Sensor ( MQ-3 )

In this project, we will go over how to build an alcohol sensor with an arduino.

The alcohol sensor we will use is the MQ-3 sensor. This is a sensor that is not only sensitive to alcohol, particularly ethanol, which is the type of alcohol which is found in wine, beer, and liquor.

This type of sensor circuit can be used as a breathalyzer to check a person’s blood alcohol level. Just as we exhale carbon dioxide when we breathe out, we also will breathe out some alcohol if we have alcohol in our blood. Any alcometer device can measure this alcohol content.

The more ethanol in your blood, the more there is in the air on exhalation. This alcohol content gives a good indication for if a person is drunk and how drunk they are.

The amount of alcohol exhaled into the air is proportional to the amount of alcohol which will be found in a person’s blood. Alcometers use a built-in formula to estimate blood alcohol content from exhaled air alcohol content.

For different countries, the level of alcohol in the blood that defines a person as over the limit for driving varies. The range ranges from 0.01 to 0.10. Most countries have a limit of about 0.05. For example, Greece, Greenalnd, and Iceland all have limits of 0.05. Canada has a higher limit set at 0.08. In the United States, it is also 0.08. This means that if the alcometer reading measures above this, the person can receive a DUI

For our circuit, it can function as an alcometer so that we get an estimate of a person’s blood alcohol level.

Disclaimer: You don’t have to drink alcohol in order to test this sensor. Mouthwash, such as Listerine, contains alcohol. If you gargle mouthwash for a few seconds and then breathe into the sensor, the readings should jump and register. This is all that’s needed to test. I take no responsibility for any drunkenness.

Hardware required

MQ-3

There are 4 leads which need to be connected. The +5V and GND leads establishes power for the alcohol sensor.

 

The other 2 leads are AOUT (analog output) and DOUT (digital output). How the sensor works is the terminal AOUT gives an analog voltage output in proportion to the amount of alcohol the sensor detects. The more alcohol it detects, the greater the analog voltage it will output. Conversely, the less alcohol it detects, the less analog voltage it will output. If the analog voltage reaches a certain threshold, it will send the digital pin DOUT high. Once this DOUT pin goes high, the arduino will detect this and will trigger the LED to turn on, signaling that the alcohol threshold has been reached and is now over the limit. How you can change this threshold level is by adjusting the potentiometer to either raise or lower the level.

Connecting the Hardware

The alcohol sensor circuit we will build with an MQ-3 sensor integrated with an arduino is shown below.

 

To connect the sensor, there are 4 leads. 2 of them are for power. The +5V terminal of the sensor connects into the 5V terminal of the arduino board. The GND terminal of the sensor connects into the GND terminal of the arduino. This establishes power for the sensor.

The other 2 connections are the analog and digital output of the sensor. These connect to analog pin A0 and digital pin D8, respectively

Code

The code which we need to upload to the arduino so that it can measure alcohol levels is shown below.

const int AOUTpin=0;//the AOUT pin of the alcohol sensor goes into analog pin A0 of the arduino
const int DOUTpin=8;//the DOUT pin of the alcohol sensor goes into digital pin D8 of the arduino
const int ledPin=13;//the anode of the LED connects to digital pin D13 of the arduino

int limit;
int value;

void setup() {
Serial.begin(115200);//sets the baud rate
pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino
pinMode(ledPin, OUTPUT);//sets the pin as an output of the arduino
}

void loop()
{
value= analogRead(AOUTpin);//reads the analaog value from the alcohol sensor’s AOUT pin
limit= digitalRead(DOUTpin);//reads the digital value from the alcohol sensor’s DOUT pin
Serial.print("\nAlcohol value: ");
Serial.println(value);//prints the alcohol value
Serial.print("Limit: ");
Serial.print(limit);//prints the limit reached as either LOW or HIGH (above or underneath)
delay(100);
if (limit == HIGH){
digitalWrite(ledPin, LOW);//if limit has been reached, LED turns on as status indicator
}
else{
digitalWrite(ledPin, HIGH);//if threshold not reached, LED remains off
}
}

The first block of code defines all the pin connections of the sensor and the LED. Since the AOUT pin connects to analog pin A0, it is initialized to 0. Since the DOUTpin connects to digital pin D8, it is initialized to 8. Since the LED connects to digital pin D13, it is initialized to 13. 2 variables, limit and value, are also declared. These will be used to store the value of the analog pin AOUT and digital pin DOUT.

The next block of code sets the baud rate and declares the DOUTpin as input and the ledPin as output. This is because the sensor is an input to the arduino for the arduino to read and process the sensor value. And the LED is an output will serves an indicator if the sensor has detected alcohol.

The next block of code reads the sensor pin AOUT and stores the value in the integer value. It also reads the sensor pin DOUT and stores the value in the integer limit. We then print the alcohol value, which will be a numeric value ranging from either 0 (no alcohol detected) to 1023 (maximum level of alcohol that can be read). We will aslo print the limit which will either be HIGH or LOW. If the alcohol detected is under the threshold level, the value of limit returned will be low. If the alcohol detected is above the threshold, the value of limit returned will be HIGH.

If the value is HIGH, the LED will turn on. If the value is low, the LED will remain off.

Applied to Gas

Frw 6,000

Related Products

ESP8266 serial port wifi module NodeMCU Lua V3 Internet of Things development board TYPE-C interface CH340

ESP8266 serial port ...

Frw 11,000

Arduino Uno SMD Electronic Development Board, 32 Kb

Arduino Uno SMD Elec...

Frw 10,000

ESP32 NodeMCU Module WLAN WiFi Development Board | Dev Kit C V2 with CP2102 compatible with Arduino

ESP32 NodeMCU Module...

Frw 15,000

HC-SR04 Ultrasonic sensor

HC-SR04 Ultrasonic s...

Frw 4,500

L298N 2A Based Motor Driver Module

L298N 2A Based Motor...

Frw 4,500

L293D driver motor shield for Arduino

L293D driver motor s...

Frw 4,300

Mini Water / Fluid Pump MOD45 ,R12

Mini Water / Fluid P...

Frw 2,450

0.08MPa 370 Motor 12V DC Air pump/Oxygen filling pump COM45, R37

0.08MPa 370 Motor 12...

Frw 8,000

MQ135 Air Quality Detector Sensor Module

MQ135 Air Quality De...

Frw 6,900

Electrolytic Capacitors0.1uF – 4700uF/25v

Electrolytic Capacit...

Frw 300

MAX30100 - Heart Rate Oxygen Pulse Sensor

MAX30100 - Heart Rat...

Frw 3,950

Single Channel 5V Relay Module

Single Channel 5V Re...

Frw 2,400

Channel 5V Relay Module

Channel 5V Relay Mod...

Frw 4,300

4 Channel 5V Relay Module

4 Channel 5V Relay M...

Frw 5,950

PCB Board 9*15cm PRO24, R22

PCB Board 9*15cm PRO...

Frw 1,000

LED 5MM 2MA GN

LED 5MM 2MA GN

Frw 50

Multi Coin Acceptor

Multi Coin Acceptor

Frw 35,000

4 * 4 Matrix Array Matrix Keypad

4 * 4 Matrix Array M...

Frw 5,000

AS608 Fingerprint Reader Sensor Module Optical

AS608 Fingerprint Re...

Frw 27,000

5A ACS712 ACS712ELC Current Sensor Module

5A ACS712 ACS712ELC ...

Frw 5,500

Infrared Obstacle Avoidance Tracking Sensor Module

Infrared Obstacle Av...

Frw 2,500

Soil Moisture Sensor

Soil Moisture Sensor

Frw 500

TTP223 Touch sensor

TTP223 Touch sensor

Frw 3,000

Smallest SIM800L GPRS GSM BRD56 , R11

Smallest SIM800L GPR...

Frw 11,500

Raspberry Pi Camera 175 Degree OV5647 Sensor 5MP Cameras Module Wide Angle Fisheye Lens for Pi 5 / 4B / 3B+ / 3B / Zero 2 W 1.3

Raspberry Pi Camera ...

Frw 35,000

MQ-7 Gas Sensor Module for Carbon Monoxide

MQ-7 Gas Sensor Modu...

Frw 8,900

GY-521 MPU6050

GY-521 MPU6050

Frw 5,500

DSM501A Dust Sensor Module PM2.5 Detection Dector COM45, R28

DSM501A Dust Sensor ...

Frw 18,500

DHT22/AM2302 Digital Temperature And Humidity Sensor Module SENS54 ,R13

DHT22/AM2302 Digital...

Frw 7,800

Arduino Active Buzzer Module COM52 ,R25

Arduino Active Buzze...

Frw 2,700

Arduino Pro Mini 328 – 5V/16MHz Board COM55

Arduino Pro Mini 328...

Frw 9,500

NodeMCU ESP8266 Development Board with 0.96 Inch OLED Display, CH340 Driver Module for Arduino IDE/M

NodeMCU ESP8266 Deve...

Frw 14,000

CNC Shield V3 – Engraving Machine 3D Printer A4988 DRV8825 Driver Expansion Board BRD46 , R34

CNC Shield V3 – En...

Frw 4,500

PIR Motion sensor SEN51 ,R12

PIR Motion sensor SE...

Frw 3,800

SYB-170 Mini Breadboard

SYB-170 Mini Breadbo...

Frw 700

GY-9960-3.3 APDS-9960 RGB Infrared Gesture Sensor COM44

GY-9960-3.3 APDS-996...

Frw 10,000

LilyPad Light Sensor module COM31

LilyPad Light Sensor...

Frw 3,500

Active Single Phase AC Output Voltage Sensor SEN31 ,R11

Active Single Phase ...

Frw 12,000

P6KE16CA 600 Watt Transient Voltage Suppressor Diode COM26

P6KE16CA 600 Watt Tr...

Frw 300

Capacitive Soil Humidity Hygrometer Moisture Sensor SENS54, R14

Capacitive Soil Humi...

Frw 6,000

Normally Open Proximity Magnetic Sensor Reed Switch SEN43

Normally Open Proxim...

Frw 2,500

Non-invasive AC Current Sensor – 30A SEN31

Non-invasive AC Curr...

Frw 11,500

Alcohol Gas Sensor ( MQ-3 ) SEN42 ,R16

Alcohol Gas Sensor (...

Frw 6,000