The Sound sensor module is a simple microphone. Based on the power amplifier LM386 and the electret microphone, it can be used to detect the sound strength of the environment.
Grove - Sound Sensor can detect the sound strength of the environment. The main component of the module is a simple microphone, which is based on the LM358 amplifier and an electret microphone. This module's output is analog and can be easily sampled and tested by a Seeeduino.
Follow these steps to build a sample Grove circuit using this module but without using any microcontroller board:
You can use either the Grove - USB Power module or the Grove - DC Jack Power module for building this Grove circuit.
Follow these simple steps to build a Grove circuit using the light sensor:
// Function: If the sound sensor senses a sound that is up to the threshold you set in the code, the LED is on for 200ms. // Hardware: Grove - Sound Sensor, Grove - LED /*macro definitions of the sound sensor and the LED*/ #define SOUND_SENSOR A0 #define LED 3 // the number of the LED pin #define THRESHOLD_VALUE 400//The threshold to turn the led on 400.00*5/1024 = 1.95v void setup() { Serial.begin(9600); pins_init(); } void loop() { int sensorValue = analogRead(SOUND_SENSOR);//use A0 to read the electrical signal Serial.print("sensorValue "); Serial.println(sensorValue); if(sensorValue > THRESHOLD_VALUE) { turnOnLED();//if the value read from A0 is larger than 400,then light the LED delay(200); } turnOffLED(); } void pins_init() { pinMode(LED, OUTPUT); pinMode(SOUND_SENSOR, INPUT); } void turnOnLED() { digitalWrite(LED,HIGH); } void turnOffLED() { digitalWrite(LED,LOW); }If the sound of the environment is greater than the threshold, then the LED will light up.
This Grove module is available as part of the following Grove Kit Series:
Alternatively, it can be bought stand-alone here at the Seeed Studio Bazaar.
File name | Annotation | |
---|---|---|
No files |
Comments