Using an Ultrasonic MEMS PDM Mic to apply PdM in bearings

Hello, I am using Digital MEMS Mic SPH0641LU4H-1 (https://www.elecrow.com/digital-mems-microphone.html) to apply PdM in bearings. I am using Arduino Framework and, according to the datasheet of the microphone, it is capable of "hearing" a range between 100Hz to 80kHz. To make it operate in ultrasonic mode, I need to change the clock to 3.072 MHz ≤ fCLOCK ≤ 4.8 MHz. I have done this code, but the FFT is not detecting any frequencies, even in the first bins. Can anyone help me, please?

#include <Audio.h>
#include "setI2SFreq.h"
#define SAMPLE_RATE_192K 192000
// GUItool: begin automatically generated code
AudioInputPDM pdm1; //xy=180,111
AudioFilterStateVariable filter1; //xy=325,101
AudioOutputI2S i2s1; //I2S audio output
AudioAmplifier amp1; //xy=470,93
AudioAnalyzeFFT1024 fft1024_1; //xy=616,102
AudioConnection patchCord1(pdm1, 0, filter1, 0);
AudioConnection patchCord2(filter1, 2, amp1, 0);
AudioConnection patchCord3(amp1, fft1024_1);
// GUItool: end automatically generated code
void setup() {
AudioMemory(50);
filter1.frequency(30); // filter out DC & extremely low frequencies
amp1.gain(8.5); // amplify sign to useful range
setI2SFreq(192000);
}

void loop() {
if (fft1024_1.available()) {
// each time new FFT data is available
// print 20 bins to the Arduino Serial Monitor
//512 bins, 187.5 hz each bin
Serial.print(millis());
Serial.print("FFT: ");
for (int i = 0; i < 20; i++) {
float n = fft1024_1.read(i);
if (n >= 0.001) {
Serial.print(n, 3);
Serial.print(" ");
} else {
Serial.print(" -- "); // don't print "0.000"
}
}
Serial.println();
}
}
 
To change the sample rate, you have to edit files inside the audio library. You can just create a define in Arduino sketch code.
 
Well that's good info we didn't have before!

Maybe it is changing the sample rate? Do you have an oscilloscope or logic analyzer which can view the LRCLK signal? Or a multimeter capable of frequency measurement that high? Or if no special gear is available, another Teensy using FreqMeasure library could work.
Yes, I have an oscilloscope. I will measure when I set the rate to 192000 hz.
 
Well that's good info we didn't have before!

Maybe it is changing the sample rate? Do you have an oscilloscope or logic analyzer which can view the LRCLK signal? Or a multimeter capable of frequency measurement that high? Or if no special gear is available, another Teensy using FreqMeasure library could work.
The frequency generated by BCLK with "setI2SFreq(192000)" is around 12.30 Mhz. I read it with an oscilloscope. I think this is a problem, as the microphone operates in ultrasonic mode with 3.072 MHz ≤ fCLOCK ≤ 4.8 MHz. Am I wrong?
 
Back
Top