Transducer analog input

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!

Not much to the code. So what exactly is going into A0?

Ron

Did you miss the request to read the how to grt the most of the forum when you signed up. >>>> How to get the best out of this forum

What Arduino board?

What sensor? Output sample?

How about a schematc and data sheets?

1 Like

Are the grounds connected?

Not without knowing what the transducer is.

such as? please provide a link.
And a schematic

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.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.