Skip to content

Instantly share code, notes, and snippets.

@hkstemclub
Created November 17, 2018 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkstemclub/3fec428bd6d4cf30b47ec59525408fbd to your computer and use it in GitHub Desktop.
Save hkstemclub/3fec428bd6d4cf30b47ec59525408fbd to your computer and use it in GitHub Desktop.
/* Testing MQ GAS sensor with serial monitor
Suitable for detecting of LPG, i-butane, propane, methane ,alcohol, Hydrogen or smoke
More info: http://www.ardumotive.com/how-to-use-mq2-gas-sensor-en.html
Dev: Michalis Vasilakis // Date: 11/6/2015 // www.ardumotive.com */
const int gasPin = A0; //GAS sensor output pin to Arduino analog A0 pin
void setup()
{
Serial.begin(9600); //Initialize serial port - 9600 bps
}
void loop()
{
Serial.println(analogRead(gasPin));
delay(1000); // Print value every 1 sec.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment