Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 574 Bytes

File metadata and controls

34 lines (24 loc) · 574 Bytes

Integrating Gas Sensor using Arduino


Circuit Diagram


Arduino Code

int gassensor = 0;

void setup()
{
  pinMode(A5, INPUT);
  Serial.begin(9600);
  pinMode(2, OUTPUT);
}

void loop()
{
  gassensor = analogRead(A5);
  Serial.println(gassensor);
  if (gassensor > 200) {
    tone(2, 523, 1000); // play tone 60 (C5 = 523 Hz)
  }
  delay(10); // Delay a little bit to improve simulation performance
}