[Diao Ye learns programming] Arduino hands-on (37) - the actual test situation of the MQ-3 ethanol flammable gas alcohol sensor module

insert image description here

The reference to 37 sensors and modules has been widely circulated on the Internet. In fact, there must be more than 37 sensor modules compatible with Arduino. In view of the fact that I have accumulated some sensors and modules on hand, according to the concept of true knowledge (must be done by hands), for the purpose of learning and communication, I am going to try and do experiments one by one here, and will record them whether they are successful or not—Xiao Xiao The progress or problems that cannot be solved, I hope to be able to throw bricks and spark jade.

[Arduino] 108 sensor module series experiments (data + code + graphics + simulation)
experiment thirty-seven MQ-3 alcohol sensor module ethanol flammable gas sensitive gas high-sensitivity detection alarm sensor probe

insert image description here
insert image description here

insert image description here

insert image description here
insert image description here
insert image description here

Wiring diagram of Arduino experiment

insert image description here
insert image description here

A very simple test program, read the serial port data, look at the experimental waveform
Arduino experimental open source code

/*
  【Arduino】108种传感器模块系列实验(资料+代码+图形+仿真)
  实验三十七:MQ-3酒精乙醇传感器模块(半导体式表面电阻控制型)
*/

void setup()
{
    
    
  Serial.begin(9600);
  pinMode(A0, INPUT);
}

void loop()
{
    
    
  Serial.println(analogRead(A0));
  delay(200);
}

The serial port data after preheating is around 250

insert image description here

Afterwards, the number output by the serial port kept dropping, and stabilized at around 75 in about ten minutes.

insert image description here

The experiment used 75% household disinfectant alcohol

insert image description here

This module is indeed very sensitive to alcohol, the highest rises to more than 800

insert image description here

After tightening the cap of the alcohol bottle, the data has a slow decline process

insert image description here

insert image description here

Sprinkle a little alcohol on the ground, and it can be detected, the data range is much smaller

insert image description here

A visual alarm program for detecting alcohol concentration, the current steady state data is at 68

insert image description here

When an excessive alcohol concentration (greater than 400) is detected, the alarm light is on

insert image description here
[Arduino] 108 kinds of sensor module series experiments (data + code + graphics + simulation)
experiment 37: MQ-3 alcohol ethanol sensor module (semiconductor surface resistance control type) the second
Arduino experiment open source code

/*
  【Arduino】108种传感器模块系列实验(资料+代码+图形+仿真)
  实验三十七:MQ-3酒精乙醇传感器模块(半导体式表面电阻控制型)之二
*/

int Buzzer = 8;  // 定义数字口8 为Buzzer (蜂鸣器)

void setup()
{
    
    
  pinMode(Buzzer, OUTPUT);  // 定义数字口8 为输出模式
  Serial.begin(9600);
}

void loop()
{
    
    
  int val;
  val = analogRead(A0);
  Serial.println(val, DEC);
  while (val < 400)
  {
    
    
    digitalWrite(Buzzer, LOW); //蜂鸣器不响
    val = analogRead(A0);
    Serial.println(val, DEC);
  }
  digitalWrite(Buzzer, HIGH); // 蜂鸣器响
}
/*
  【Arduino】108种传感器模块系列实验(资料+代码+图形+仿真)
  实验三十七:MQ-3酒精乙醇传感器模块(半导体式表面电阻控制型)之三
*/

const int gasSensor = 0;

void setup() {
    
    
  Serial.begin(9600);      // sets the serial port to 9600
}

void loop() {
    
    
  float voltage;
  voltage = getVoltage(gasSensor);

  Serial.println(voltage);
  delay(1000);
}

float getVoltage(int pin) {
    
    
  return (analogRead(pin) * 0.004882814);
  // This equation converts the 0 to 1023 value that analogRead()
  // returns, into a 0.0 to 5.0 value that is the true voltage
  // being read at that pin.
}

Arduino experiment scene diagram

insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_41659040/article/details/132507160