const int soundSensorPin = 15;
void setup() {
Serial.begin(115200);
pinMode(soundSensorPin, INPUT);
}
void loop() {
int sensorValue = analogRead(soundSensorPin);
float voltage = map(sensorValue, 0, 4095, 0, 3.3);
float decibels = 20 * log10(voltage / 0.1);
Serial.print("Sound Level (dB): ");
Serial.println(decibels);
delay(1000);
}