Introduction
Grove - Sound Sensor can detect the sound intensity of the environment. The main component of the module is a simple microphone, which is based on the LM386 amplifier and an electret microphone. This module's output is analog and can be easily sampled and tested by a Seeeduino.
Features
|
What we need and connection
For this tutorial we will need:
The code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | // test code for Grove - Sound Sensor // loovee @ 2016-8-30 const int pinAdc = A0; void setup() { Serial.begin(115200); //Serial.println("Grove - Sound Sensor Test..."); } void loop() { long sum = 0; for(int i=0; i<32; i++) { sum += analogRead(pinAdc); } sum >>= 5; Serial.println(sum); delay(10); } |
Download the code from here and open it with Arduino IDE.
|
|
Well done!
You have successfully completed one more Arduino Grove tutorial.
I hope you liked this, let me know in the comments.
I hope you liked this, let me know in the comments.