[Learn, Build & Win] SonoGuard Update 1: MAX32655FTHR Hardware Bring-Up & I2C Codec Probe

Hello everyone! I’m Christy Roy, and this is the first major progress update for SonoGuard—my edge-AI acoustic hazard wearable for the DigiKey and Circuit Digest “Learn, Build & Win” contest, built on the MAX32655FTHR application platform.

The goal of this project is to detect environmental hazards (like reversing beepers or sirens) using TinyML/DSP and inject a warning tone directly into a user’s hearing protection headset. Over the past few days, I’ve completed the foundational hardware bring-up and toolchain configuration.

1. Board Verification & Toolchain Setup

  • Received the MAX32655FTHR and verified the factory BLE firmware using the LightBlue mobile app.

  • Configured the development environment using Analog Devices’ CodeFusion Studio (CFS) and the MSDK in VS Code.

  • Tip for others using this SDK: Ensure your project workspace path contains zero spaces

    . The make build system will immediately fail if it encounters a space in the directory path!

2. Custom Firmware & DAPLink UART

  • Created a clean repository with a customized project.mk file explicitly targeting BOARD=FTHR_Apps_P1 to ensure correct pin mapping.
  • Wrote and flashed a custom C program to verify GPIO and serial output. Successfully toggled the onboard Red LED on pin P0.18.
  • Verified serial console communications through the onboard DAPLink virtual UART interface at 115200 baud.

3. I²C Bus & Codec Probing (The Audio Pipeline)

The most critical path of this project is the audio routing. The digital microphone does not connect directly to the MCU; it routes through the MAX9867 stereo audio codec.

  • Before attempting I²S audio capture, I needed to ensure the MCU could command the codec. I ran an I²C scanner on pins P0.16 (SCL) and P0.17 (SDA).

Result: Successfully detected the MAX9867 codec at the hardware address 0x18.

Next Steps

With the codec responding, the next step is to configure its internal registers to route the digital microphone to the I²S output. In analyzing the max9867.c driver, I discovered that the board’s 12.288 MHz master clock will yield a 24 kHz audio sample rate. I am currently updating my Python DSP prototype to use 24 kHz parameters so the FFT frequency bins align perfectly when I port the CMSIS-DSP C code to the C

ortex-M4F.

Will post another update once raw audio is successfully capturing to the SD card!

Project Repository: GitHub - Christy-Roy-tech/SonoGuard-MAX32655FTHR · GitHub

Project: An edge-AI acoustic hazard alert wearable. It listens through the on-board microphone and detects hazard sounds on the board itself, with no cloud. This is meant for people wearing hearing protection.

What works so far

  1. Toolchain: CodeFusion Studio in VS Code builds and flashes the board. I added a small delay after every I2C write in the MAX9867 driver, because without it the codec init failed with a busy error (-6).
  2. Audio capture: The MAX9867 codec (I2C address 0x18) streams the on-board microphone over I2S at 48 kHz, 16-bit mono.
  3. microSD recording: I recorded 5-second clips to the card and opened them in Audacity. My first file played slow and deep, because the WAV header said 24 kHz while the data was 48 kHz. Setting the correct 48 kHz rate fixed the pitch and tempo.
  4. Live detector: DMA with two ping-pong buffers (512 samples each) captures audio continuously. Each frame gets a CMSIS-DSP real FFT, and the board computes a tonal ratio: the energy near the peak divided by the total energy.
  5. Result with a 1250 Hz test tone: The tonal ratio reached about 79 to 100 percent while the tone played. A debounce (several consecutive frames) and a cooldown keep the serial output readable.

What did not work, and what I learned

My first detector only looked at bins around 1250 Hz. When I played an industrial alarm from YouTube, it was not detected, because its energy sat outside that band. A wider band detects more sounds, but a tonal-ratio check on a single frame can also be triggered by whistles or other steady tones. I have not yet measured how it behaves with speech or claps, so I am not making any claim about that.

Not done yet

  • Timing (cadence) checks for beepers and sirens, to separate real alarms from whistles
  • A measured test: detected alarms and false alarms, with the same speaker at a fixed distance and volume
  • Alert sound through the headphone jack, with a mute window
  • A PySide6 dashboard with live waveform, spectrum and alert history
  • Bluetooth Low Energy alert logging
  • Battery and fuel-gauge readout (I am currently USB powered, with no battery)

Next update will include the measured results table and a demo video.

SonoGuard: an alarm-tone detector and BLE alert beacon on the MAX32655FTHR

Project status: complete working prototype, final submission. The full alert chain works end to end on the bench: microphone, detection, headphone chime, dashboard and a Bluetooth beacon to a second device.

Why I built it

In loud industrial sites and mines, workers wearing helmets and hearing protection can miss alarms. SonoGuard is a prototype of a small wearable-style device that listens for alarm tones and alerts the wearer through headphones.

What I built

On the MAX32655FTHR (Cortex-M4F with floating point and the CMSIS-DSP library):

  1. Audio capture from the on-board microphone at 48 kHz, 16-bit mono (MAX9867 codec, I2S, DMA ping-pong buffers).
  2. Every 21.3 ms: DC removal, a Hann window and a 1024-point FFT.
  3. A learned noise floor (2 seconds at start) and a tone-purity measure: the energy around the strongest frequency divided by the energy in the search band.
  4. On an alert: a short chime in the headphones (with a mute window so the board does not hear itself) and a 3-second non-connectable Bluetooth Low Energy beacon. A separate ESP32 receives it without pairing.()
  5. A PySide6 dashboard with the waveform, spectrum, spectrogram and detector state, plus Real / False alarm buttons that log to a CSV.

The detection uses classic signal processing, not machine learning.

Results from my bench tests

  • Beeper (peak at about 4 kHz): 8 alerts, all real, with tone purity 94 to 98%.
  • Alarm played from a phone/YouTube: 2 detected.
  • Clapping and a running fan: no alerts.
  • Singing continuously gave 3 false alarms with 2 pulses required. After requiring 3 pulses, singing for 2 min gave 0 false alarms.
  • Headphone chime: played on alerts. ESP32: received the beacon over BLE without a connection.
  • Full firmware with the BLE stack: [278,676 B] flash ([54.87]% of 496 KB) and [50,912 B] static SRAM ([38.84]% of 128 KB).

Current limitations

These are short, single-session counts, not accuracy figures. I tested in a quiet room with a fan, claps and singing, not in a loud industrial setting. Some alarms are broadband and are not covered. The board ran on USB with no battery. It is a prototype, not a safety device.

Future aims

  • Test in loud, realistic industrial noise.
  • Measure accuracy per alarm type on a fixed clip set, false alarms per hour and detection delay.
  • Boards that relay each other’s alerts, so a person out of sight of the hazard is still warned (today it is one board to one receiver).
  • Battery operation with a fuel gauge and a measured runtime.
  • Helmet integration and BLE range testing.
  • Compare the rule-based detector with a small neural-network classifier trained on recorded clips of real alarms and industrial noise, and measure whether it reduces false alarms and misses.

Links

Code, dashboard and ESP32 sketch: GitHub - Christy-Roy-tech/SonoGuard-MAX32655FTHR · GitHub
Demo video (30 s, phone recording, so the screen text is small): https://drive.google.com/file/d/1iD2Uluh6C3fhrXsddJXi7_7FHCwZuUgD/view?usp=sharing