Giới thiệu Cảm biến MG811 đo khí CO2
Cảm biến MG811 đo khí CO2 có thể tùy chỉnh khuếch đại tín hiệu ngõ ra. Cảm biến MG-811 có độ nhạy cao với khí CO2 và độ nhạy thấp hơn với Alcohol và khí CO. Thích hợp cho môi trường không khí bình thường, quá trình lên men, môi trường khép kín, phòng thí nghiệm,… Điện áp ngõ ra của mạch tăng theo độ tăng của khí CO2.
Có chỉ báo đầu ra tín hiệu Đầu ra tín hiệu kép (đầu ra analog và đầu ra điện áp phẳng TTL);
Tín hiệu hợp lệ đầu ra TTL ở mức thấp. (Đèn tín hiệu bật khi đầu ra ở mức thấp và có thể kết nối trực tiếp với vi điều khiển) Đầu ra analog 0-2V. Độ nhạy cao và độ chọn lọc tốt đối với carbon dioxide;
Cảm biến không khí: MQ2 – MQ3 – MQ4 – MQ5 – MQ6 – MQ7 – MQ8 – MQ9 – MQ135 – MP2 – MP4 – MP135

Chức năng các chân
- VCC : Chân nguồn 5V
- GND : Chân nguồn 0V
- D0 : Chân đọc tín hiệu Digital.
- A0 : Chân đọc tín hiệu Analog.
Nguyên lý hoạt động cảm biến chất lượng không khí
Cảm biến phát hiện chất lượng khí CO2 MG811 hoạt động dựa trên nguyên lý phản ứng hóa học khi tiếp xúc các khí trong môi trường. Nguyên tắc hoạt động của nó là khi các khí trong môi trường như khí CO2 tiếp xúc với phần tử bên trong cảm biến, làm cho các electron được giải phóng vào Thiếc Dioxide cho phép dòng điện chạy qua cảm biến một cách tự do.
Khi được làm nóng, phần tử cảm biến sẽ tạo ra phản ứng hóa học với các khí tiếp xúc và làm thay đổi điện trở của phần tử cảm biến. Cảm biến MG811 đo lường các biến đổi điện trở này và chuyển đổi chúng thành tín hiệu điện analog hoặc Digital.

Thông số kỹ thuật Cảm biến MG811 đo khí CO2
- Điện áp hoạt động: 5V DC.
- Đầu ra Analog: 0 – 2V.
- Dải đo khí CO2: 0 – 10000ppm.
- Ngõ ra tín hiệu tương tự và số.
- Có led báo mạch hoạt động và led báo nguồn.
- Tốc độ hồi đáp và độ nhạy cao, chạy ổn định, tuổi thọ dài.
- Thích hợp với các ứng dụng có sử dụng vi điều khiển.
- Kích thước: 31 mm X 22mm X 29mm.
Chương trình Test sản phẩm
Nguyên lý kết nối

Chương trình
/*******************Demo for MG-811 Gas Sensor Module V1.1*****************************
Lisence: Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)
Note: This piece of source code is supposed to be used as a demostration ONLY. More
sophisticated calibration is required for industrial field application.
/************************Hardware Related Macros************************************/
#define MG_PIN (A0) //define which analog input channel you are going to use
#define BOOL_PIN (2)
#define DC_GAIN (8.5) //define the DC gain of amplifier
/***********************Software Related Macros************************************/
#define READ_SAMPLE_INTERVAL (50) //define how many samples you are going to take in normal operation
#define READ_SAMPLE_TIMES (5) //define the time interval(in milisecond) between each samples in
//normal operation
/**********************Application Related Macros**********************************/
//These two values differ from sensor to sensor. user should derermine this value.
#define ZERO_POINT_VOLTAGE (0.220) //define the output of the sensor in volts when the concentration of CO2 is 400PPM
#define REACTION_VOLTGAE (0.030) //define the voltage drop of the sensor when move the sensor from air into 1000ppm CO2
/*****************************Globals***********************************************/
float CO2Curve[3] = {2.602,ZERO_POINT_VOLTAGE,(REACTION_VOLTGAE/(2.602-3))};
//two points are taken from the curve.
//with these two points, a line is formed which is
//"approximately equivalent" to the original curve.
//data format:{ x, y, slope}; point1: (lg400, 0.324), point2: (lg4000, 0.280)
//slope = ( reaction voltage ) / (log400 –log1000)
void setup()
{
Serial.begin(9600); //UART setup, baudrate = 9600bps
pinMode(BOOL_PIN, INPUT); //set pin to input
digitalWrite(BOOL_PIN, HIGH); //turn on pullup resistors
Serial.print("MG-811 Demostration\n");
}
void loop()
{
int percentage;
float volts;
volts = MGRead(MG_PIN);
Serial.print( "SEN0159:" );
Serial.print(volts);
Serial.print( "V " );
percentage = MGGetPercentage(volts,CO2Curve);
Serial.print("CO2:");
if (percentage == -1) {
Serial.print( "<400" );
} else {
Serial.print(percentage);
}
Serial.print( "ppm" );
Serial.print("\n");
if (digitalRead(BOOL_PIN) ){
Serial.print( "=====BOOL is HIGH======" );
} else {
Serial.print( "=====BOOL is LOW======" );
}
Serial.print("\n");
delay(500);
}
/***************************** MGRead *********************************************
Input: mg_pin - analog channel
Output: output of SEN-000007
Remarks: This function reads the output of SEN-000007
************************************************************************************/
float MGRead(int mg_pin)
{
int i;
float v=0;
for (i=0;i<READ_SAMPLE_TIMES;i++) {
v += analogRead(mg_pin);
delay(READ_SAMPLE_INTERVAL);
}
v = (v/READ_SAMPLE_TIMES) *5/1024 ;
return v;
}
/***************************** MQGetPercentage **********************************
Input: volts - SEN-000007 output measured in volts
pcurve - pointer to the curve of the target gas
Output: ppm of the target gas
Remarks: By using the slope and a point of the line. The x(logarithmic value of ppm)
of the line could be derived if y(MG-811 output) is provided. As it is a
logarithmic coordinate, power of 10 is used to convert the result to non-logarithmic
value.
************************************************************************************/
int MGGetPercentage(float volts, float *pcurve)
{
if ((volts/DC_GAIN )>=ZERO_POINT_VOLTAGE) {
return -1;
} else {
return pow(10, ((volts/DC_GAIN)-pcurve[1])/pcurve[2]+pcurve[0]);
}
}
Tham khảo chương trình mẫu và thông tin linh kiện chi tiết tại:

Màn hình LCD2004 Xanh lá, Màn hình hiển thị Text
Màn hình LCD1604 Xanh dương, Màn hình hiển thị Text
CẢM BIẾN TỪ CỬA MC-38, CÔNG TẮC TỪ GẮN CỬA
Còi hú SFM-27 kêu liên tục 3-24V, Buzzer tai thỏ SFM-27
TỤ ĐIỆN KHÔNG PHÂN CỰC 102/2KV, TỤ GỐM 1nF - 10 CON
CẢM BIẾN QUANG HỒNG NGOẠI E3F-DS30C4 NPN, THƯỜNG MỞ NPN 10-30VDC
Khóa chốt điện từ LY-01 24VDC Thường, Khóa chốt cửa điện từ
Bạc đạn ngang KFL08 8mm, Gối đỡ vòng bi trục ngang
ĐỘNG CƠ STEP 5V + ULN2003 V1, BỘ ĐIỀU KHIỂN DC BƯỚC
PIC18F4520 DIP, VI ĐIỀU KHIỂN HỌ PIC CỦA MICROCHIP 

















Đánh giá
Chưa có đánh giá nào.