This circuit is designed to monitor air quality by measuring the concentration of various gases. It includes three gas sensors: the MQ-7 for carbon monoxide (CO) detection, the MQ-131 for ozone (O3) detection, and the MKE-S09 MQ-135 for general air quality assessment. These sensors are interfaced with an Arduino UNO microcontroller, which reads the analog sensor outputs and transmits the data serially for monitoring purposes.
// Code for reading sensor data from the MQ-7, MQ-131, and MQ-135 sensors
// and outputting the data to the serial monitor.
int mq131Pin = A0; // MQ131 connected to A0
int mq135Pin = A1; // MQ135 connected to A1
int mq7Pin = A2; // MQ7 connected to A2
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud rate
}
void loop() {
int mq131Value = analogRead(mq131Pin); // Read value from MQ131
int mq135Value = analogRead(mq135Pin); // Read value from MQ135
int mq7Value = analogRead(mq7Pin); // Read value from MQ7
// Print the sensor values to the serial monitor
Serial.print("MQ131 (Ozone): ");
Serial.println(mq131Value);
Serial.print("MQ135 (Air Quality): ");
Serial.println(mq135Value);
Serial.print("MQ7 (CO): ");
Serial.println(mq7Value);
delay(1000); // Delay for readability
}
This code is designed to be uploaded to the Arduino UNO microcontroller. It initializes the serial communication, reads the analog values from the connected sensors, and prints the readings to the serial monitor every second. Each sensor's reading is labeled with the corresponding gas it detects for easy identification.