Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino 101 Based MQ6 Gas Sensor Interface

View and Edit Project In Cirkit DesignerImage of Arduino 101 Based MQ6 Gas Sensor Interface

Circuit Documentation

Summary of the Circuit

This circuit is designed to interface an Arduino 101 microcontroller with an MQ6 gas sensor. The MQ6 sensor is capable of detecting LPG, butane, and propane in the air. The Arduino 101 reads the digital output from the MQ6 sensor and prints the value to the Serial Monitor. The circuit is powered by a 5V DC source, which provides power to both the Arduino and the MQ6 sensor.

Component List

Arduino 101

MQ6 Gas Sensor

5V Battery

DC Source 5V

Wiring Details

Arduino 101

MQ6 Gas Sensor

DC Source 5V

Documented Code

/*
 * Arduino Interface with MQ6 Sensor
 * This code reads the digital value from the MQ6 sensor
 * connected to pin D9 and prints it to the Serial Monitor.
 */

void setup() {
  // Initialize serial communication at 9600 baud rate
  Serial.begin(9600);
  // Set pin mode for digital input from MQ6
  pinMode(9, INPUT);
}

void loop() {
  // Read digital value from MQ6
  int digitalValue = digitalRead(9);
  // Print value to Serial Monitor
  Serial.print("Digital Value: ");
  Serial.println(digitalValue);
  // Wait for 1 second before next read
  delay(1000);
}