//Write a Program to Interface any Analog (Pollution) sensor and display the value read on serial monitor.
#define LED_PIN 13 // LED connected to pin 13
void setup() {
Serial.begin(9600);
pinMode(LED_PIN, OUTPUT); // Set LED pin as output
}
void loop() {
int senValue = analogRead(A0);
float voltage = senValue * (5.0 / 1023.0); // Convert to voltage
Serial.print("Raw Value: ");
Serial.println(senValue);
Serial.print("Voltage: ");
Serial.print(voltage);
Serial.println("V");
// Blink the LED every reading
digitalWrite(LED_PIN, HIGH); // Turn ON LED
delay(500); // Wait 500ms
digitalWrite(LED_PIN, LOW); // Turn OFF LED
delay(200); // Wait another 500ms
// Total delay per loop = 1000ms (1 sec)
}