Go Down

Topic: Crummy Digitizing (Read 4969 times) previous topic - next topic


Back in the early 80's, I remember hooking up a microphone to my TRS-80's cassette port, and sampling it furiously to digitize some audio.
It sorta worked. If I screamed into the mic, I could, just barely, record a 16KB audio sample that played back recognizeably (barely). (Emphasize the barely). I remember screaming "KICK ME" into the mic, and it played back.

Question. Could I replicate this ancient process on the Arduino? I'm not looking for 22kHz or anything that grandiose. I'd like to be able to do around 8kHz sampling, maybe 10 seconds, or so, and stream it out over serial to another Arduino to playback the sound.
My wife broke her ankle, and it'd be super-neat (TM) if I could build a little battery powered intercom.

Of course, I could just go out and BUY something (shudder)...

I guess since I was able to do it on a 1.77 MHz Z80, it should be possible on the Atmega328...

Any suggestions?


Sure, this is possible. 8 kHz sampling is only 125us between samples which is a fairly long time for the Arduino. 10 kHz sampling rates are achievable using the built-in A/D converter. You will need a microphone and amplifier, either on a microphone breakout board like this:


or one of our soon-to-be-released new products (which I don't want to pre-announce  ;)  )

You are limited by RAM so you will definitely have to stream the data out as you get it. The bit rate is quite modest (10 bits at 8000 sps is only 80 kbit/s so could be done over a 115200bps serial link). You could even knock that down to 8 bits per sample (64kbit/s) and get quite intelligible speech.

The Arduino Drum Machine: 14-track MIDI drum machine sequencer / groove-box


You are limited by RAM

True there is only 2K of RAM for everything so there is no way you can record anything over a second.

WilliamK Govinda

I'm curious about this too. ;-) I managed to get 6 voices at 21khz and 8-bits without problem, by reading from the Program Flash, but sampling and saving to an external memory I haven't tested. And since the Arduino has only less than 2K of free ram to record something... but I wonder if maybe a SD Card could be used instead? Maybe external SRAM?



Without a lot of external support components and modules, I think an Arduino is a poor choice for processing/sampling audio signals via A/D conversion. Not saying it can't be done in some manner, but it's like trying to fit a 2 pound application into a 1 pound arduino.  ;)


I would agree with that.

You can use SD cards to read data from but they are too slow to write it in real time. External SRAM is the way to go. However, I am not sure if I2C SRAM will be fast enough. SPI will be faster, with parallel SRAM faster still.
I have bought some SAM chips to try this out but I have not got round to doing this yet.

Go Up