Sound Detection Module(KY-037)

아두위키 : Arduwiki
ArduWiki (토론 | 기여)님의 2024년 3월 24일 (일) 11:50 판 (Created page with "{{#seo:|title=아두위키 : 아두이노 소리 감지 모듈(KY-037) 가이드|title_mode=append|keywords=아두이노, 정보과학, 메이커학습, 수행평가, 소리 감지 모듈(KY-037), 아두이노 작품, 캡스톤작품, 아두이노 예제코드|description=아두이노로 소리 감지 모듈(KY-037)을 제어하는 방법(기본정보, 회로, 예제 코드)을 소개합니다. 정보과학과 메이커수업에 활용가능합니다.}} File:소리감...")
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

The Sound Detection Module (KY-037) is a compact and versatile sensor designed for detecting sound levels in the environment. It's commonly used in projects that require noise or sound detection capabilities, such as voice-activated systems, security alarms, or environmental sound monitoring.

Specifications

  • Operating Voltage: 3.3V ~ 5V
  • Output Type: Digital, Analog

Connection

The circuit utilized in the example code below.

An LED can be replaced with another module or omitted entirely.

Resistor Sound Detection Module LED Arduino
VCC 5V
GND - GND
Connection +
DO D8
Connection D7

Example Code

// Code that lights up the LED when the module detects sound.
#define led_pin 7
#define sound_pin 8

float state = 0;

void setup() {
  pinMode(led_pin, OUTPUT);
  digitalWrite(led_pin, LOW);
  pinMode(sound_pin, INPUT);
}

void loop() {
  state = digitalRead(sound_pin);
  if (state == 1) {
    digitalWrite(led_pin, HIGH);
    delay(500);
  } else digitalWrite(led_pin, LOW);
}

Execution Result