Using Breakout Board for ADMP401 MEMS Microphone on PcDuino

3,407

4

3

Posted

Introduction: 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

  • Epilog Challenge 9

    Epilog Challenge 9
  • Gluten Free Challenge

    Gluten Free Challenge
  • First Time Author Contest 2018

    First Time Author Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

3 Comments

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

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

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