Difference between revisions of "Noise Alarm--Grumpy Grandpa"
From Microduino Wiki
(Created page with "{{Language| Noise Alarm--Grumpy Grandpa }} {| style="width: 800px;" |- | ==Objective== The "Grumpy Grandpa" can't stand the noise. As soon as he heard big noise, the device wi...") |
(→Principle) |
||
Line 8: | Line 8: | ||
==Principle== | ==Principle== | ||
− | With MIC sound detection sensor to detect | + | With MIC sound detection sensor to detect sound, when the sound exceeds the pre-et value, the device starts timing. |
In order to prevent interference, if the sound which keeps maintain louder than the default value after a certain period of time, then it is considered to be noise and the buzzer will alarm. At the same time, the system can detect whether the key is pressed,. When the key press, the buzzer alarm is closed. | In order to prevent interference, if the sound which keeps maintain louder than the default value after a certain period of time, then it is considered to be noise and the buzzer will alarm. At the same time, the system can detect whether the key is pressed,. When the key press, the buzzer alarm is closed. | ||
[[File: _Grumpy_Grandpa-sch.jpg|600px|center]] | [[File: _Grumpy_Grandpa-sch.jpg|600px|center]] |
Revision as of 03:29, 6 November 2015
Language: | English • 中文 |
---|
ContentsObjectiveThe "Grumpy Grandpa" can't stand the noise. As soon as he heard big noise, the device will alarm. You can press the switch to stop the alarm. PrincipleWith MIC sound detection sensor to detect sound, when the sound exceeds the pre-et value, the device starts timing. In order to prevent interference, if the sound which keeps maintain louder than the default value after a certain period of time, then it is considered to be noise and the buzzer will alarm. At the same time, the system can detect whether the key is pressed,. When the key press, the buzzer alarm is closed. Equipment
Preparation
Program Description
#define mic_pin A0
#define buzzer_pin 6
#define key_pin 4
#define voice 400
if (voice_data > voice)
{
if (millis() - time > 500 )
{
voice_data = analogRead(mic_pin);
if (voice_data > voice)
{
buzzer_speak = true;
i = 200;
}
time = millis();
}
}
if (key_get(key_pin, 0))
{
delay(200);
buzzer_speak = false;
time = millis();
}
if (buzzer_speak)
buzzer();
else
noTone(buzzer_pin); Hardware Buildup
ResultShouting towards the sound detector and keep that for a while, the buzzer will make alarm. By pressing the key, the alarm will stop. Video |