Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use TGS822 Gas Sensor: Examples, Pinouts, and Specs

Image of TGS822 Gas Sensor
Cirkit Designer LogoDesign with TGS822 Gas Sensor in Cirkit Designer

Introduction

The TGS822 is a gas sensor designed to detect various combustible gases, including methane, propane, and other hydrocarbons. It operates on the principle of resistive change, where the sensor's resistance varies in the presence of target gases. This makes it an ideal choice for applications such as gas leak detection, air quality monitoring, and industrial safety systems. Its compact design and high sensitivity make it suitable for both consumer and industrial use.

Explore Projects Built with TGS822 Gas Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Battery-Powered MQ-2 Gas Sensor with Alert Buzzer
Image of gas detect: A project utilizing TGS822 Gas Sensor in a practical application
This is a simple gas detection alarm system that uses an MQ-2 sensor to detect gas presence and sound a buzzer when gas is detected. It is powered by a rechargeable 18650 battery, with a TP4056 module for battery management and charging. A rocker switch is used to control the power to the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Based Gas Detection System with LCD Display and SD Card Logging
Image of Gas detector booooot: A project utilizing TGS822 Gas Sensor in a practical application
This circuit is a gas detection system that uses multiple gas sensors (MQ-7, MQ-135, MQ-4, and MH-Z19B) to measure concentrations of various gases. The Arduino UNO processes the sensor data, displays the readings on a 16x2 I2C LCD screen, and logs the data to a micro SD card. Additionally, a DS3231 RTC module provides timestamping for the logged data.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring System with Multiple Sensors and OLED Display
Image of meat_spoilage: A project utilizing TGS822 Gas Sensor in a practical application
This circuit is an environmental monitoring system that uses an ESP32 microcontroller to collect data from various sensors, including gas sensors (MQ-135, MQ-136), a humidity and temperature sensor (DHT11), a VOC and NOx sensor (SGP41), and a color sensor (TCS230). The collected data is displayed on an OLED screen and can be transmitted via Bluetooth, with the ESP32 also handling RF signal decoding and transmission.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Gas Detection System with Wi-Fi Notification
Image of Autonomous gas monitoring: A project utilizing TGS822 Gas Sensor in a practical application
This circuit is a gas detection system using an ESP32 microcontroller connected to three gas sensors (MQ2, MQ-4, and MQ-7). The ESP32 reads both digital and analog signals from the sensors to monitor gas levels and sends notifications via Blynk if any gas concentration exceeds a predefined threshold.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with TGS822 Gas Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of gas detect: A project utilizing TGS822 Gas Sensor in a practical application
Battery-Powered MQ-2 Gas Sensor with Alert Buzzer
This is a simple gas detection alarm system that uses an MQ-2 sensor to detect gas presence and sound a buzzer when gas is detected. It is powered by a rechargeable 18650 battery, with a TP4056 module for battery management and charging. A rocker switch is used to control the power to the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Gas detector booooot: A project utilizing TGS822 Gas Sensor in a practical application
Arduino-Based Gas Detection System with LCD Display and SD Card Logging
This circuit is a gas detection system that uses multiple gas sensors (MQ-7, MQ-135, MQ-4, and MH-Z19B) to measure concentrations of various gases. The Arduino UNO processes the sensor data, displays the readings on a 16x2 I2C LCD screen, and logs the data to a micro SD card. Additionally, a DS3231 RTC module provides timestamping for the logged data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of meat_spoilage: A project utilizing TGS822 Gas Sensor in a practical application
ESP32-Based Environmental Monitoring System with Multiple Sensors and OLED Display
This circuit is an environmental monitoring system that uses an ESP32 microcontroller to collect data from various sensors, including gas sensors (MQ-135, MQ-136), a humidity and temperature sensor (DHT11), a VOC and NOx sensor (SGP41), and a color sensor (TCS230). The collected data is displayed on an OLED screen and can be transmitted via Bluetooth, with the ESP32 also handling RF signal decoding and transmission.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Autonomous gas monitoring: A project utilizing TGS822 Gas Sensor in a practical application
ESP32-Based Gas Detection System with Wi-Fi Notification
This circuit is a gas detection system using an ESP32 microcontroller connected to three gas sensors (MQ2, MQ-4, and MQ-7). The ESP32 reads both digital and analog signals from the sensors to monitor gas levels and sends notifications via Blynk if any gas concentration exceeds a predefined threshold.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications:

  • Gas leak detection in residential and industrial environments
  • Air quality monitoring systems
  • Combustible gas detection in HVAC systems
  • Safety systems in kitchens and laboratories

Technical Specifications

Key Technical Details:

Parameter Value
Target Gases Methane, Propane, Combustible Gases
Operating Voltage 5V DC
Heater Voltage (VH) 5V DC
Heater Resistance (RH) 33Ω ± 5Ω
Heater Power Consumption ~350mW
Sensing Resistance (RS) 10kΩ to 100kΩ (in clean air)
Operating Temperature -10°C to 50°C
Humidity Range 30% to 95% RH (non-condensing)
Response Time ≤ 30 seconds
Dimensions 16mm diameter, 17mm height

Pin Configuration and Descriptions:

The TGS822 gas sensor has six pins, as described in the table below:

Pin Number Label Description
1 H1 Heater pin 1 (connect to 5V DC)
2 A Sensing element pin (connect to load resistor)
3 B Sensing element pin (connect to load resistor)
4 H2 Heater pin 2 (connect to ground)
5, 6 NC Not connected (leave unconnected)

Usage Instructions

How to Use the TGS822 in a Circuit:

  1. Power the Heater: Connect pin H1 to a 5V DC power supply and pin H2 to ground. This powers the internal heater, which is necessary for the sensor to operate.
  2. Connect the Sensing Element:
    • Connect a load resistor (typically 10kΩ) between pin A and ground.
    • Connect pin B to the positive terminal of the power supply (5V DC).
    • The voltage across the load resistor will vary depending on the concentration of the target gas.
  3. Read the Output: Measure the voltage across the load resistor using an analog input pin of a microcontroller or an ADC (Analog-to-Digital Converter). This voltage corresponds to the gas concentration.

Important Considerations:

  • Preheating: Allow the sensor to preheat for at least 24 hours before taking accurate measurements. This stabilizes the sensor's internal resistance.
  • Calibration: Calibrate the sensor in a clean air environment to determine the baseline resistance (RS in clean air).
  • Ventilation: Ensure proper ventilation around the sensor to avoid saturation and ensure accurate readings.
  • Load Resistor Selection: The value of the load resistor affects the sensitivity and output range. A 10kΩ resistor is commonly used, but this can be adjusted based on the application.

Example Code for Arduino UNO:

// TGS822 Gas Sensor Example Code for Arduino UNO
// This code reads the analog voltage from the sensor and prints it to the Serial Monitor.

const int sensorPin = A0; // Analog pin connected to the sensor's output
const int heaterPin = 9;  // Digital pin to control the heater (optional)

void setup() {
  Serial.begin(9600);       // Initialize serial communication at 9600 baud
  pinMode(heaterPin, OUTPUT); // Set heater pin as output
  digitalWrite(heaterPin, HIGH); // Turn on the heater
}

void loop() {
  int sensorValue = analogRead(sensorPin); // Read the analog value from the sensor
  float voltage = sensorValue * (5.0 / 1023.0); // Convert to voltage (5V reference)
  
  // Print the sensor value and voltage to the Serial Monitor
  Serial.print("Sensor Value: ");
  Serial.print(sensorValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage);
  Serial.println(" V");
  
  delay(1000); // Wait for 1 second before the next reading
}

Notes:

  • The heater can be powered directly from the 5V pin of the Arduino if the current draw is within limits.
  • Ensure the sensor is placed in a well-ventilated area for accurate readings.

Troubleshooting and FAQs

Common Issues and Solutions:

  1. No Output or Constant Readings:

    • Cause: The heater is not powered or improperly connected.
    • Solution: Verify the connections to pins H1 and H2. Ensure the heater is receiving 5V DC.
  2. Inconsistent Readings:

    • Cause: Insufficient preheating time or unstable power supply.
    • Solution: Allow the sensor to preheat for at least 24 hours. Use a stable 5V DC power source.
  3. High Baseline Resistance:

    • Cause: Contaminants on the sensor or improper calibration.
    • Solution: Clean the sensor environment and recalibrate in clean air.
  4. Sensor Saturation:

    • Cause: Exposure to high concentrations of gas for extended periods.
    • Solution: Remove the sensor from the high-gas environment and allow it to recover in clean air.

FAQs:

  • Q: Can the TGS822 detect gases other than methane and propane?
    A: Yes, the TGS822 can detect a range of combustible gases, but its sensitivity varies depending on the gas type.

  • Q: How long does the sensor last?
    A: The typical lifespan of the TGS822 is around 5 years under normal operating conditions.

  • Q: Can I use the TGS822 with a 3.3V system?
    A: The heater requires 5V DC, but the sensing element output can be interfaced with a 3.3V ADC using a voltage divider.

  • Q: Is the sensor waterproof?
    A: No, the TGS822 is not waterproof and should be protected from moisture and condensation.

By following the guidelines and best practices outlined in this documentation, you can effectively integrate the TGS822 gas sensor into your projects for reliable gas detection.