The MQ-136 Hydrogen Sulfide (H2S) Gas Sensor is an electronic device used to measure the concentration of hydrogen sulfide gas in the air. This sensor is widely used in industrial applications, environmental monitoring, and safety systems where the presence of H2S, a toxic and corrosive gas, needs to be detected and measured.
Pin Number | Pin Name | Description |
---|---|---|
1 | VCC | Power supply (5V DC) |
2 | GND | Ground connection |
3 | DOUT | Digital output (TTL logic level) |
4 | AOUT | Analog output (proportional to H2S) |
// MQ-136 Hydrogen Sulfide Gas Sensor Example Code
const int ANALOG_PIN = A0; // Analog input pin connected to AOUT on the sensor
const int DIGITAL_PIN = 2; // Digital input pin connected to DOUT on the sensor
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud rate
pinMode(DIGITAL_PIN, INPUT); // Set the digital pin as input
}
void loop() {
int sensorValue = analogRead(ANALOG_PIN); // Read the analog value from sensor
int digitalValue = digitalRead(DIGITAL_PIN); // Read the digital value from sensor
// Print the analog value to the serial monitor
Serial.print("Analog H2S Value: ");
Serial.println(sensorValue);
// Print the digital status to the serial monitor
Serial.print("Digital H2S Status: ");
Serial.println(digitalValue ? "HIGH" : "LOW");
delay(1000); // Wait for 1 second before the next loop
}
This documentation provides a comprehensive guide to using the MQ-136 Hydrogen Sulfide Gas Sensor. For further assistance, please refer to the manufacturer's datasheet or contact technical support.