Pages: [1]   Go Down
Author Topic: Record audio and save as .wav with on board mic  (Read 1064 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How often?

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd say every 512 bytes, maybe every 1024 tops, because of the limited SRAM available for data buffering.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.
Logged

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.

Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you. You are quite helpful.
Logged

Pages: [1]   Go Up
Jump to: