The DecibelMeter library provides an easy and efficient way to integrate decibel level measurement into Arduino projects using the PCB Artists I2C decibel meter sensor. It abstracts the complexity of I2C communication into a simple interface that can be used to read sound levels directly in decibels.
- Simple interface to read decibel levels from an I2C sensor.
- Default support for common I2C address and register but allows for customization.
- Lightweight and easy to integrate into various Arduino-based projects.
- Navigate to the GitHub repository.
- Locate the "Code" button near the top right of the page and click it.
- From the dropdown, select "Download ZIP".
- Save the ZIP file to your computer
- Open the Arduino IDE and navigate to
Sketch > Include Library > Add .ZIP Library...
. - Select the ZIP file you downloaded and click "Open".
- Restart the Arduino IDE to see the library in the list of installed
Optionally, you can also install the library manually by following these steps:
- Extract the ZIP and move the
DecibelMeter
folder to your Arduino IDE'slibraries
directory. - Restart the Arduino IDE to see the library in the list of installed libraries.
- DecibelMeter(): Constructor. Initializes a DecibelMeter object with default settings.
- void begin(): Initializes the library and prepares the sensor for reading decibel levels.
- float readDecibels(): Returns the current decibel level as measured by the sensor.
- void setDeviceAddress(byte address): Sets a new I2C address for the sensor, if different from the default.
- void setRegisterAddress(byte reg): Sets a new register address for reading the decibel level, if different from the default.
For detailed examples and additional information, please refer to the examples
folder within the library.