The Particle Photon 2 is a development module with a microcontroller and Wi-Fi networking. The board itself doesn't include any sensors, but we added examples for both microphone and accelerometer.
The firmware is based on following sensors:
- Adafruit PDM microphone
- Analog Devices ADXL362 MEMS accelerometer
The libraries used to control and get data from the sensors are already included in this repository.
How to connect the hardware can be found on our docs page for the Photon 2.
By default the firmware includes the motion recognition model. You can replace this model with a your model deployed in Edge Impulse. Following steps show how you can replace the model:
-
In Edge Impulse studio, deploy your model as a Particle Library
-
From this folder remove the folders
edge-impulse-sdk
,tflite-model
andmodel-parameters
-
Copy the equally naming folders from the downloaded model into the
src
folder -
Rebuild and flash the firmware to device
To build the firmware and upload a binary to the Photon 2, Particle provides the Workbench VsCode extension. Please follow the Particle Workbench guide lines on setting up the tool
-
In Workbench, select Particle: Import Project and select the
project.properties
file in the directory that you just downloaded and extracted. -
Use Particle: Configure Project for Device and select [email protected] and choose a target. (e.g. P2 , this option is also used for the Photon 2).
-
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.
Next to the Workbench extension, this folder contains a Dockerfile that allows building of Particle firmware.
Build the Docker container:
docker build -t particle-build .
Run the container and build the firmware
docker run --rm -it -v $PWD:/app particle-build /bin/bash -c "./particle-build.sh --build"
Flashing your Particle device requires the Particle command line tool. Follow these instructions to install the tools.
Once the tool is installed, following command is used to upload a binary to the device:
particle flash --local target/p2/app.bin