
High Quality As608 Optical Fingerprint Sensor Module
modules

The MQ2 Gas Sensor is a versatile and widely used sensor for detecting flammable and combustible gases. It is capable of detecting gases like LPG, methane, propane, hydrogen, alcohol, smoke, and carbon monoxide, making it ideal for gas leakage detection systems and air quality monitoring.
The MQ5 sensor uses a SnO₂ (tin dioxide) sensing layer, which has low conductivity in clean air. When exposed to methane, LPG, or other flammable gases, the conductivity increases. This change in resistance is measured to determine the gas concentration.
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 (gas concentration)
Serial.print("Analog Value: ");
Serial.println(analogValue);
// Check digital output
if (digitalRead(digitalPin) == HIGH) {
Serial.println("Gas 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.