模拟分贝计

简介

我们生活的环境中,存在着各种各样的声音,其中一部分是噪音。随着人类文明的发展,安静的环境越来越少,取而代之的是越来越多的噪音。人体如果长时间处于噪音中,会对听觉产生影响,不利于健康。 声级计(又称分贝计、噪音计)是最基本的噪声测量仪器,能够模拟人耳对声波反应速度的时间特性,测量周围环境声音的大小。但目前还没有一款能兼容arduino、简单易用的声级计。 为此,我们新推出了一款arduino兼容的、即插即用的声级计模块,可精确测量周围环境声音的大小。该产品采用仪器级电路方案,低噪麦克风,精度高;支持3.3~5.0V宽电压输入,0.6~2.6V模拟量输出,兼容性好;分贝值与输出电压为线性关系,转换简单,无需复杂的算法;接口即插即用,无需焊接,可方便的应用到现成的系统中。 声级计在环境噪音检测中有着广泛的应用,如公路噪音监测站、居室噪音监测等。有了我们这款声级计模块,DIY一套环境声音检测设备不再有任何难度。

技术规格

引脚说明

分贝计接口管脚定义

标号 名称 功能描述
1 A 模拟信号输出端(0.6~2.6V)
2 + 电源输入正极(3.3~5.0V)
3 - 电源输入负极(0V)

使用教程

本教程将演示如何使用这个分贝计模块,测量周围环境声音的分贝值。

准备

接线图

样例代码

/***************************************************
     DFRobot Gravity: Analog Sound Level Meter
     <https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_Sound_Level_Meter_SKU:SEN0232>

     ***************************************************
     This sample code is used to test the analog sound level meter.

     Created 2017-06-26
     By Jason <jason.ling@dfrobot.com@dfrobot.com>

     GNU Lesser General Public License.
     See <https://www.gnu.org/licenses/> for details.
     All above must be included in any redistribution
     ****************************************************/

/***********Notice and Trouble shooting***************
  1. This sample code is tested on Arduino Uno with Arduino IDE 1.0.5 r2.
  2. In order to protect the microphone on the board, you should not touch the black membrane on the microphone. Also you should keep it clean.
  3. Please do not place this module on the surface of  conductor or semiconductor. Otherwise, this will cause the microphone pin to be shorted.
****************************************************/

#define SoundSensorPin A1  //this pin read the analog voltage from the sound level meter
#define VREF  5.0  //voltage on AREF pin,default:operating voltage

void setup()
{
  Serial.begin(115200);
}

void loop()
{
  float voltageValue, dbValue;
  voltageValue = analogRead(SoundSensorPin) / 1024.0 * VREF;
  dbValue = voltageValue * 50.0;  //convert voltage to decibel value
  Serial.print(dbValue, 1);
  Serial.println(" dBA");
  delay(125);
}

结果

上传完样例代码,打开串口监视器即可看到分贝值,如下图所示,测试环境为办公室。

Soundlevelmeterresult.png

分贝值与电压的关系

这款分贝计模块,分贝值与输出电压为线性关系。当输出电压为0.6V时,分贝值为30dBA。当输出电压为2.6V时,分贝值为130dBA。因此,分贝值(dBA) = 输出电压(V) × 50, 如下图所示:

Voltage-db.png

常见问题

Q1. 为什么测量得到的分贝值不稳定,一直在变化,这正常吗?

Q2. 虽然环境非常安静,但测量得到的分贝值还是不低于30dbA,这是为什么?

更多问题及有趣的应用,可以 访问论坛 进行查阅或发帖。

更多

DFshopping_car1.png DFRobot商城购买链接