loading

Module introduction:
Breakout Board for ADMP401 MEMS Microphone is a supersensitive omnidirectional microphones.Its PCB is very small, signal output is simple, with only 3 signal output, one VCC (positive power), one GND(negative power), one output(signal output), when the voice is changing around the module, the output signal (output) is also chaging. So we can use the pcduino ADC function to collect speech signal (Of course, the sample rate is not very high)

Step 1: Wiring Diagram

Step 2: Sample Code

#include 
int adc_id = 2; int delay_us = 100000; int HistoryValue = 0; char buffer[100]; void setup() { memset(buffer,0,sizeof(buffer)); } void loop() { int value = analogRead(adc_id); // get adc value value = ((float)value/4096)*sizeof(buffer); if(((HistoryValue>=value) && ((HistoryValue - value) > 2)) || ((HistoryValue 2))) { memset(buffer,'*',value); buffer[value] = 0; printf("%s\n",buffer); } HistoryValue = value; }

Step 3: The Results

When we touch the module with hand, we can detect the sensor output:

When the sound changes , the reversed waveform like spectrum will be shown on the screen.

<p>if(((HistoryValue&gt;=value) &amp;&amp; ((HistoryValue - value) &gt; 2)) || ((HistoryValue 2))) //what is the HistroryValue2 will do here ?</p><p>at this instruction i am getting the error as </p><p>MEMS_microphone.ino: In function 'void loop()':</p><p>MEMS_microphone:22: error: expected ')' before numeric constant</p><p>MEMS_microphone:29: error: expected ')' before 'HistoryValue'</p><p>MEMS_microphone:29: error: expected ')' before ';' token</p>
<p>if(((HistoryValue&gt;=value) &amp;&amp; ((HistoryValue - value) &gt; 2)) || ((HistoryValue 2))) //what is the HistroryValue2 will do here ?</p><p>at this instruction i am getting the error as </p><p>MEMS_microphone.ino: In function 'void loop()':</p><p>MEMS_microphone:22: error: expected ')' before numeric constant</p><p>MEMS_microphone:29: error: expected ')' before 'HistoryValue'</p><p>MEMS_microphone:29: error: expected ')' before ';' token</p>
<p>if(((HistoryValue&gt;=value) &amp;&amp; ((HistoryValue - value) &gt; 2)) || ((HistoryValue 2))) //what is the HistroryValue2 will do here ?</p><p>at this instruction i am getting the error as </p><p>MEMS_microphone.ino: In function 'void loop()':</p><p>MEMS_microphone:22: error: expected ')' before numeric constant</p><p>MEMS_microphone:29: error: expected ')' before 'HistoryValue'</p><p>MEMS_microphone:29: error: expected ')' before ';' token</p>

About This Instructable

3,167views

3favorites

License:

More by Linksprite:Using Breakout Board for ADMP401 MEMS Microphone on pcDuino Another home automation project with pcDuino How to remotely boot pcDuino from a NFS server 
Add instructable to: