Surilli
Published © LGPL

Sound Detection Using KY-038 Sensor and Surilli Basic M0

It is used to detect sound, for example, when creating a clap on/clap off light switch.

BeginnerFull instructions provided9 minutes147
Sound Detection Using KY-038 Sensor and Surilli Basic M0

Things used in this project

Hardware components

Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Surilli Basic
Surilli Basic
×1
KY-038 Sound Sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Sound Detection Using KY-038 and Surilli Basic M0

Code

Sound_Sensor

C/C++
int Led = 5;// define LED Interface
int buttonpin = 12; // define D0 Sensor Interface
int val = 0;// define numeric variables val
void setup ()
{
 pinMode (Led, OUTPUT) ;// define LED as output interface
 pinMode (buttonpin, INPUT) ;// output interface D0 is defined sensor
}
void loop ()
{
 val = digitalRead(buttonpin);// digital interface will be assigned a value of pin 12 to read val
 if (val == HIGH) // When the sound detection module detects a signal, LED flashes
 {
   digitalWrite (Led, HIGH);
 }
 else
 {
   digitalWrite (Led, LOW);
 }
} 

Credits

Surilli

Surilli

196 projects • 45 followers
Surilli is a premiere Internet of Things centric Technology Company aimed at providing cutting edge innovative solutions.

Comments