(SKU:RB-02S084)SparkFun Sound Detector

From ALSRobot-Wki
Jump to: navigation, search
QQ20150624115316.png

Contents

overview

Ready to add audio to your next project? This small Sound Sensor couples a small electret microphone with a 100x opamp to amplify the sounds of voice, door knocks, etc loud enough to be picked up by a microcontroller's Analog to Digital converter. Unit comes fully assembled as shown. Works from 2.7V up to 5.5V.

Technical parameters and performance

  1. working voltage: 3.5V - 5.5V
  2. production process: FR4 double-sided spray tin
  3. shipping list: Sound Detector module *1
  4. packing: antistatic bag sealing
  5. optional accessories: Arduino328 controller, DuPont line, pin

using method

Pin definition

  • VCC: power supply;
  • GND: power supply negative;
  • GATE: to detect whether the environment is sound input (Kai Guanliang);
  • ENVELOPE: the output voltage follows the amplitude of the sound source and the variation of the amplitude of the sound source (the analog quantity);
  • AUDIO: the change in audio voltage (Analog)

Connect Icon

  1. Detector Sound module on the R17 resistance has not been welded, from the principle diagram we can know that R3 and R7 with the gain of the preamplifier.
  2. If you want to reduce the gain (sensitivity reduction): can be configured as shown in figure 1.
  3. If you want to increase gain (increased sensitivity): we can shield R3, if a R17 gain, as shown in figure two.
Sycgq1.jpg
Sycgq2.jpg

Application Routine

Sample code

Procedure 1:

const int led=7;          //定义7号引脚
const int button=4;       //定义4号引脚
int buttonState = 0;       /定义初始化变量
void setup()
{
  pinMode(button,INPUT);    //定义4号引脚为输入
  pinMode(led,OUTPUT);     //定义7号引脚为输出
}
void loop()
{
   buttonState = digitalRead(button);  //读取4号引脚的电平状态
  if (buttonState == HIGH)          //如果4号引脚为高电平
  { 
    digitalWrite(led,HIGH);           //7号引脚输出高电平
    delay(1000);                    //延时1秒
    digitalWrite(led,LOW);           //7号引脚输出低电平
    delay(1000);
  }
     else  
     {
     digitalWrite(led, LOW);         //4号引脚低电平,led灯熄灭
     }  
}

Procedure two:

#define PIN_ANALOG_IN A0      //定义模拟口A0
void setup()
{
  Serial.begin(9600);             //定义串口波特率
  Serial.println("Initialized");      //串口打印“Initialized”
}
void loop()
{
  int value;                     //定义一个变量
 value = analogRead(PIN_ANALOG_IN);//将读取的模拟口值赋给变量
  Serial.print(value);             //串口打印变量值
  Serial.print("Status: ");          //串口打印当前环境状态“Status”
  if(value <= 10)                /如果收到的变量值<10
  {
    Serial.println("Quiet.");       //串口打印quiet
  }
  else if( (value > 10) && ( value <= 30) )//如果收到的变量值在10-30之间 
  {
    Serial.println("Moderate.");    //打印“Moderate”
  }
  else if(value > 30)              //如果收到的变量值>30
  {
    Serial.println("Loud.");        //打印“Loud”
  }
  delay(1000);                   //延时1秒
}

Procedure three:

#define PIN_ANALOG_IN A0      /定义模拟口A0
void setup()
{
  Serial.begin(9600);             //定义串口波特率
  Serial.println("Initialized");      //串口打印“Initialized”
}
void loop()
{
  int value;                     //定义一个变量
  value = analogRead(PIN_ANALOG_IN);   //将读取的模拟口值赋给变量     
  Serial.println(value);           // 串口打印变量值
  Serial.print("Status: ");          //串口打印当前环境状态“Status”
  if(value <= 200)              //如果收到的变量值<200
  {
    Serial.println("Quiet.");      //串口打印quiet
  }
  else if( (value > 400) && ( value <= 500) )//如果收到的变量值在400-500之间 
  {
    Serial.println("Moderate.");       //打印“Moderate”
  }
  else if(value > 600)               //如果收到的变量值>600
  {
    Serial.println("Loud.");          //打印“Loud”
  }
       delay(1000);                    //延时1秒
}


Program effect

  • program 1: the GATE output pin is connected to the 5 pin of the CarDuino, when there is a sound input, the LED lights flash
  • program two: the ENVELOP output pin UNO R3 CarDuino controller A0 port, you can see through the serial port to see the changes in the intensity of the sound, the serial port to display the current changes in the amplitude of the sound.
  • program three: the AUDIO output pin UNO R3 CarDuino controller A0 port, you can see through the serial port to see the changes in the intensity of the sound, serial display of the current sound source.

Product recommendation

Buy address:SparkFun Sound Detector

Personal tools
Namespaces

Variants
Actions
Navigation
Tools