HEY THERE
I BROUGHT KY-038 FEW DAYS BACK.
The code is pasted below, and I have noticed that the value getting displayed on the serial port is always 1023, no matter the sound. What is wrong?
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A0,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(analogRead(A0));
delay(100);
`
}
does your sensor have an analog out or just digital out?
do you have a potentiometer on it to set the "sensitivity" (when the digital out will say HIGH)?
void setup() {
Serial.begin(115200); // no need to use the slow 9600. It’s from last century….
}
void loop() {
Serial.println(analogRead(A0));
delay(100);
}
Thanks now I am getting different value but the current issue is it only get 12 aur 13 when sound is coming and when i blow in sensor than only it show value between 500 -1000
I think I am now getting the mistake should I change the sensitivity of the sensor so that it can get higher value if yes, then Should i rotate right wards to get nut out or left wards to tight more
Depends on the component you have (when will you post a link to what you purchased?)
Some have 2 pots, on to set the trigger point of D0 and one to modify the signal amplification
If the pot you have is just for D0 then turning it won’t change anything
But you can try,
Also to test, don’t make any noise and look at the values and then clap strongly in your hands next to the "microphone" (electret)
You might also want to change the delay to 10 to get more sampling
Please don’t post image of text or full screen grab… that is a waste of resources, just copy the relevant text and paste it here within code tags
Why when I am blowing up in a sensor the value goes up?
It means it is crystal clear that the sensor is alright and in working condition.
So is there any problem is on code or in circuit can you pls help me out with this
I am expecting that when a sound comes or a loud sound as normal the value must be going up right? but this is not happening with me when I play any type of music it only remain's from the range of 10-20 and it is not increasing
What you call sound is probably too low to be significant. This thing is not a good microphone (esp. if you bought a cheap version) , it’s meant to differentiate between small and big noise. Don’t have high expectations from this module (I’m tired of waiting for the link so I leave this thread)