AGS10 Hazardous Gas Sensor
The AGS10 is a MEMS TVOC sensor that uses a digital signal output. It is equipped with a dedicated digital module acquisition technology and gas sensing technology, ensuring the product's high reliability and excellent long-term stability. Additionally, it features low power consumption, high sensitivity, fast response, low cost, and simple driving circuitry.
Module Source
Purchase Link: https://item.taobao.com/item.htm?spm=a21n57.1.0.0.148e523cqcVeUq&id=709434114260&ns=1&abbucket=8#detail
Resource Download:
INFO
Specifications
Operating Voltage: 3.0-6.0 V
Typical Power: 75mW
Sampling Period: ≥2s
Interface Rate: I2C Slave Mode(≤15kHz)
Preheating Time: ≥120s
Operating Temperature: 0~50℃
Operating Humidity: 0~95%RH
Lifetime: >5 years (at 25℃ in clean air)
Output Unit: ppb
Measurement Range:0~99999 ppb
Typical Accuracy (25℃/50%RH): 25% of reading
Standard Test Gas: Ethanol
Module Size: 15*10.6mm
Hardware Connection
AGS10 -> development board pin
VCC -> 3.3V
GND -> GND
SDA -> A4 (SDA)
SCL -> A5 (SCL)
2
3
4
5
Usage Method
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: April 11, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
#include <Wire.h>
#define DEVICE_ADDRESS 0X34>>1
#define DATA_ADDRESS 0X00
void setup() {
// 初始化串行通信
Serial.begin(9600);
// 初始化I2C通信
Wire.begin();
}
void loop() {
// 发起I2C读取传感器数据的请求
Wire.beginTransmission(DEVICE_ADDRESS); // AGS01DB的I2C地址,可能需要根据实际情况调整
Wire.write(byte(DATA_ADDRESS));
if (Wire.endTransmission() != 0) Serial.println("No sensor was detected"); // 检查ACK,非0值表示出错
Wire.endTransmission(); // 结束传输,准备读取数据
// 读取数据
Wire.requestFrom(DEVICE_ADDRESS, 5); // 请求2字节长度的数据
if(Wire.available() == 5) {
byte data1 = Wire.read(); // 读取第一个字节
byte data2 = Wire.read(); // 读取第二个字节
byte data3 = Wire.read(); // 读取第三个字节
byte data4 = Wire.read(); // 读取第四个字节
byte data5 = Wire.read(); // 读取第五个字节
// 处理和组合数据
int gasConcentration = (data2 << 16) | (data3<<8) | data4;
// 打印结果
Serial.print("TVOC气体浓度: ");
Serial.println(gasConcentration);
}
delay(1000); // 稍作延时再次读取
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50