MisterBotBreak
Published

How to Use a Big Sound Sensor

This project will show you how to use a big sound sensor ( KY-038 ). We'll display the values on the serial monitor.

BeginnerProtip1 hour13,120
How to Use a Big Sound Sensor

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
Big sound sensor
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Code of Big Sound Sensor module

Arduino
A limit value is defined in relation to a given normal value and the module emits a signal if this limit is exceeded ( here " reached " ).
int Analog_Pin = A0; 
int Digital_Pin = 3; 
  
void setup ()
{
  pinMode(Analog_Pin, INPUT);
  pinMode(Digital_Pin, INPUT);
       
  Serial.begin (9600); 
}
  
void loop ()
{
  float Analog;
  int Digital;
    
 
  Analog = analogRead (Analog_Pin);
  Digital = digitalRead (Digital_Pin);
    
 
  Serial.print("Analog voltage :"); 
  Serial.print(Analog, 4);  
  Serial.print("V, ");
  Serial.print("Limit :");
  
  if(Digital==1)
  {
      Serial.println(" reached ");
  }
  else
  {
      Serial.println(" Not yet reached ");
  }
  Serial.println("----------------------------------------------------------------");
  delay (200);
}

Credits

MisterBotBreak

MisterBotBreak

40 projects • 81 followers
I love electronic and I make explanatory project on how to control sensors.

Comments