Maker.io main logo

Creating a BLE Background Noise Sensor with Adafruit Feather RP2040

2024-07-01 | By Sheikh Shuhad

License: General Public License Bluetooth / BLE Adafruit Feather RP2040

Introduction

This tutorial demonstrates how to connect a PDM MEMS Microphone to an Adafruit Feather RP2040 and use a BleuIO to create a background noise sensor that measures and advertises the current sound level in decibels (dB). The project leverages the Arduino PDM interface to continuously fill a buffer with data, translating it into the current sound level every time the buffer is full.

Requirements

Connecting the PDM Microphone

1. Wiring the Microphone:

  • 3V to 3.3V on the Feather to power the device.

Connecting the PDM Microphone

  • GND to GND.
  • DAT to SDA.
  • CLK to SCL.

Connecting the PDM Microphone

Running the Example

1. Connect the BleuIO Dongle:

  • Ensure the BleuIO Dongle is connected to the Feather RP2040 Board.

2. Connect the Feather RP2040 to Your Computer:

  • Use a USB cable to connect the Feather RP2040 Board to your computer.
  • Make sure the Feather RP2040 Board is selected as well as the correct COM port in the Arduino IDE dropdown menu.

Select Feather Board

3. Adjust Update Frequency (Optional):

  • You can change how often the advertising message is updated with the dB value in the code:
Copy Code
 // How often we update the advertising message (in seconds) #define READ_UPDATE_FREQUENCY 1 

4. Upload the Code:

  • Click the Upload button in the Arduino IDE to upload the code to the Feather RP2040.

Upload Button

5. Start Advertising:

  • Once uploaded, the dongle should begin advertising the sensor values. It may take about 10 seconds for the advertising to start as the BleuIO bootloader opens and closes.

6. Monitor the Serial Output (Optional):

  • Open the Serial Monitor from the menu: `Tools > Serial Monitor`.
  • You should now see the output from the project.

Serial Monitor Output

Scanning the Results

To see the results, use any BLE scanner app. Here, we use nRF Connect:

nRF Connect Result

The data in the red box represents the sensor values. For example, if the value is `0x0032`, it translates to:

 0x0032 = 50 dB

By following this tutorial, you've successfully created a background noise sensor using an Adafruit Feather RP2040 and a BleuIO Bluetooth Low Energy USB Dongle. This project demonstrates how to measure and advertise sound levels in decibels, which can be useful in various applications such as environmental monitoring and smart home systems. Happy building!

制造商零件编号 SSD005/4-V2B
BLUETOOTH 5 LOW ENERGY USB DONGL
Smart Sensor Devices
¥256.49
Details
制造商零件编号 SSD005/4-V2W
BLUETOOTH 5 LOW ENERGY USB DONGL
Smart Sensor Devices
¥256.49
Details
制造商零件编号 3492
PDM MEMS MICROPHONE BREAKOUT
Adafruit Industries LLC
¥40.29
Details
制造商零件编号 5723
ADAFRUIT FEATHER RP2040 WITH USB
Adafruit Industries LLC
¥142.45
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum