Using Breakout Board for ADMP401 MEMS Microphone on PcDuino

Intro: Using Breakout Board for ADMP401 MEMS Microphone on PcDuino

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.

Share

    Recommendations

    • Tiny Home Contest

      Tiny Home Contest
    • Audio Contest 2018

      Audio Contest 2018
    • Fix It! Contest

      Fix It! Contest

    3 Discussions

    0
    None
    VinodN5

    2 years ago

    if(((HistoryValue>=value) && ((HistoryValue - value) > 2)) || ((HistoryValue 2))) //what is the HistroryValue2 will do here ?

    at this instruction i am getting the error as

    MEMS_microphone.ino: In function 'void loop()':

    MEMS_microphone:22: error: expected ')' before numeric constant

    MEMS_microphone:29: error: expected ')' before 'HistoryValue'

    MEMS_microphone:29: error: expected ')' before ';' token

    0
    None
    VinodN5

    2 years ago

    if(((HistoryValue>=value) && ((HistoryValue - value) > 2)) || ((HistoryValue 2))) //what is the HistroryValue2 will do here ?

    at this instruction i am getting the error as

    MEMS_microphone.ino: In function 'void loop()':

    MEMS_microphone:22: error: expected ')' before numeric constant

    MEMS_microphone:29: error: expected ')' before 'HistoryValue'

    MEMS_microphone:29: error: expected ')' before ';' token

    0
    None
    VinodN5

    2 years ago

    if(((HistoryValue>=value) && ((HistoryValue - value) > 2)) || ((HistoryValue 2))) //what is the HistroryValue2 will do here ?

    at this instruction i am getting the error as

    MEMS_microphone.ino: In function 'void loop()':

    MEMS_microphone:22: error: expected ')' before numeric constant

    MEMS_microphone:29: error: expected ')' before 'HistoryValue'

    MEMS_microphone:29: error: expected ')' before ';' token