Applause Enthusiasm Detection

来自Microduino Wikipedia
跳转至: 导航搜索
Language English

Objective

Here we’ll detect applause. The louder it gets, the brighter the light turns. When the brightness gets to the most, the buzzer will give an alarm.

Principle

Equipment

Module Number Function
Microduino-CoreUSB 1 Core board
Microduino-Sensorhub 1 Sensor pinboard
Microduino-Mic 1 Sound detection sensor
Microduino-Lamp 1 led sensor
Microduino-BUZZER 1 Buzzer sensor
Microduino-BM 1 Batery management

Hardware Buildup

  • Setup 1:Connect CoreUSB to your PC, open program example, choose the right board fand download program via the serial port.
  • Setup2:Connect MIC to the A0 pin of Sensorhub, buzzer to D6 and the led light to D4.
Microduino-sensorhub rule.JPG
  • Setup6:Connect battery to BM.

Software Debugging

  • Build IDE and download program code.

Applause_heat Code description

  • Control pin description
#define PIN 4

Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);

#define mic_pin A0
#define buzzer_pin 6
  • Sound pre-set value
  #define voice 400
  • If the sound is louder than the pre-set value, the lamp will get brighter and when it reaches to a certain value, the buzzer will go off.
  if (voice_data > voice)
  {
    num++;
    if (num > 255)
    {
      num = 255;
      buzzer();
    }
    colorWipe(strip.Color(num, 0, 0));
    //delay(10);
    Serial.println(num);
    time = millis();
  }

Result

The louder the applause gets, the brighter the lamp becomes. When it reaches to the brightest, the buzzer will give an alarm. When the sound gets below the pre-set value after that, it will take three seconds and then turn off the light and the buzzer. (You can achieve a beautiful frame with LEGO.)

Video