Hello! I am trying to understand values a transducer is giving me for testing its response to certain sound inputs. I put in this code
void setup() {
Serial.begin(9600); // Start the serial communication
}
void loop() {
int sensorValue = analogRead(A0); // Read the analog input on pin A0
Serial.println(sensorValue); // Print the value to the Serial Monitor
delay(1000); // Wait for a second before reading again
}
and while it prints out an analog value every second as intended, it starts around 800 or 900 and decreases by 14-17 increments every second until it gets to zero, and then it stays at zero (until I reset it, then this whole process begins again).
I cannot for the life of me figure out why. Does anyone have any suggestions?? Thank you so much!
You have the transducer connected backwards.
You connected it to the wrong supply voltage.
You have a loose connection.
That's the way the transducer is supposed to work.
The transducer outputs an AC voltage (+/-)
The transducer is broken.