High Sensitive Microphone Sound Sensor Detection Module LM393 เซ็นเซอร์ไมโครโฟน AVR PIC ความไวสูงเสียง
For Arduino NodeMCU Wemos
เซนเซอร์เสียง ให้สัญญาณแบบ analog และ digital สามารถปรับความไวได้
Features:
100% Brand new and high quality
For sound detection module has two outputs:
1. AO analog output real-time output voltage signal of the microphone
2. DO when the sound intensity reaches a certain threshold the output high and low signal
Module features:
1. There is a mounting screw hole 3mm
2. The use 5v DC power supply
3. With analog output
4. There are threshold level output flip
5. High sensitive microphone and high sensitivity.
6. A power indicator light
7. The comparator output is light
ตัวอย่างการใช้งานแบบ Digital Output:
int led = D3; // LED output
int input_pin = D2; //ต่อ D0 Sound Sensor
int val = 0 ;// variables val
void setup()
{
pinMode(led OUTPUT);// LED output
pinMode(input_pin INPUT);// กำหนด เป็น input
Serial.begin(9600);
}
void loop()
{
val = digitalRead(input_pin); // อ่านค่า ที่ input_pin_d0
if(val == HIGH)
{
digitalWrite(led HIGH);
Serial.println(val);
delay(1000); // ไฟติด 1 นาที แล้วดับ
}
else
{
digitalWrite(led LOW);
Serial.println(val);
}
}
ตัวอย่างการใช้งานแบบ Analog Output:
int sensorPin = A0; // select the input pin for the potentiometer
int outputD3 = D3; //D3 เป็น output
int sensorValue = 0;
void setup() {
pinMode(outputD3 OUTPUT);
digitalWrite(outputD3 HIGH);
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue DEC);
if(sensorValue >= 20)
{
digitalWrite(outputD3 HIGH);
delay(5000);
}
else{
digitalWrite(outputD3 LOW);
}
delay(100);
}
#sound Senser #เซ็นเซอร์เสียง #เซ้นเซอร์ไมโครโฟน