Hello all! I am in the middle of making a voice recorder and I am using some test code before I integrate the code into a larger project. All I want to do with this test code is record something using my MAX 9814 microphone and save it onto my micro SD card. So far my project will only record blank audio files onto my SD card. The recording lengths are the correct size but they have no content, only static. Am i using the wrong SD card? is my mic broken? thanks for all the help!
//#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560 #define SD_ChipSelectPin 4 //using digital pin 4 on arduino nano 328, can use other pins #define microphone_pin A0
TMRpcm audio; // create an object for use in this sketch
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("sd faild");
return;
}else{
Serial.println("SD OK");
}
// The audio library needs to know which CS pin to use for recording
audio.CSPin = SD_ChipSelectPin;
}
void loop() {
if(Serial.available()){ //Send commands over serial to play
switch(Serial.read()){
case 'r': audio.startRecording("test.wav",16000,microphone_pin); Serial.println("recording start"); break; //Record at 16khz sample rate on pin A0
case 's': audio.stopRecording("test.wav"); Serial.println("recording stopped"); break; //Stop recording
}
}
Please post a link to the microphone module, and a hand drawn wiring diagram, with pins and components clearly labeled.
Have you been able to obtain useful signals of any sort from the microphone module? If not, that is a required first step.
The "recording" feature of the TMRpcm library is supposedly under development, and is not guaranteed to work. Can you post a link to a working example? I've never seen or heard of one. Note that the SDFat library is recommended, not SD.
Here is the microphone I am using and I am not sure that it works. The microphone has auto gain control that defaults to 60db so I figured that would work.
In just about any modular project, make sure that all the components function individually, before trying to put them together. Adafruit sensors tend to be of good quality, but you simply can't expect a new item to work every time, out of the box.
Most Arduino libraries come with test code that can be used to verify correct operation of sensors, SD cards, etc.
Given that the TMRpcm library cautions that the "record" option is still being developed and may not even work, how do you plan to test that?