当前位置:网站首页>【MQ-3 Alcohol Detector and Arduino Detect Alcohol】
【MQ-3 Alcohol Detector and Arduino Detect Alcohol】
2022-08-02 04:51:00 【WENJIE Technology】
MQ-3 Alcohol detector with ArduinoDetection of alcohol
- 前言
- MQ-3 Alcohol sensor pin
- MQ-3 Alcohol sensor modules
- MQ-3 How alcohol sensor module works?
- 如何使用 MQ-3 Sensors detect alcohol?
- 如何使用 MQ-3 传感器测量 PPM The alcohol concentration?
- 关于 MQ-3 Alcohol sensor module common problem
- MQ-3 Sensor module internal circuit diagram
- Arduino Uno MQ-3 酒精传感器 - 连接图
- 用于连接 MQ-3 The gas sensor module Arduino 代码
- MQ-3 Sensor module work
- 完整代码
前言
现在,By detecting the smoke sensor、Fire or gas and remind the right people,Among various kinds of apartment、Homes and businesses play a crucial role in the safety and security of.Today's post will discuss a kind of such sensors,MQ-3.MQ-3 Is sensitive to alcohol sensor,Usually used for breath analyzer.
MQ-3 Alcohol sensor pin
MQ-3 Gas detection sensor consists of four modules can be used to extract data from sensor pin:VCC、GND、Aout 和 Dout.MQ-3Alcohol detection sensor pin is arranged as follows:
VCC==》Is the power of the gas detection sensor pin,可连接到 5V 电源.
GND==》Is a circuit board of the grounding pin,应该连接到 Arduino 的接地引脚.
DO==》Is the board's digital output pin;Low output said there is no alcohol in the environment,And high output says there is alcohol.
AO==》Is the circuit of the analog output pin,It will be subject to detect alcohol concentration provide us in Vcc And the analog signal to change between ground:
MQ-3 Alcohol sensor modules
MQ-3 The sensor is very popular in the hands of the new,因为它在大多数Arduino Project to detect alcohol.These are low cost、Easy to use sensors,Has wide detection range,Can reduce sensitivity to change.MQ-3 Sensor component tag as shown below.
MQ-3 Alcohol sensor module has four pin,其中两个用于 VCC 和 GND.The other two can output analog and digital data at the same time,Just like other basic sensor module.我们使用 Arduino 的 5V Pin for power supply circuit,Because module working voltage in the range of 5V,容差为 0.1%.The module has two built-in LED,如上图所示.When the power is connected to the circuit board,电源 LED 会亮起,When to trigger the value of the potentiometer,Dout LED 会亮起.The board also has an operational amplifier comparator,Input analog signals from the sensors in the gas can be converted into digital signal.
MQ-3 How alcohol sensor module works?
MQ-3 Gas sensor need a heating element to correctly identify alcohol.但是,Placed near the alcohol heating element can be dangerous.因此,Sensors to build one consisting of two layers of thin stainless steel wire mesh explosion-proof network,如下图所示.This kind of stainless steel wire mesh contains a heating element.
This kind of mesh structure can prevent dust and other aerosols,Only allows the gaseous composition of the environment by.When we remove the sensor,We can see that it contains two major components.The first is the heating element,Made of nichrome wire,The second is the detection component,Consists of platinum wire,It has tin oxide.The diagram below shows the removed from the actual sensor grid.
After removed from the sensor grid,它看起来像这样.如上图所示,We're cutting stainless steel wire mesh and place it in the side of the sensor.Before we discuss the sensor has now also.Star sensor pin is six feet by building the connection to the sensor actual detection and heating element and the.You can also see made in order to promote thermal conductivity sensor of black bakelite base.
MQ-3 Transducer preheating time:
Use the alcoholSensors require a preheat or stability can make the equipment normal work.If you look at the equipment data sheet,You will notice that it needs to be 48 Hours of preheating period.It's said that must be turned on48Hours to use it?
对于这个问题,Clear answer is a resounding“否”.You must run continuously 48 The standards set by the hour to get the data in the table performance Numbers.48 Hours later in their lab for the test.所以,If you want to keep in the parameter range,就必须坚持48Hours of preheating time.Given the size of the sensor is moderate,Thermal equilibrium will undoubtedly in 30 分钟内达到.The data table and get what percentage Numbers may take a few minutes.
Only when you want to accurately measure the alcohol concentration,48 Hours of preheating period is necessary.You need a powerful sensor calibration and some methods to the correction of the other environmental conditions,如温度、湿度等.
MQ-3 Sensors can be used for the detection and measurement PPM The alcohol content.必须记住,Steam and measuring its detection in PPM The concentration of two very different things.The main focus of this article is to observe alcohol content and the increase of the concentration.If you would like to precise calculation PPM The alcohol content,The technology is a bit different;不过,We will briefly introduce.
如何使用 MQ-3 Sensors detect alcohol?
我们在上面的 gif One of the a IPA 的容器,When it is sprayed,The surrounding gas concentration increases.When we combine the second and third,Alcohol concentration increases again.The sensor's output voltage with the increase of alcohol concentration and increase the,This can be seen in the multimeter.When the module is more than a specific threshold(You can use the potentiometer control)时,Module on the green LED 会亮起.This can be in the us for demonstration purposes and contained in the module on the back of the photo to see.
如何使用 MQ-3 传感器测量 PPM The alcohol concentration?
This is a highly accurate sensor,Calibrated to detect alcohol that exist in the environment PPM;但是,要做到这一点,您必须首先了解 MQ-3 The sensitivity of the sensor features,可以在MQ3 The sensor data in the table to find,如下图所示.In the logarithmic graph,RS Is alcohol during the induction of resistance.而 R0 Is induced resistance of clean air.The sensor is designed to detect alcohol,Low sensitivity to the benzene,Therefore the sensor resistance will be according to the atmospheric concentrations of alcohol and change.
关于 MQ-3 Alcohol sensor module common problem
Q-1:MQ3 What sensors?
There are many gas detection sensor.This is a low cost semiconductor sensor can detect alcohol.MQ-3 Is suitable for the detection of alcohol、汽油、CH4、己烷、LPG、CO.
Q-2:MQ-3 What is the working voltage sensor?
MQ3 Alcohol sensor in 5V DC 下工作,功耗约为 800mW.It can detect the alcohol concentration in the range of parts per million 25 至 500 份 (ppm).
Q-3:MQ-3 How much is the sensor sensing range?
它可以检测0.05毫克/升到10毫克/Liters of alcohol gas concentration,Can also detect PPM25到500份(ppm)的酒精浓度.
Q-4:什么是 MQ 系列传感器?
MQ Gas sensor is a sensor can detect a variety of gas,包括酒精、烟雾、甲烷、液化石油气、氢气、NH3、Benzene and propane, etc.The sensor is composed of an electrode,The electrode is covered with a sensing material,The material is heated in order to increase the sensitivity and reactivity.
MQ-3 Sensor module internal circuit diagram
MQ-3 Alcohol detection sensor module circuit diagram as shown below.The module design is basic,Only need a few components can build.If you are eager to create this circuit,Below shows the schematic diagram is helpful.We have a in principle diagram LM393 运算放大器,它是一个 +5V The power can be driven low power consumption、低失调电压运算放大器.但是,由于 MQ-3 The lowest operating voltage of sensor is 5V,因此使用 3.3V For the power supply circuit is impossible.The operation features of primary amplifier converts the input analog signal to digital signal.除此之外,We have an integrated 10K 电位器,用于调节 MQ-3 Alcohol sensor module trigger voltage sensitivity.除此之外,还有两个 LED.电源 LED 是第一个,而触发 LED 是第二个.When powering a circuit board,电源 LED 亮起.When reach a certain specified threshold,触发 LED 亮起.最后,Board has two decoupling capacitor,有助于降低噪声.
Arduino Uno MQ-3 酒精传感器 - 连接图
现在我们知道了 MQ-3 The working principle of alcohol sensor,We can connect all the necessary wiring to Arduino Uno And see how it works.We'll start with analog components,And then into the digital part,这非常简单.
要使用传感器,We must first for its power supply.我们使用 Arduino UNO Board 的 5V 和 GND 引脚,The output of the sensor pin connected to Arduino 的 A0 引脚.我们已经将一个 LED 连接到 Arduino 的 PIN 6,Analog pin connected to Arduino 的 A0 引脚,The grounding pin in LED Between the sensor and share,如上图所示.我们将配置 Arduino,使 LED The brightness of the changes with alcohol concentration of environment
To read sensor digital components,Simply connect the sensor output to Arduino On any number of pin and check whether the pin is a high pulse;如果 Arduino Read high pulse,Alcohol is detected;如果 Arduino Read the low pulse,The environment there is no alcohol.
用于连接 MQ-3 The gas sensor module Arduino 代码
Arduino MQ-3 Alcohol sensor module code is very simple.We just read the simulated data from sensors and adjust LED The brightness to match the data.请记住,We are just in the treatment of simulated data from sensors;对于数字数据,模块的内置 LED 将亮起.
We define the four macro:The first two are we think awake and drunken value.The third is used in the sensor pin,The fourth is used to LED,When it lights up,Said there is alcohol.
#define Sober 150
#define Drunk 400
#define MQ3 0
#define ledPin 6
如您所知,Sensor heating a little is needed to provide accurate readings.This code to suspend all content and heat the sensor module 20 秒.
Serial.println("MQ3 Heating up!");
delay(20000);
After the completion of the heat,We began to read the data from sensor simulation of analog pin,And print the data on the serial monitor.As we have defined before waking and drunken value,We compare these values with real-time sensor value,To show whether a person drunk.
sensorValue = analogRead(MQ3); // read analog input pin 0
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
if (sensorValue < Sober) {
Serial.println(" | Status: Sober");
} else if (sensorValue >= Sober && sensorValue < Drunk) {
Serial.println(" | Status: Drinking but within legal limits");
} else {
Serial.println(" | Status: DRUNK");
有一个 LED 连接到引脚 6,We are generated with a sensor value corresponding to the PWM The signal to open LED.When the sensor value is greater than 150 时,LED Will begin to shine,由于我们通过 PWM 信号为 LED 供电,It will be increased with the increase of the sensor values increase its brightness.
unsigned int outputValue = map(sensorValue, 0, 1023, 0, 255);
if (sensorValue > 150){
analogWrite(ledPin, outputValue);
}
else{
digitalWrite(ledPin, LOW);
}
MQ-3 Sensor module work
When there is no alcohol environment,LED 熄灭,But when we provide a small amount of IPA 时,LED 会打开,Because we have to write the code to do so.The more alcohol that exist in the environment,LED 会越亮;When the concentration of alcohol in the air as 500 ppm 时,LED 会发光.
完整代码
#define Sober 200 // Define max value that we consider sober
#define Drunk 400 // Define min value that we consider drunk
#define MQ3 0
#define ledPin 6
float sensorValue; //variable to store sensor value
void setup() {
Serial.begin(9600); // sets the serial port to 9600
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
Serial.println("MQ3 Heating Up!");
delay(20000); // allow the MQ3 to warm up
}
void loop() {
sensorValue = analogRead(MQ3); // read analog input pin 0
Serial.print("Sensor Value: ");
Serial.print(sensorValue);
// Return analog moisture value
// Determine the status
if (sensorValue < Sober) {
Serial.println(" | Status: Sober");
} else if (sensorValue >= Sober && sensorValue < Drunk) {
Serial.println(" | Status: Drinking but within legal limits");
} else {
Serial.println(" | Status: DRUNK");
}
unsigned int outputValue = map(sensorValue, 0, 1023, 0, 255);
if (sensorValue > 700){
analogWrite(ledPin, outputValue); // generate PWM signal
}
else{
digitalWrite(ledPin, LOW);
}
return outputValue;
delay(2000); // wait 2s for next reading
}
边栏推荐
- 【plang1.4.3】编写水母动画脚本
- Pylon CLI 低成本的本地环境管控工具应用实例
- NSIS来自己设定快捷方式的图标
- Personal image bed construction based on Alibaba Cloud OSS+PicGo
- [Popular Science Post] I2C Communication Protocol Detailed Explanation - Partial Software Analysis and Logic Analyzer Example Analysis
- Arduino点亮数码管
- Type c PD 电路设计
- 振芯科技GM8285C:功能TTL转LVDS芯片简介
- 所有子字符串中的元音 —— LeetCode - 2063
- TQP3M9009电路设计
猜你喜欢
随机推荐
OneNET Studio与IoT Studio对比分析
龙芯2K1000使用nfs挂载文件系统进行使用
GM7150 CVBS转BT656视频解码芯片详细内容及设计要求
向龙芯2K1000板子上烧写中标麒麟系统
使用Vercel托管自己的网站
同时求最大值与最小值(看似简单却值得思考~)
进程(下):进程控制、终止、等待、替换
uniCloud通讯录实战
ICN6211:MIPI DSI转RGB视频转换芯片方案介绍 看完涨知识了呢
D类音频功放NS4110B电路设计
Arduino点亮数码管
AD8361检波器
LL(1)文法 :解决 if-else/if-else 产生式二义性问题
字符串匹配(蛮力法+KMP)
MPU6050 accelerometer and gyroscope sensor is connected with the Arduino
如何使用 PHP 实现网页交互
发布全新的配置格式 - AT
TC358860XBG BGA65 东芝桥接芯片 HDMI转MIPI
install 命令
I2C无法访问ATEC508A加密芯片问题