Audio sensor keyes ky037, constantly getting max value

Thread Starter

Luka Dragicevic

Joined Dec 16, 2016
9
I'm having trouble with my stm32f4 mcu connected with keyes ky037 audio sensor.

I have programmed in MikroC compiler for ARM some example code, just to print taken input analog voltage from audio sensor. One weird thing that confuses me is the thing that when I manually change sensor's potentiometer threshold value I am getting lower or higher ~ value which can't be true, because potentiometer on this sensor affects only digital output (if threshold is reached) otherwise it shouldn't affect my sensor's analog output but it obviously does.

And also, when I let potentiometer's some value (whatever it is), I am always getting similar values (currently in range ~ 3.32xxxx), where xxxx changes randomly (in my opinion) in time even if I scream or I don't talk anything (xxxx doesn't need to be higher if i scream).

Feel free to ask for additional information.

I've provided example code in attachment.

Thanks in advance.
 

Attachments

dannyf

Joined Sep 13, 2015
2,196
just to print taken input analog voltage from audio sensor.
right after you take the adc value, assign a specific value to it and see if it gets printed out correctly.

you have to figure out first if the issue is with the print or the adc.
 

Thread Starter

Luka Dragicevic

Joined Dec 16, 2016
9
I've checked, and my print is totally all right.

I don't know why threshold(potentiometer) changes my analog read value from ADC (even if it's constantly around some (threshold) value).
 

Thread Starter

Luka Dragicevic

Joined Dec 16, 2016
9
easy: adc a known voltage and see if you get the right readings.
I have adc a GND, and 3.3V and I recieved right readings, so ADC converter works fine with this code.

How can I find out why my AnalogOutput (AO) from Keyes-KY037, sends me same value (or + - 3) in range of 0-4096?
 

Thread Starter

Luka Dragicevic

Joined Dec 16, 2016
9
how do you know that?
I have connected Vcc on my Analog in pin, and it gave me value of 2100 +/- 3. When I connected GND on Analog in pin it gave me value 10 +/- 5. In my opinion that showed me that ADC conversion is converting good on input value.
 

dannyf

Joined Sep 13, 2015
2,196
presumably - you will need to check this out - the analog output from a sound sensor is ac -> it goes up and down with the sound wave.

read the sensor's datasheet / schematic to be sure.
 
Top