Interfacing ASAIR AGS02MA TVOC Sensor with Arduino

Learn how to interface the Asair AGS02MA compact TVOC (Total Volatile Organic Compounds) sensor with Arduino boards to measure air quality.

Interfacing ASAIR AGS02MA TVOC Sensor with Arduino Featured Image by CIRCUITSTATE Electronics

When it comes to environmental monitoring, there are many parameters you need to measure and track accurately. Among this includes the TVOC (Total Volatile Organic Compounds) in the air. This is in addition to temperature, humidity, particulate matter and other gases. Volatile organic compounds are easily evaporated and fill the ambient air. The source of these compounds can be natural or artificial. Usually these compounds are found as a mixture of multiple compounds. Measuring them is an important step in understanding the quality of air we breath. Thanks for low cost sensors, we can measure them relatively easily. In this tutorial, we will introduce you the AGS02MA TVOC sensor from Asair. You will learn how you can interface this sensor with any of your Arduino microcontroller boards.

VOC

Volatile Organic Compounds are substances that transform to gases or fine particles in the normal environment. This process causes the ambient air to also contains these compounds in addition to regular gases (Oxygen, Nitrogen etc.), water vapour and dust. The types and amount of VOCs in the air vary with place to place. They can be of natural origin or form due to human activities. For example, all types of glues we use contain some type of compounds that are volatile in nature. These compounds evaporate and fill the nearby air when exposed. This is what causes the smell when we open glue or paint containers. Common VOCs include the following as per Department of Health, Minnesota, USA,

  • Ethanol – Drinking alcohol.
  • Acetone – Used as a common solvent.
  • Benzene – Found in petroleum products.
  • Acetic Acid – Vinegar
  • Ethylene Glycol – Found in paints, solvents and industrial fluids.
  • Butanal – Found in building materials.
  • Formaldehyde – Found in building materials.
  • Methylene Chloride – Found in building materials.
  • Tetrachloroethylene – Used for dry cleaning.
  • Toluene – Found in paints and glues.
  • Xylene – Found in adhesives.
  • 1,3-Butadiene – Found in synthetic rubber.
Index CategoryIndex ValueTVOC (ppb)
Good0-500-220
Moderate51-100221-660
High101-150661-1430
Very High151-2001431-2200
Very High201-3002201-3300
Very High301-5003301-5500
A rule-of-thumb safety level chart of TVOCs used by Kaiterra. Source: Kaiterra

Almost all VOCs are hazardous for human health in the right quantities. For this reason, indoor and outdoor air quality indicators usually also include the amount of VOCs present in the air. Since there can be many different types of VOCs in the air, in different densities, measuring all of them individually can be not practical always. To overcome that issue, VOCs are measured as a common gas mixture and indicated by the amount of Total VOC (TVOC). The AGS02MA sensor is a TVOC sensor.

AGS02MA

Asair AGS02MA TVOC Sensor Top and Bottom by CIRCUITSTATE Electronics
Asair AGS02MA TVOC sensor top and bottom sides

AGS02MA is one of the many low-cost TVOC sensors you can find in the market. The company behind it, Asair makes other air quality and environmental sensors as well. The AGS02MA comes enclosed a plastic case with a mesh opening. This prevents damaging the sensor accidentally. We opened one sensor to show you how it looks inside.

The following image shows the working principle of the TVOC sensor. A TVOC sensitive material is fabricated on a micro-thermal substrate. This substrate can raise the temperature of the sensitive material to the working temperature. The TVOC sensitive material has high resistance (low conductivity) when the air is clean. When the density of the TVOC rises, this causes the sensor to conduct more current. We can measure the change in this resistance and estimate the density of the TVOC in the air. The TVOC density is reported as Parts Per Billion (PPB).

TVOC Sensor Working Principle Illustration CIRCUITSTATE Electronics
TVOC sensor working principle

The sensor has four pins, two for power supply and two for I2C communication. The sensor is pre-calibrated and works out of the box. If the sensor was stored for long duration, you will need to “age” it before you can get accurate measurements. The sensor costs only around INR 150 and if you are in India, you can get them from places like Robu. Let’s check the specification of the sensor.

Specifications

ModelAGS02MA
Operating Voltage3.3~5.5V DC
Operating Current28 ±5mA
Typical Power Consumption98mW @ 3.3V, 130mW @ 5V
Sampling Period≥ 25
Output ModeI2C (<30 KHz)
Preheating Time≥ 120 s
Operating Temperature0~50°C
Operating Humidity0~95%RH
Life Span>5 years (@25°C, Clean Air)
Sensor CategorySemiconductor Sensor
Measuring Range0~99999 ppb
Typical Accuracy (25°C/50%RH)25% Reading
Standard Test GasEthanol

Pinout

Asair AGS02MA TVOC Sensor Pinout CIRCUITSTATE Electronics
Asair AGS02MA sensor pinout
#PinNameFunction
1VDDPower Input
2SDASerial Data
3GNDGround
4SCLSerial Clock

Dimensions

Asair AGS02MA TVOC Sensor Dimensions Mechanical Drawing by CIRCUITSTATE Electronics
Asair AGS02MA dimensions

Wiring

We will use the FireBeetle-ESP32E board for interfacing the sensor. Connecting the AGS02MA to the ESP32 board is easy. You just need to supply the power and connect the I2C pins to the I2C interface of the microcontroller. Wire them up the following way.

AGS02MAFireBeetle-ESP32E
#PinName#PinGPIO
1VDD3V3
2SDASDAGPIO21
3GNDGND
4SCLSCLGPIO22

If you are using a 5V microcontroller, supply 5V for the sensor also. The sensor works reliably between 3.3V to 5.5V. But it is not recommended to exceed the 5V level. The sensor does not have on-board I2C pull-ups. Therefore, we need to add them externally. We are using a breadboard to connect everything. One particular limitation of the sensor is that its maximum data rate is limited to 30 KHz. Above this speed, the sensor won’t respond reliably. Also keep this in mind.

Asair AGS02MA TVOC Sensor Wiring with FireBeetle-ESP32E by CIRCUITSTATE Electronics
Wiring AGS02MA with DFRobot FireBeetle-ESP32E board on a breadboard

Code

We are going to use the Adafruit AGS02MA Arduino library for reading the measurements from the TVOC sensor. We will use the FireBeetle-ESP32E microcontroller board for this demo and create the project using PlatformIO and VS Code. Following is the main.cpp file.

//======================================================================================//

#include <Arduino.h>
#include <Adafruit_AGS02MA.h>

//======================================================================================//
// Global variables

Adafruit_AGS02MA ags; // Create a new sensor object.

//======================================================================================//
// Forward declarations

bool initAGS02MA();
void readTVOC();

//======================================================================================//

void setup() {
  Serial.begin (115200);
  Serial.println();
  Serial.println ("AGS02MA - TVOC Sensor Example");
  Serial.println();

  initAGS02MA();
}

//======================================================================================//

bool initAGS02MA() {
  Serial.println (F("initAGS02MA [INFO]: Initializing AGS02MA sensor.."));
  if (!ags.begin (&Wire, 0x1A)) {
    Serial.println ("initAGS02MA [ERROR]: Couldn't find the AGS20MA sensor. Check your wiring and pull-up resistors.");
    while (1) yield();
  }

  if (ags.getFirmwareVersion() == 0) {
    Serial.println (F("initAGS02MA [ERROR]: Could not read firmware version."));
    while (1) yield();
  }

  Serial.print ("initAGS02MA [INFO]: Firmware version = 0x");
  Serial.println (ags.getFirmwareVersion(), HEX);
  Serial.println();

  ags.printSensorDetails();
  return true;
}

//======================================================================================//

void loop() {
  readTVOC();
  delay (100);
}

//======================================================================================//

void readTVOC() {
  static uint32_t sensorStartTime = 0;

  if (sensorStartTime == 0) { // Check the sensor start time
    sensorStartTime = millis();
    return;
  }

  // Check if the pre-heating time has passed.
  uint32_t timeElapsed = millis() - sensorStartTime;

  // If the sensor is not ready, return without printing anything.
  if (timeElapsed < (120 * 1000)) {
    Serial.print (F("readTVOC [INFO]: Sensor is not ready ("));
    Serial.print (120 - (timeElapsed / 1000));
    Serial.println (F(" s)"));
    return;
  }

  // Start reading the sensor.
  uint32_t resistance = ags.getGasResistance();
  uint32_t tvoc = ags.getTVOC();
  
  if (resistance == 0) {
    Serial.println (F("readTVOC [ERROR]: Failure reading resistance."));
  }
  else {
    float kohm = resistance / 1000.0;
    Serial.print (F("Gas Resistance = "));
    Serial.print (kohm);
    Serial.println (" KOhms");
  }

  if (tvoc == 0) {
    Serial.println (F("readTVOC [ERROR]: Failure reading TVOC."));
  }
  else {
    Serial.print (F("TVOC = "));
    Serial.print (tvoc);
    Serial.println (" ppb");
  }
}

//======================================================================================//
main.cpp

Following is the platformio.ini configuration file.

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
lib_deps = 
  Adafruit_AGS02MA=https://github.com/adafruit/Adafruit_AGS02MA.git
platformio.ini

Following is the compilation and upload log.

Executing task: C:\PIO\penv\Scripts\platformio.exe run --target upload 


Processing esp32doit-devkit-v1 (platform: espressif32; board: esp32doit-devkit-v1; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32doit-devkit-v1.html
PLATFORM: Espressif 32 (6.10.0) > DOIT ESP32 DEVKIT V1
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20017.241212+sha.dcc1105b 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 38 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit AGS02MA @ 1.0.2+sha.71128a5
Building in release mode
Compiling .pio\build\esp32doit-devkit-v1\src\main.cpp.o
Building .pio\build\esp32doit-devkit-v1\bootloader.bin
Generating partitions .pio\build\esp32doit-devkit-v1\partitions.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 1 ELF section
Successfully created esp32 image.
Compiling .pio\build\esp32doit-devkit-v1\lib265\Wire\Wire.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib2bb\SPI\SPI.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib0cd\Adafruit BusIO\Adafruit_BusIO_Register.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib0cd\Adafruit BusIO\Adafruit_GenericDevice.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib0cd\Adafruit BusIO\Adafruit_I2CDevice.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib0cd\Adafruit BusIO\Adafruit_SPIDevice.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\liba94\Adafruit Unified Sensor\Adafruit_Sensor.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\lib39c\Adafruit_AGS02MA\Adafruit_AGS02MA.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\HWCDC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\IPv6Address.cpp.o
Archiving .pio\build\esp32doit-devkit-v1\lib265\libWire.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Print.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\USB.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\USBCDC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\USBMSC.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\WString.cpp.o
Archiving .pio\build\esp32doit-devkit-v1\lib2bb\libSPI.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\base64.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-cpu.c.o
Indexing .pio\build\esp32doit-devkit-v1\lib2bb\libSPI.a
Indexing .pio\build\esp32doit-devkit-v1\lib265\libWire.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-i2c-slave.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-matrix.c.o
Archiving .pio\build\esp32doit-devkit-v1\lib0cd\libAdafruit BusIO.a
Archiving .pio\build\esp32doit-devkit-v1\liba94\libAdafruit Unified Sensor.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-misc.c.o
Indexing .pio\build\esp32doit-devkit-v1\lib0cd\libAdafruit BusIO.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-rgb-led.c.o
Indexing .pio\build\esp32doit-devkit-v1\liba94\libAdafruit Unified Sensor.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-spi.c.o
Archiving .pio\build\esp32doit-devkit-v1\lib39c\libAdafruit_AGS02MA.a
Indexing .pio\build\esp32doit-devkit-v1\lib39c\libAdafruit_AGS02MA.a
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-time.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-tinyusb.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-touch.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\firmware_msc_fat.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\libb64\cdecode.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\libb64\cencode.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\main.cpp.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\stdlib_noniso.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\esp32doit-devkit-v1\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\esp32doit-devkit-v1\libFrameworkArduino.a
Indexing .pio\build\esp32doit-devkit-v1\libFrameworkArduino.a
Linking .pio\build\esp32doit-devkit-v1\firmware.elf
Retrieving maximum program size .pio\build\esp32doit-devkit-v1\firmware.elf
Checking size .pio\build\esp32doit-devkit-v1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   6.7% (used 21808 bytes from 327680 bytes)
Flash: [==        ]  22.2% (used 291177 bytes from 1310720 bytes)
Building .pio\build\esp32doit-devkit-v1\firmware.bin
esptool.py v4.5.1
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM8
Uploading .pio\build\esp32doit-devkit-v1\firmware.bin
esptool.py v4.5.1
Serial port COM8
Connecting.....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: e0:5a:1b:55:d1:bc
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00057fff...
Compressed 17536 bytes to 12202...
Writing at 0x00001000... (100 %)
Wrote 17536 bytes (12202 compressed) at 0x00001000 in 0.6 seconds (effective 220.9 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 332.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 482.4 kbit/s)...
Hash of data verified.
Compressed 291536 bytes to 162747...
Writing at 0x00010000... (10 %)
Writing at 0x0001bae5... (20 %)
Writing at 0x000246bd... (30 %)
Writing at 0x00029e16... (40 %)
Writing at 0x0002f47e... (50 %)
Writing at 0x000346cb... (60 %)
Writing at 0x0003aa14... (70 %)
Writing at 0x00044fe8... (80 %)
Writing at 0x0004c859... (90 %)
Writing at 0x00051d90... (100 %)
Wrote 291536 bytes (162747 compressed) at 0x00010000 in 3.8 seconds (effective 610.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
============================================ [SUCCESS] Took 11.88 seconds ============================================
 *  Terminal will be reused by tasks, press any key to close it.
Terminal

After uploading the code, you can open the serial monitor to see the measurements. The sensor requires a pre-heating time of at least 120 seconds. The data read during the pre-heating period is unreliable. The code checks if the pre-heating time is elapsed and only starts to print the measurements after that. It actually takes around 5 minutes for the reading to settle and become practically reliable. The sensor measurements start a higher value initially, and slowly decreases with time. After some time, the value stabilizes. Following is the data from our serial monitor. This test was performed inside a room with air conditioning set to 24 °C and a PM2.5 value of 3 ug/m3.

---- Opened the serial port COM8 ----
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4

AGS02MA - TVOC Sensor Example

initAGS02MA [INFO]: Initializing AGS02MA sensor..
initAGS02MA [INFO]: Firmware version = 0x15020376

------------------------------------
Sensor:       AGS02MA
Type:         Total Volatile Organic Compounds (ppb)
Driver Ver:   1
Unique ID:    0
Min Value:    0.00
Max Value:    99999.00
Resolution:   1.00
------------------------------------

readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (120 s)
readTVOC [INFO]: Sensor is not ready (119 s)
readTVOC [INFO]: Sensor is not ready (119 s)
readTVOC [INFO]: Sensor is not ready (119 s)
[Extra lines removed]
Gas Resistance = 6121.60 KOhms
TVOC = 47 ppb
Gas Resistance = 6142.50 KOhms
TVOC = 47 ppb
Gas Resistance = 6153.60 KOhms
TVOC = 47 ppb
Gas Resistance = 6133.10 KOhms
TVOC = 47 ppb
Gas Resistance = 6147.90 KOhms
TVOC = 47 ppb
Gas Resistance = 6152.70 KOhms
TVOC = 47 ppb
Gas Resistance = 6170.40 KOhms
TVOC = 46 ppb
Gas Resistance = 6182.60 KOhms
TVOC = 46 ppb
Serial Monitor

The value settled to around 47 ppb after a 30 mins of operation. If you are going to use a fresh sensor, the initial readings may be very high. Connect the sensor to the microcontroller and run the example for a few hours. The sensor should go through the “ageing” process and become reliable enough for normal operation. If you have any difficulty in using this sensor, please let us know in the comments. If you are new PlatformIO and VS Code, please check out our following tutorials. Happy coding 🖥️

How-To-Use-VS-Code-To-Create-and-Upload-Arduino-Sketches-Featured-Image-01-1-1

How to Use VS Code for Creating and Uploading Arduino Sketches

Learn how to use the popular VS Code IDE to develop Arduino projects and upload your sketches to Arduino boards directly, without using Arduino IDE.
Getting Started with Platform IDE with VS Code for Embedde Software Development Featured Image CIRCUITSTATE Electronics

Getting Started with PlatformIO – Unified IDE for Embedded Software Development

Learn how to use the PlatformIO unified ecosystem for embedded software development with the help of modern Visual Studio Code IDE.
  1. ASAIR AGS02MA – Product Page
  2. ASAIR AGS02MA – Datasheet [PDF]
  3. ASAIR AGS02MA – User Manual [PDF]
  4. Buy Asair AGS02MA – Robu

Share to your friends
Vishnu Mohanan

Vishnu Mohanan

Founder and CEO at CIRCUITSTATE Electronics

Articles: 99

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.