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:
- RAK19007 WisBlock Base Board 2nd Gen
- RAK4631 (nRF52840) core
- RAK18000 or RAK18030 PDM microphone
đź“ť 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.
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…
On the Arduino IDE, navigate to File > Examples > RAKwireless Audio Library > RAK4631 > Audio_Alarm_RAK18003.
Select the board you are using, connect it through the USB cable, and select the respective COM port.
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.
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-01.png200 KB
Updated