Difference between revisions of "Applause Enthusiasm Detection"
(Created page with "{{Language|Applause Enthusiasm Detectio}} {| style="width: 800px;" |- | ==Objective== Here we’ll detect applause. The louder it gets, the brighter the light turns. When the ...") |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | {{Language|Applause | + | {{Language| Applause Sound Detector }} |
{| style="width: 800px;" | {| style="width: 800px;" | ||
|- | |- | ||
| | | | ||
==Objective== | ==Objective== | ||
− | + | Detection of applause: The longer the sound duration lasts, the stronger the light becomes. When the light gets to the brightest, the buzzer gives an alarm. | |
+ | [[File: Applause_heat.jpg|600px|center]] | ||
+ | |||
==Principle== | ==Principle== | ||
+ | With MIC sound detection sensor to detect the applause sound, when the sound is louder than the pre-set sound value, the device starts counting, the longer the time gets, the greater the data becomes while the color of the lights are becoming brighter. When it reaches a certain value, the brightness of the light turns to the maximum and at the same time, the buzzer starts giving an alarm. The system detects sound every three seconds. When there is no sound, the light and the alarm will stop. | ||
+ | [[File: Applause_heat-sch.jpg|600px|center]] | ||
==Equipment== | ==Equipment== | ||
Line 16: | Line 20: | ||
|[[Microduino-Sensorhub]]||1||Sensor pinboard | |[[Microduino-Sensorhub]]||1||Sensor pinboard | ||
|- | |- | ||
− | |[[Microduino- | + | |[[Microduino-Sound]]||1||Sound detection sensor |
|- | |- | ||
− | |[[Microduino- | + | |[[Microduino-Color LED]]||1||LED sensor |
|- | |- | ||
− | |[[Microduino- | + | |[[Microduino-Buzzer]]||1||Buzzer sensor |
|- | |- | ||
− | | [[Microduino-BM]]||1|| | + | | [[Microduino-BM]]||1||Baterry management |
− | |} | + | |} |
+ | [[File: Applause_heat_module.jpg|600px|center]] | ||
− | + | ==Preparation== | |
+ | *Setup 1: Use a USB cable to connect the CoreUSB and the PC/Mac, the open Arduino IDE. | ||
+ | [[File:CoreUSB_Ble_pc.jpg|600px|center]] | ||
+ | *Setup 2: Download program and open IDE, or copy the program to: | ||
+ | [https://github.com/Microduino/Microduino_Tutorials/tree/master/MCookie_Tutorial/Applause_heat Applause_heat] | ||
+ | [[File: Applause_heat_ino.jpg|600px|center]] | ||
+ | * Setup 3: Load the code, choose the right board and COM port for program download after compiling. | ||
− | == | + | ==Program Description == |
− | * | + | *Control pin definition: Connect the Color LED to D4, MIC sound sensor to A0 and the Buzzer to 6. Users can customize the pin definition. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<source lang="cpp"> | <source lang="cpp"> | ||
#define PIN 4 | #define PIN 4 | ||
Line 50: | Line 48: | ||
#define buzzer_pin 6 | #define buzzer_pin 6 | ||
</source> | </source> | ||
− | + | *Sound pre-set value: The outside sound larger than the value will be considered as noise. Users can customize the pre-set value based on personal needs. | |
− | *Sound pre-set value | ||
<source lang="cpp"> | <source lang="cpp"> | ||
#define voice 400 | #define voice 400 | ||
</source> | </source> | ||
− | * | + | *When the sound value is larger than the pre-set value, the light will get brighter and brighter, and when it reaches to the maximum, the buzzer will make alarm. Users can change the value of "225" and see what happens. |
<source lang="cpp"> | <source lang="cpp"> | ||
if (voice_data > voice) | if (voice_data > voice) | ||
Line 71: | Line 68: | ||
} | } | ||
</source> | </source> | ||
+ | *Time 3s to detect if the sound is noise. If not, the light and the alarm will stop. | ||
+ | <source lang="cpp"> | ||
+ | if (millis() - time > 3000 ) | ||
+ | { | ||
+ | voice_data = analogRead(mic_pin); | ||
+ | if (voice_data < voice) | ||
+ | { | ||
+ | colorWipe(strip.Color(0, 0, 0)); | ||
+ | num = 10; | ||
+ | noTone(buzzer_pin); | ||
+ | } | ||
+ | time = millis(); | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | ==Hardware Buildup== | ||
+ | *Setup 1: Connect the Buzzer to the Sensorhub D6, the Color LED to D4, and the Sound sensor to A0. | ||
+ | [[File:CoreUSB_Applause_heat.jpg|600px|center]] | ||
+ | *Setup 2: Connect the activated battery box and the BM module. | ||
+ | [[File:CoreUSB_Ble_steup2.jpg|600px|center]] | ||
+ | *Setup 3: Then, stack all modules together without considering order. Congratulations! You've finished the circuit buildup. | ||
+ | [[File: CoreUSB_Applause_heat_all.jpg|600px|center]] | ||
+ | * Setup 4: DIY your LEGO Applause Enthusiasm Detector . | ||
+ | [[File: CoreUSB_Applause_heat_over.jpg|600px|center]] | ||
+ | If modules cannot work normally, please try to power off and re-connect. | ||
+ | [[File: Applause_heat_over1.jpg|600px|center]] | ||
==Result== | ==Result== | ||
− | The | + | The greater the applause sound is, the brighter the LED light gets. when the light gets to the brightest, the Buzzer will give an alarm. When the sound is below the pre-set value and lasts for three seconds, the light and the alarm will stop. You can also build a beautiful shell with LEGO boards since mCookie can be freely stacked with LEGO boards. |
− | |||
==Video== | ==Video== | ||
|} | |} |
Latest revision as of 06:53, 30 September 2016
Language: | English • 中文 |
---|
ContentsObjectiveDetection of applause: The longer the sound duration lasts, the stronger the light becomes. When the light gets to the brightest, the buzzer gives an alarm. PrincipleWith MIC sound detection sensor to detect the applause sound, when the sound is louder than the pre-set sound value, the device starts counting, the longer the time gets, the greater the data becomes while the color of the lights are becoming brighter. When it reaches a certain value, the brightness of the light turns to the maximum and at the same time, the buzzer starts giving an alarm. The system detects sound every three seconds. When there is no sound, the light and the alarm will stop. Equipment
Preparation
Program Description
#define PIN 4
Adafruit_NeoPixel strip = Adafruit_NeoPixel(6, PIN, NEO_GRB + NEO_KHZ800);
#define mic_pin A0
#define buzzer_pin 6
#define voice 400
if (voice_data > voice)
{
num++;
if (num > 255)
{
num = 255;
buzzer();
}
colorWipe(strip.Color(num, 0, 0));
//delay(10);
Serial.println(num);
time = millis();
}
if (millis() - time > 3000 )
{
voice_data = analogRead(mic_pin);
if (voice_data < voice)
{
colorWipe(strip.Color(0, 0, 0));
num = 10;
noTone(buzzer_pin);
}
time = millis();
} Hardware Buildup
If modules cannot work normally, please try to power off and re-connect. ResultThe greater the applause sound is, the brighter the LED light gets. when the light gets to the brightest, the Buzzer will give an alarm. When the sound is below the pre-set value and lasts for three seconds, the light and the alarm will stop. You can also build a beautiful shell with LEGO boards since mCookie can be freely stacked with LEGO boards. Video |