Sale10 left

MQ8 Hydrogen Gas Sensor
sensors
GHS 45GHS 34

The MQ4 sensor utilizes a SnO₂ (tin dioxide) sensing layer that has low conductivity in clean air. When exposed to methane or natural gas, the conductivity increases. This change is used to determine the concentration of gas in the environment.
const int analogPin = A0; // Analog output pin
const int digitalPin = 2; // Digital output pin
int analogValue = 0;
void setup() {
Serial.begin(9600);
pinMode(digitalPin, INPUT);
}
void loop() {
// Read analog value
analogValue = analogRead(analogPin);
// Print analog value (methane concentration)
Serial.print("Analog Value: ");
Serial.println(analogValue);
// Check digital output
if (digitalRead(digitalPin) == HIGH) {
Serial.println("Methane concentration exceeded threshold!");
}
delay(1000);
}
Shop more
Products from the same category or commonly paired with this item.
Shop more
Customer favorites that are getting the most attention.
Shop more
Freshly added items from the shop.