Go Down

Topic: Record audio and save as .wav with on board mic (Read 1 time) previous topic - next topic

mikejonesab1

So I would like to record audio and save it as a .wav file onto a SD card with an onboard mic. I was thinking of using this: http://www.mouser.com/new/stmicroelectronics/stmicromp34db01/

How would I go about interfacing? Do I need a preamp? Thanks in advance.

--Mike

CrossRoads

Looking at the larger setup:  The arduino records 10-bit analog at ~10KHz, for <5KHz bandwidth. There will be pauses in the sampling as the SD card is written to.
Will those limitations be okay?
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

mikejonesab1

How often?

And if that was a problem how would you get around that?

CrossRoads

I'd say every 512 bytes, maybe every 1024 tops, because of the limited SRAM available for data buffering.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

mikejonesab1

That will be fine. How should I/can I interface with the microphone I linked above?

CrossRoads

Connect it up per page 12 of the data sheet.
Power is 1.8V.
Clock speed - typical is 2.4MHz. If you use SPI at 1/4 processor speed, that is 2MHz.
You will have 512 bytes of data every couple of mS.
SD uses SPI to write data to the card.
You can try a loop to read the data
Code: [Select]

for (x=0; x<512; x=x+1){
dataArray[x] = SPI.transfer(0); //MOSI connects to nothing,  MISO connects mic data pin, SCK connects to mic CLK pin
}

then use SD library to send it to the card.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.


Go Up