Electret Condenser Microphones and the MCP3208 ADC to a propeller
Jeffrey Kane
Posts: 48
Hello,
I've been looking at connecting a CMA-4544PF-W to a MCP3208 and having the data processed by the propeller, I've connected a photoresistor to ch0 on the mcp3208 and all works fine, i send the data to the parallax serial terminal and everything works fine, dark i get basically 0, about 127 and with a flashlight i get about 3800, so this works, but what i want is to use a electret mic as input but i have not found any suggestions on how to set up the circuit. or an example of some code, I looked at the sigma Delta circuit on the prop demo board, and also the microphone to vga and microphone to headphones. but the numbers never look correct when i intercept the sample from the circuit and display it on the serial terminal. I also want to use the mcp3208 over sigma delta for possibly use of more channels, and working on a breadboard, So basically i was wondering if someone has a circuit using the propeller and a electret mic to the mcp3208 adn then otuput to the propeller serial terminal.
this is the spin code for the photoreister
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
cpin = 0
dpin = 1
spin = 2
OBJ
adc : "MCP3208"
pst : "Parallax Serial Terminal"
VAR
long sample
PUB main
pst.Start(115200)
adc.start(dpin,cpin,spin,%1111_1111)
repeat
sample:=adc.average(0,500)
pst.dec(sample)
pst.newline
the curcuit is listed here: http://www.gadgetgangster.com/tutorials/397
regards
Jeff
I've been looking at connecting a CMA-4544PF-W to a MCP3208 and having the data processed by the propeller, I've connected a photoresistor to ch0 on the mcp3208 and all works fine, i send the data to the parallax serial terminal and everything works fine, dark i get basically 0, about 127 and with a flashlight i get about 3800, so this works, but what i want is to use a electret mic as input but i have not found any suggestions on how to set up the circuit. or an example of some code, I looked at the sigma Delta circuit on the prop demo board, and also the microphone to vga and microphone to headphones. but the numbers never look correct when i intercept the sample from the circuit and display it on the serial terminal. I also want to use the mcp3208 over sigma delta for possibly use of more channels, and working on a breadboard, So basically i was wondering if someone has a circuit using the propeller and a electret mic to the mcp3208 adn then otuput to the propeller serial terminal.
this is the spin code for the photoreister
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
cpin = 0
dpin = 1
spin = 2
OBJ
adc : "MCP3208"
pst : "Parallax Serial Terminal"
VAR
long sample
PUB main
pst.Start(115200)
adc.start(dpin,cpin,spin,%1111_1111)
repeat
sample:=adc.average(0,500)
pst.dec(sample)
pst.newline
the curcuit is listed here: http://www.gadgetgangster.com/tutorials/397
regards
Jeff
Comments
http://www.aaroncake.net/circuits/vumeter.asp
...in this circuit the transistor amplifies the small microphone signals where the diode allows the LED DOT/BAR display driver to only "see" the top half of the AC input signal.
As Beau indicated, the signal from the microphone goes positive and negative and, over time, averages out to near-zero. An ADC usually works with positive voltages only.
The VU Meter front end rectifies the incoming signal (uses only the positive-going bits) and averages it over time (to provide a voltage for the envelope ... the overall shape ... of the sound waveform).
so in pseudocode
init jet_counter = 0
init jet_errro_counter = 0
while loop
activate sound
listen for sound
update jet_counter by 1
if sound not found update jet_error_counter by 1
until there are no more piezo's jump to while loop
display Jets counted
display Jets_failed
regards
Jeff
"...from what i see i'm using the wrong adc to convert the microphone data to viewable data on the propeller. for now" - Not necessarily, what your looking for could be accomplished in software, it's all about how you look at and understand the signal.
Jeff