-
In Workbench, select Particle: Import Project and select the
project.properties
file -
Use Particle: Configure Project for Device and select the platform such as P2 and the latest 5.x or 6.x release.
-
Compile with Particle: Compile application (local)
-
Flash with Particle: Flash application (local)
At this time you cannot use the Particle: Cloud Compile or Particle: Cloud Flash options; local compilation is required.
The Keyword Spotting tutorial is reference project to identify the keywords "Yes" and "No" in audio data received from a PDM microphone.
This solution is designed for Particle devices like the Photon 2, Boron, and M-SoM.
- Edge Impulse Integration: Uses Edge Impulse's machine learning capabilities to train a model for your own keywords.
- Seamless Deployment: Supports Particle devices such as the Photon 2, Boron, and M-SoM, enabling efficient edge processing.
- Versatile Applications: Suitable for applications such as smart home systems.
To complete this project, you will need:
- Particle Device: Photon 2, Boron, or M-SoM.
- PDM microphone
- Edge Impulse Account: Sign up at Edge Impulse to train the model.
- Connect a microphone to your Particle device (Photon 2, Boron, or M-SoM).
The pins needed for Adafruit PDM microphones are:
Breakout Pin | Particle Pin | Description | Color |
---|---|---|---|
3V | 3V3 | Power 3.3V | Red |
GND | GND | Ground | Black |
SEL | Left/Right Select | No Connection | |
CLK | A0 | PDM Clock | Blue |
DAT | A1 | PDM Data | Green |
- SEL - Left/Right select. If this pin is high, the output is on the falling edge of CLK considered the 'Right' channel. If this pin is low, the output is on the rising edge, a.k.a 'Left' channel. Has a pull-down to default to left so you can leave it unconnected.
- CLK - PDM clock into breakout board, 1 - 3 MHz square wave required.
- DAT - PDM data out of breakout board
On the nRF52 (Boron, etc.) the PDM CLK and DAT lines are configurable to other pins, but on RTL872x, only specific pins can be used:
Signal | P2/Photon 2 | M-SoM/Muon | nRF52 |
---|---|---|---|
CLK | A0 | A3 | Any |
DAT | A1 | A4 | Any |
On both MCUs, the built-in hardware PDM decoder is used, along with DMA to write to the buffer, so the operation is very efficient and does not block the execution of your code while sampling audio.
- Set up your Particle device in the Particle Console to ensure it’s online and ready to transmit data.
- Log into Edge Impulse and create a new project for keyword detection.
- Go to the Data Acquisition tab and collect sample data for the words you wish to detect. If you are generating your own audio sample data, you can generate samples using your phone, which is often easier than getting the raw samples off your Particle device.
- In Edge Impulse, go to Create Impulse and select a suitable Signal Processing Block (e.g., Spectral Analysis) for audio or vibration data.
- Add a Learning Block for classification.
- Go to the Training tab, configure training parameters, and start training the model.
- Monitor the training results to ensure high accuracy in distinguishing running water sounds.
- Once the model is trained, go to the Deployment tab in Edge Impulse.
- Export the model as a C++ library or a Particle-compatible model file.
- Upload the model to your Particle device using the Particle CLI or Web IDE.
- Configure the device firmware to run the model and classify data from the sensor.
- Deploy the Particle firmware and begin testing the device in real-world conditions.
- Use the Edge Impulse Live Classification feature to validate model accuracy.
- Fine-tune the model as needed by collecting additional data or adjusting training parameters.