Grove - Loudness Sensor

Introduction

3.3V 5.0V Analog

The Grove - Loudness Sensor is designed to detect the sound of environment. Based on LM2904 amplifier and a built-in microphone, it amplifies and filters the high frequency signal that received from the microphone, and outputs a positive envelop. This is used for Arduino’s signal acquisition. The output value depends on the level of sound input. In order to avoid unnecessary signal disturbances, input signal will go through two times’ filtering inside the module. There is a screw potentiometer that enables manual adjustments to the output gain.

Specifications

  • Voltage :3.5~10 VDC
  • Working Frequency :50~2000 Hz
  • Sensitivity : -48~66 dB
  • Signal-to-noise Ratio : >58 dB
  • Output Signal range : Analog Signal (0-1023)

Tip

More details about Grove modules please refer to Grove System

Platforms Supported

Getting Started

With Arduino

Connection

This module uses the chip LM2904 to amplify the electronic signal produced by the mini microphone. At last, you’ll get the analog-to-digital conversion value. Let’s try to read the output value.

Here we will show you how this Grove - Loudness Sensor works via a simple demo. First of all, you need to prepare the below stuffs:

Seeeduino V4 Grove - Loudness Sensor Base Shield
enter image description here enter image description here enter image description here
Get ONE Now Get ONE Now Get ONE Now
  • As the picture on the below indicates, the Loudness sensor is connected to analog port A0 of the Grove - Base Shield.

  • Connect Arduino/Seeeduino to PC by using a USB cable.

Software

  • Copy and paste code below to a new Arduino sketch.
int val;
void setup()
{
    Serial.begin(9600);
}

void loop()
{
    analogRead(0);
    delay(10);
    val = analogRead(0);
    Serial.println(val);
    delay(200);
}
  • Upload the code.
  • Then open the serial monitor to observe the output results. There will be a significant change when blow to the sensor.

Here is the test screenshot from the oscilloscope. The blue line is the original signal from microphone and the yellow is the sig pin of Loudness Sensor. It is the original signal envelope that the module outputs.

Blowing to the sensor:

Speaking to the sensor:

With Raspberry Pi

Connection

  • First, You need to prepare the below stuffs:
Raspberry pi Grove - DHT Sensor pro Grovepi+
enter image description here enter image description here enter image description here
Get ONE Now Get ONE Now Get ONE Now
  • Follow instruction to configure the development environment.

  • Plug the sensor to grovepi socket A0 by using a grove cable.

Software

  • Navigate to the demos’ directory:
    cd yourpath/GrovePi/Software/Python/
  • To see the code
    nano grove_loudness_sensor.py   # "Ctrl+x" to exit #
    import time
    import grovepi

    # Connect the Grove Loudness Sensor to analog port A0
    # SIG,NC,VCC,GND
    loudness_sensor = 0

    while True:
        try:
            # Read the sound level
            sensor_value = grovepi.analogRead(loudness_sensor)

            print "sensor_value =", sensor_value
            time.sleep(.5)

        except IOError:
            print "Error"
  • Run the demo.
    sudo python grove_loudness_sensor.py

Resources


ArduinoWioBeagleBoneRaspberry PiLinkIt ONE

Caution

The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Help us make it better

Welcome to the new documentation system of Seeed Studio. We have made a lot of progress comparing to the old wiki system and will continue to improve it to make it more user friendly and helpful. The improvement can't be done without your kindly feedback. If you have any suggestions or findings, you are most welcome to submit the amended version as our contributor via Github or give us suggestions in the survey below, it would be more appreciated if you could leave your email so that we can reply to you. Happy Hacking!