Particle Photon 2

The Photon 2 with Edge ML Kit is a development module with a microcontroller and Wi-Fi networking containing a Realtek RTL8721DM MCU ARM Cortex M33. The form-factor is similar to the Argon (Adafruit Feather), but the Photon 2 supports 2.4 GHz and 5 GHz Wi-Fi, BLE, and has much larger RAM and flash that can support larger applications. Included in the kit are sensors used for embedded machine learning inferencing.

It is intended to replace both the Photon and Argon modules. It contains the same module as the P2, making it easier to migrate from a pin-based development module to a SMD mass-production module if desired.

Particle Photon 2)

Using the Particle Photon 2 with Edge Impulse

To use the Particle Photon 2 device with Edge Impulse you must first install the dependencies (see below). Working with the device involves the use of the Particle Workbench in VS Code. In that environment there are two types of projects that enable the use of the Photon 2 with Edge Impulse:

  • Device Ingestion - Collect data from the device and send it to Edge Impulse. with the Particle Photon2 Ingestion Project.

  • Inference - Run inference on the device with your Particle Photon2 Project flashed via Particle Workbench IDE.

Installing dependencies

To set this device up in Edge Impulse, you will need to install the following software:

Problems installing the CLI?

See the Installation and troubleshooting guide.

Setup the Particle Photon 2 with the accelerometer and PDM microphone

  1. Connect the ADXL362 to the Photon 2 as follows:

ADXL362
Photon 2

VCC

3V3

GND

GND

CS

D18

SCK

D17

MISO (SDO)

D16 (MISO)

MOSI (SDA)

D15 (MOSI)

INT1

not connected

INT2

not connected

  1. Connect the microphone to the Photon 2 as follows:

PDM Mic
Photon 2

VCC

3V3

GND

GND

SEL

Not connected

CLK

A0

DAT

A1

Particle Photon 2 with accelerometer and microphone connected
  1. Plug in the USB Cable to the device

The Ingestion Project

The Particle Ingestion Project is a Particle Workbench project that will collect data from the device and send it to Edge Impulse. To download the ingestion project:

  1. Download the ingestion project from here.

  2. Unzip the file.

  3. Flash the firmware to the device using with the next steps.

Ingestion works with accelerometer only!

Ingestion works only with the accelerometer, microphone support is coming soon.

Flash a Particle Photon 2 Project

The development board does not come with the Edge Impulse firmware. To flash the Edge Impulse firmware:

  1. Open a new VS Code window, ensure that Particle Workbench has been installed (see above)

  2. Use VS Code Command Palette and type in Particle: Import Project

    1. Select the project.properties file in the directory that you just downloaded and extracted from the section above.

  3. Use VS Code Command Palette and type in Particle: Configure Project for Device

    1. Select deviceOS@5.3.2

    2. Choose a target. (e.g. P2 , this option is also used for the Photon 2).

  4. It is sometimes needed to manually put your Device into DFU Mode. You may proceed to the next step, but if you get an error indicating that "No DFU capable USB device available" then please follow these step.

    1. Hold down both the RESET and MODE buttons.

    2. Release only the RESET button, while holding the MODE button.

    3. Wait for the LED to start flashing yellow.

    4. Release the MODE button.

  5. Compile and Flash in one command with: Particle: Flash application & DeviceOS (local)

Local Compile Only! At this time you cannot use the Particle: Cloud Compile or Particle: Cloud Flash options; local compilation is required.

Serial Connection to Computer

The Particle libraries generated by Edge Impulse have serial output through a virtual COM port on the serial cable. The serial settings are 115200, 8, N, 1. Particle Workbench contains a serial monitor accessible via Particle: Serial Monitor via the VS Code Command Palette.

Collecting Data from the Particle Photon 2 - Accelerometer

Before starting ingestion create an Edge Impulse account if you haven't already. Also, be sure to setup the device per the instructions above.

To collect data from the accelerometer please follow these steps. Microphone data can not be directly collected from the Photon 2, so data must be collect from other sources like your computer or cell phone.

  1. Create a new Edge Impulse Studio project, remember the name you create for it.

  2. Connect your device to the Edge Impulse studio by running following command in a terminal:

edge-impulse-data-forwarder --clean

After connecting, the Edge Impulse Data Forwarder will ask to login to your account and select the project. 3. You will be asked you name the axes you're about to sample.

  • For a 3 axes accelerometer it is recommended to name them: accX, accY, accZ, etc.

  1. Open your Edge Impulse Studio Project and click on Data acquisition. Follow the prompts to collect data from your device.

Next steps: Building a machine learning model

With everything set up you can now build your first machine learning model with these tutorials:

Audio Event Detection - Particle Project: Doorbell SMS Responding to your voice - Particle Project: You’re Muted Continuous motion recognition

Looking to connect different devices or sensors? The Data forwarder lets you easily send data from any sensor into Edge Impulse.

Troubleshooting

Should you have any issues with your Particle device please review Particle's Support & Troubleshooting page.

If you have issues with Edge Impulse please reach out!

Last updated

Revision created

Merge branch 'main' into brickml