Sound Location with the Qwiic Sound Trigger and the u-blox ZED-F9x

Pages
Contributors: PaulZC
Favorited Favorite 3

Software Setup

  • Ensure you have the SparkFun Apollo3 boards installed
  • This code has been tested using version 1.2.1 of the Apollo3 boards on Arduino IDE 1.8.13.
  • Select "SparkFun Artemis MicroMod" as the board type.
  • Press upload to upload the code onto the Artemis.
  • Open the Serial Monitor at 115200 baud to see the output.

Each time the Qwiic Sound Trigger detects a sound, it pulls its TRIG pin high. The ZED-F9P will detect this on its INT pin and generate a TIM_TM2 message. The Artemis will log the TIM_TM2 messages to SD card. You can then study the timing of the sound pulse with nanosecond resolution and calculate the location of the sound!

The code will "debounce" the sound event and reset the VM1010 for the next event after 250ms.

Note: TIM_TM2 can only capture the timing of one rising edge and one falling edge per navigation solution. So with setNavigationFrequency set to 4Hz, we can only see the timing of one rising edge every 250ms. The code "debounces" each sound event to make sure there will only be one rising edge event per navigation solution.

TIM_TM2 messages are only produced when a rising or falling edge is detected on the ZED-F9P’s INT pin. If you disconnect your TRIG to INT jumper wire, the messages will stop.

Data is logged in u-blox UBX format. Please see the u-blox protocol specification for more details. You can replay and analyze the data using u-center should you want to.