Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Voice recorder using ADC and microcontroller

Status
Not open for further replies.

4electros

New Member
The principle of this project as it's written in some website is as follows:
Create a voice recorder using a PIC or a microcontroller and ADC. Use some conditioning circuits to condition the microphone output and feed it to the ADC. The converted values can be stored in some kind of memory. Samsung has got some nice memory chips that can be easily interfaced. Most modern MP3 players use this kind of memory. Use a DAC to convert the stored voice data back to analog format and play it through a speaker.

so please i need some comments with doing this project in a suitable way especially about microcontroller.Also Is it strongly required or I could make enough with just memory to record the voice?

thanks in advance!
 
This sort of thing eats memory space, for reasonable quality speech you probably need 10,000 samples per second - and you obviously need memory that can write fast without any waiting (EEPROM is far too slow).

Basically you need:

Preamp from mike
Low pass filter
Analogue to digital converter (could be in micro-controller)
Micro-controller
Memory for storage
Digital to analogue converter (could be simple R2R ladder)
Low pass filter on output
 
4electros said:
and what about practical implemantation?
could you detect some things please!

The only tricky parts are the digital conversion and storing in memory, for 10,000 samples per second you only have 100uS to convert and store each sample. The low pass filters are simple opamp low-pass filters, about 3KHz or so.

So for a start I would suggest sorting out fast (and large) memory writing.
 
Nigel Goodwin said:
The only tricky parts are the digital conversion and storing in memory, for 10,000 samples per second you only have 100uS to convert and store each sample. The low pass filters are simple opamp low-pass filters, about 3KHz or so.

So for a start I would suggest sorting out fast (and large) memory writing.

thank you. and for microcontroller,Is it strongly required or I could make enough with just memory to record the voice?
 
You CAN do this just fine with the right hardware!
The dsPIC30F/33F series is good for it because:
1. Microchip has a "Speex" encoding/decoding library. This will compress speech down to 1K/sec.
2. The dsPIC has a codec input. In general the 10-bit/12-bit DAC and the PWM are less than ideal for audio. It's not enough bits, particularly on the PWM side. The Si3000 is the well-used codec for this, which offers 16 bit ADC and 15 bit DAC, the ADC handles all the aliasing and filtering tasks, and it's under $2 from Mouser.
3. The dsPIC series comes with a whole lot of RAM/ROM space. You may still need an external EEPROM.
 
there will be four main blocks:
microphone with preamp
PIC
memory
output amp fed by a resistor ladder (DAC)

so your program must make provisions for selecting record or playback mode
managing the conversions (in it's internal ADC) and feeding the results into the moemory.
for the playback it must access the momery addresses one after the other (presumably the same order inwhich they were elected in recording) and pass these to an output port or perhaps depending on the memory if it has the full 8 bits (or more if needed depends on quality required) then the pic could just instruct it to output the various adress locations and via a 2R ladder feed these to the output amp however it is probable that the memory output is not powerful enough so best thru the pic as it will be connected anyway for recording (writing to memory)
 
A friend of mine tried a similar project. He used DDR ram modules a few megabytes to store the voice... If you restrict the storage to voice and put a band pass filter for 400Hz to 4Khz, you need to keep the sampling rate atleast 8000 samples/second -> telephonic quality sound.
 
The whole DsPIC familly are on the Microchip website
**broken link removed**


There's also those Winbond plug-n-play solution.
https://www.winbond-usa.com/mambo/content/view/36/140/

If you plan to do it wit a single PIC, most of PIC18F serie will do the job. Choose one with a fast ADC(PIC18F2431 and PIC18F4431 spring to mind) and use a fast external memory.

The R2R DAC converter will work. A PWM signal too... it's just harder to implement (filtering, coding, etc etc)
 
You really do want the dsPIC series. The PIC18 doesn't have a codec input or DMA (actually only the 33F has DMA) and it's unlikely you'd be able to run speech compression/decompression in real time. dsPIC is like 20x-50x (or even more) faster at 16-bit math ops. Nor are there free libraries to do speech compression for the PIC18.

You need:
1. dsPIC, I'd recommend 33F128GP706 primarily but that's in a TQFP pkg which is difficult to mount unless you know how. The only alternative is the 30F4013 in a 40-pin DIP, but the 33F really is a much better part.
2. Something capable of programming dsPICs, like the $99 ICD2 at Sparkfun.
3. An Si3000 voice codec.
4. A microphone
5. If you don't have headphones, you need a speaker amplifier, an LM386 will do it.
6. The 33F could hold something like 1-2 min of speech audio in ROM, less in RAM. Ideally you want an external EEPROM chip. 1K/sec.

dsPIC33F really is a NEAT chip. It's crazy how much power they have and they're cheap. It seems like a lot of people get turned off by the "dsPIC" name, assuming they're some kind of special-purpose device. Actually they're just a really powerful 16-bit core with some special assembly instructions and hardware features which are not only useful for DSP but plenty of general-purpose applications as well.
 
Oznog said:
dsPIC33F really is a NEAT chip.

Dear Oznog, the matter is that there isn't any of it in my country electronic market.Additionaly i don't know about programming this chip in assembly language and I actually haven't programmed microcontroller yet.

thank you.
 
The DSP chips might be dufficult to procure. And I guess you cannot order using a credit card... I remember you said that there is no credit card setup in Syria....

So you may have to scale down the project or choose a PIC that can run at the highest speed.... The same PIC may have variants... some are low power variants that are cheap but run at lower frequency. Choose a high power and higher frequency PIC variant....

There is a good deal of tutorial links on the FAQ by Jay.Slovak there is a series of flash animations from microchip in that links list.... It might help...
 
dsPIC can be programmed with C, Microchip provides a free C30 compiler you can download. You're going to have to learn something here.

Programming dsPIC in assembly is far simpler than PIC16 series. First off all operations are done in 16-bit word mode unless you specify byte mode. For audio 8-bit is generally far too crappy so all your operations need to be in 16-bit. Second they increased the number of addressing bits to include all of RAM so the memory accesses don't need a paged mode. So aside from the fact that it runs instructions 4x faster than any other PIC, taking 2 16-bit numbers out of RAM, adding them together, and storing the result might be as little as 3 instructions, whereas PIC16 takes a lot more.

There's two 32-bit accumulators. These have most of the capabilities of the 16-bit working regs but also some new ones. Such as if you add 2 16 bit numbers together and the result is greater than what a 16 bit number can hold, you can set a AccConfig bit to say that when you move the data out of the accumulator it should read max value for the scale (0xffff if unsigned int) instead of some meaningless wrapped value.

But the features such as the accumulator are not required. I mean you can start by coding with working regs, you can even stick with 8-bit mode if it makes you feel better, and it'll be pretty much just like a PIC16.

You should be able to order the 33F (I recommend 128GP706 or 64GP706) off of Microchip's web site. Or Mouser. Or Digikey. Unless this falls under Export Restrictions there should be no problem getting ahold of them.
 
hello!
I want to make this project
but I face difficulty to choice the component
I choice ADC0808
DAC0808
LM386
LM741
and I wanted to use MAX7409 and MAX274 but I didn't find them
I searched and found LTC1563-2CGN ( Is it useful in his case?)
Can you give me advice about my choice?
and Is it useful or not?
and what is the numbers of LPF IC i can use?

what about the mic? what is the meaning of Preamp mic? what is the shape of the mic i should use?
 
This sort of thing eats memory space, for reasonable quality speech you probably need 10,000 samples per second - and you obviously need memory that can write fast without any waiting (EEPROM is far too slow).

Basically you need:

Preamp from mike
Low pass filter
Analogue to digital converter (could be in micro-controller)
Micro-controller
Memory for storage
Digital to analogue converter (could be simple R2R ladder)
Low pass filter on output

mmmmmm 10ksamples?? nyquist theorem???....digital telephone???
8ksamplesx8 bits will do the trick...afterwards...some delta coding
would lower buffering some 40%......

rgds
 
Status
Not open for further replies.

Latest threads

Back
Top