How To Build Your Own Noise Level Alarm

KHM-022-00.png

Cities, industries, and citizens are realizing that noise pollution caused by human activities such as entertainment, urban traffic, and industrial sources has a negative impact on health, productivity, and the economy. Whether you are a city official, a farmer, or an operations manager, you want to make sure that noise levels are kept within wellness-required limits.

This guide will teach you how to create a noise level alarm using WisBlock.

If you are a visual learner, you can watch the video tutorial instead.

Hardware

To carry out this test you need some WisBlock hardware:

đź“ť NOTE: This is also compatible with the ESP32 and RP2040 cores.

Software

  • Arduino IDE

Follow the installation guide of BSP to set up your Arduino IDE to program WisBlock boards.

WisBlock Assembly

To put together the different modules, you need to connect them to the respective slots in the base board. For further information, refer to the Assembling and Disassembling section in the Quick Start Guide.

KHM-022-01.png

KHM-022-02.png

Code

To open the code, first, you need to install the RAKwireless Audio Library from our repository.

Download it, and search for the ZIP file by navigating to Sketch > Include Library > Add .ZIP Library…

KHM-022-03.png

On the Arduino IDE, navigate to File > Examples > RAKwireless Audio Library > RAK4631 > Audio_Alarm_RAK18003.

KHM-022-04.png

Select the board you are using, connect it through the USB cable, and select the respective COM port.

KHM-022-05.png

Modify the noise level threshold by decreasing the audio_threshold variable for a more sensitive alarm or increasing it for a less sensitive alarm.

//Alarm threshold
int audio_threshold = 1000; //You can modify this value to your desired noise trigger threshold.

Click Upload, and wait for the core to be flashed.

KHM-022-06.png

Testing

Once the code is uploaded, you can play some music or start talking and see how your board hears you and activates its LEDs when you reach a certain level of loudness meanwhile.

Instead of just controlling LEDs, you can modify the code to send an email notification or to drive a screen to show a dB live measurement.

KHM-022-07.png

KHM-022-08.png

Updated