Skip to content

Demo bird songs detection application with Lacuna Space's LS200 and Arduino Nano 33 BLE Sense

Notifications You must be signed in to change notification settings

edgeimpulse/example-lacuna-ls200

Repository files navigation

Edge Impulse's Simple Example for Lacuna Space's LS200

This example firmware sends LoRa messages to a The Things Network application via both earth-bound LoRa gateways and Lacuna Space's satellite.

The message sent are the classification results of the Bird songs model running on a Arduino Nano 33 BLE Sense. The model classifies audio as either from the house sparrow, rose-ringed parakeet or as background noise. Only when either bird has been classified with a result greater than 0.8 will the Nano 33 BLE sense transmit the results to the LS200.

The LS200 then adds the satellite field and sets it to true. This enables us to determine which messages pass through the satellite.

Note: The example-lacuna-ls200.ino sketch contains placeholders for intialiasing and sending LoRa messages. Please replace with equivalent implementations from your LoRaWAN library.

Requirements

  • Lacuna Space LS200 development kit
  • Arduino Nano 33 BLE Sense
  • (Optional) The Things Network Indoor Gateway

Get in touch with Lacuna Space for hardware and software setup.

Gettings Started

The Things Network Application and Device

  1. Follow these steps to create a TTN application.

  2. Add a device by following these steps. Also, choose ABP as Activation Method.

  3. Disable Frame Counter Checks for your device (Device > Settings).

Add a Data Storage Integration

  1. Add a Data Storage Integration to the application to store data for the last 7 days.

  2. Add a decoder payload function

In TTN console go to Applications > Payload Format > decoder and paste the contents of ttn-payload-function.js into the text field and save the payload functions.

Add deviceAddress, networkKey and appKey

From the TTN console copy (<> msb):

  • Device Address
  • Network Session Key
  • App Session Key

and add it to deviceAddress, networkKey and appKey respectively in example-lacuna-ls200.ino.

Building and Flashing the applications

LS200 application

  1. Build the application:

    ./arduino-build.sh --build
    
  2. Flash the application:

    ./arduino-build.sh --flash
    

Arduino Nano 33 BLE Sense firmware

  1. Clone the Edge Impulse Inc.'s housesparrow-roseringedparakeet-noise-100 model from Edge Impulse Studio

  2. Follow running your impulse arduino guide to export the model as an Arduino library.

  3. Create an sketch from the nano_ble33_sense_microphone_continuous example.

  4. Copy the contents of nano_ble33_sense_microphone_continuous/nano_ble33_sense_microphone_continuous.ino (found in this repo) into your sketch.

  5. Choose the right board, build and flash using Arduino IDE.

Troubleshooting

  • Not flashing? You can double tap the button on the board to put it in bootloader mode.

Board to Board Interface

  • Nano (TX) -> (RX) LS200
  • TX on pin D4.
  • RX on pin 5 on J4.
  • UART (115200 8N1)

Running the application

  1. Use a Tracker or Lacuna Space's Dashboard to determine the next good passing of satellite.

    Note: Only run this application when the satellite is in range.

  2. Reset the LS200. Note via the debug serial that the LS200 displays Waiting for audio trigger...

    Note: ensure LS200 is always resetted after powering the Nano to mitigate synchronization and data corruption issues.

  3. Now just wait for the bird songs to be detected.

  4. Notice that the message is received in your TTN application (Application > Data). The data counter is an even number and the satellite field is set to false.

E.g:

    {
        "housesparrow": "0.91406",
        "redringedparakeet": "0.05078",
        "noise": "0.03125",
        "satellite": false,
    }
  1. Confirm via the serial output that LS200 the sent the message via the satellite. The message should arrive moments later (~6 minutes) in your TTN application with an even counter value and the satellite field being true.

E.g:

    {
        "housesparrow": "0.91406",
        "redringedparakeet": "0.05078",
        "noise": "0.03125",
        "satellite": true,
    }

Fair Access Policy

Consider complying to the Fair Access Policy and use tools like Airtime Calculator (e.g. SF8BW125) to determine the maximum amount of LoRa messages per 24 hours that can be sent in you're region.

(Optional) TTN Indoor Gateway

Consider using a Lora Gateway if there are few in your area. See this map to see gateways near you.

About

Demo bird songs detection application with Lacuna Space's LS200 and Arduino Nano 33 BLE Sense

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published