OpenEar: An Open-Source, Self-Tunable Assistive Hearing Device on the MAX32655FTHR

Hi everyone! I’m Khushit Shah, 14, from Ahmedabad, India. I lead the engineering side of PixelDrive, a STEM Racing team that became regional champions in Gujarat and won Best Newcomer at the Season 8 Nationals.

This is my project for the Learn, Build & Win program.

The idea

Most hearing aids are closed systems. Their processing, settings and fitting methods are largely hidden from the user. I want to explore a different approach: an open-source assistive-listening device where the signal processing is transparent, the settings are adjustable, and users can experiment with how sound is amplified.

OpenEar is built around the Analog Devices MAX32655FTHR. The long-term goal is to let a user run a simple hearing test through a phone interface and use the results to generate a starting audio profile.

This is an experimental assistive-listening prototype, not a medical device or a replacement for professional hearing care.

What I’m building

  • Six-band audio processing: Splits sound into six frequency bands, with crossovers at 250 Hz, 500 Hz, 1 kHz, 2 kHz and 4 kHz.
  • Adjustable amplification: Each band has independent gain, compression and noise-gate settings.
  • Feedback protection: A howl guard helps control acoustic feedback, while a limiter enforces an output ceiling.
  • Phone interface: A Bluetooth LE-connected web app for hearing-test-based fitting and live audio-level monitoring.
  • Audio recording: A microSD recorder designed to save the raw microphone signal and processed output as a stereo WAV file.
  • Open source: The project is intended to be released under the MIT licence.

The engineering challenges

I’m using time-domain filters rather than FFT-based processing to keep latency low. My PC simulations indicate approximately 3.3 ms of buffering by design, plus around 1 ms of filter delay. These are simulation results, and measuring actual end-to-end hardware latency is still an important task.

The audio pipeline also needs to coexist with Bluetooth communication, serial debugging and SD-card operations without interrupting real-time audio processing.

Safety limits are built into the DSP itself: band gain is capped at +30 dB, output is limited to −3 dBFS, test tones are capped at −20 dBFS, and invalid numerical inputs fall back to a quiet setting.

What’s done so far

Before the board arrived, I developed and tested the DSP and console logic on a PC.

  • 19 DSP checks pass, including band-split response, filter delay, limiter behaviour and simulated feedback control.
  • The six-band response sums back to within 0.07 dB of flat in simulation.
  • Filter delay in the speech band is under 2 ms in simulation.
  • 51 console checks pass.
  • The firmware builds in five variants, and the phone app has been tested against a simulated device and the console protocol.

These results establish a software baseline, not proof of working hardware. The next step is to validate the complete signal path on the MAX32655FTHR and measure real-world performance.

What’s next

My priorities are to bring up the hardware, verify microphone input and audio output independently, get the DSP running in real time, and measure latency and CPU usage. After that, I’ll work on the Bluetooth fitting interface, SD-card recording and a compact 3D-printed enclosure.

I’ll share progress, measurements, problems and fixes as the project develops over the coming week.

I’m especially interested in advice from anyone who has worked with low-latency embedded audio, I²S/DMA pipelines or Bluetooth LE alongside real-time audio processing.

Thanks for reading!

Hey everyone, a huge thank you to Circuit Digest and DigiKey for hosting this contest and being such a cool, supportive community to build with! I am excited to share the latest progress on the OpenEar hardware bring-up, live DSP tuning, and audio debugging.

Project: OpenEar — An open-source, self-tunable assistive hearing device
Hardware: Analog Devices MAX32655FTHR
Contest: CircuitDigest × DigiKey Learn, Build & Win
Firmware: v0.2.2

  1. Introduction

OpenEar is an experimental assistive hearing device built around the MAX32655FTHR evaluation board. The goal is to develop an open-source audio processing system with adjustable frequency bands, dynamic compression, output limiting, and a companion application for configuration and fitting.

The current implementation includes:

  • Real-time audio capture and playback
  • Six-band digital signal processing (DSP)
  • Per-band gain and compression parameters
  • Output limiting
  • Bluetooth Low Energy (BLE) communication
  • Live parameter adjustment from a phone
  • Profile saving and reloading
  • A basic hearing-test workflow in the companion application

The initial development focus has been getting the complete audio pipeline working reliably, validating communication with the board’s peripherals, and identifying remaining problems through logs and repeatable tests.

«Important: OpenEar is an experimental project, not a medical device. Its fitting workflow is intended for software and hardware development, not diagnosis or prescription of hearing correction.»

  1. Hardware and Software Architecture

The MAX32655FTHR provides the processing platform for the audio pipeline and peripheral communication.

The current system is organised into four main parts:

  1. Audio input and output: Captures audio through the onboard microphone path and sends processed audio to the earphone output.
  2. DSP pipeline: Applies six-band gain adjustment, compression-related processing, and output limiting.
  3. Bluetooth interface: Receives configuration changes from the companion application and updates the running DSP parameters.
  4. Companion application: Runs a basic hearing-test workflow, generates an initial experimental fitting profile, and communicates the profile to the device.

The current audio configuration uses a 48 kHz sample rate with 64-sample processing blocks.

At this configuration, each block represents approximately 1.33 ms of audio

  1. Firmware Programming and DAPLink Debugging

One of the first issues appeared during firmware programming.

The application appeared to transfer over USB, but the expected firmware did not start. The board continued running its preprogrammed firmware, and no “FAIL.TXT” file appeared to indicate a failed transfer.

The initial behaviour made it difficult to distinguish a programming problem from an application startup problem.

Root cause

The board’s factory interface firmware was identified as version “v0242” on the MAX32625PICO-based debug interface.

The interface firmware was not correctly handling the application’s flash address range. The MAX32655 application uses flash starting at “0x10000000”, which is represented in the Intel HEX file by an Extended Linear Address record such as:

:020000041000EA

The older interface firmware could make the USB file-transfer process appear successful without correctly programming the application.

Resolution

The interface firmware was updated using its maintenance mode:

  1. Disconnect the board from USB.
  2. Hold the board’s “SW6” button while reconnecting USB to enter maintenance mode.
  3. Copy the appropriate “max32625_max32655fthr_if.bin” interface firmware file to the “MAINTENANCE” drive.
  4. Allow the interface to reboot.
  5. Confirm that the DAPLink drive remounts.
  6. Flash the application firmware again.

After updating the interface firmware, application programming worked as expected.

This was a useful reminder that a successful-looking file transfer does not necessarily confirm that the target application has been programmed correctly.

I2C Initialisation and Codec Bring-Up

After resolving the programming issue, the next major problem was codec initialisation.

An early firmware build returned error “-6” during codec initialisation, corresponding to an I2C-busy condition in the relevant code path.

The exact original cause was not conclusively isolated, so the debugging process focused on simplifying initialisation and improving diagnostics.

Issues identified during code inspection

Several potential contributors were found:

  • Multiple components independently initialised or managed the I2C interface.
  • The PMIC was accessed before codec initialisation had completed.
  • Bluetooth startup occurred before the audio subsystem was fully ready.

These were treated as potential contributors rather than confirmed individual causes.

Changes in firmware v0.2.1

The initialisation sequence was revised to make ownership and startup order more predictable.

The changes included:

  • One owner for I2C initialisation
  • Codec initialisation before dependent peripheral operations
  • A safe PMIC probe after codec bring-up
  • Bluetooth startup after audio initialisation
  • Muted codec startup, with shutdown on initialisation failure
  • A single bus-recovery and retry path
  • Raw I2C register diagnostics
  • A source-level regression test for startup ordering

The purpose was not simply to make the error disappear, but to make failures easier to diagnose and prevent startup-order regressions.

  1. Successful Boot and Peripheral Detection

With the revised initialisation sequence, firmware v0.2.2 completed startup successfully.

The boot log was:

=== OpenEar 0.2.2 - open assistive hearing on MAX32655 ===
Not a medical device. Start quiet; use closed in-ear earphones.
build: BLE on, SD recorder on, block 64
loaded saved profile
[i2c] at boot, before init: SCL=1 SDA=1 ctrl=0x0000 status=0x0000 intfl0=0x000000
codec MAX9867: ok
mic power (PMIC LDO1): ok (0)
codec check after PMIC: ok (0, rev 0x42)
starting bluetooth…
audio running: 48000 Hz, 64-sample blocks. Type ‘help’.

The important results are:

  • The MAX9867 codec initialises successfully.
  • The microphone power path reports success.
  • The codec remains accessible after the PMIC operation.
  • Bluetooth starts after audio initialisation.
  • The audio pipeline reaches its running state.
  • A previously saved profile loads during startup.

An I2C scan also detects three addresses:

i2cscan
I2C1 devices: 0x18 0x28 0x36

The addresses are consistent with the codec at “0x18”, the PMIC at “0x28”, and a likely battery gauge at “0x36”. The battery-gauge identification and measurement path still require independent validation.

  1. Live DSP Tuning and Profile Loading

Both the audio-only build and the full BLE-enabled build now run successfully.

The companion application can communicate with the board and change the six-band configuration while the audio pipeline is running. The resulting changes are audible through the output path.

The application also provides a basic hearing-test workflow and generates an initial fitting profile that can be sent to the device.

The current profile structure includes:

  • Per-band gain
  • Compression ratio
  • Compression knee
  • Expansion threshold and ratio
  • Master output level
  • Output limiter ceiling
  • Attack and release times

The device can load a saved profile at startup, and live application changes are applied to the running configuration.

Example fitting profile

The following is an example of the current experimental profile output:

band gain ratio knee expThr expR | level applied
0 <250 10.0 1.33 -45 -70 2.0 | -66.5 10.0
1 250-500 10.0 1.33 -45 -70 2.0 | -75.0 5.0
2 500-1k 8.8 1.29 -45 -70 2.0 | -76.7 2.1
3 1k-2k 8.8 1.29 -45 -70 2.0 | -80.1 -1.4
4 2k-4k 5.0 1.17 -45 -70 2.0 | -85.7 -10.7
5 >4k 2.5 1.08 -45 -70 2.0 | -69.7 2.5
master 0.0 dB limit -6.0 dBFS attack 5.0 ms release 80 ms

The application and profile pipeline are being evaluated as software functionality. These values are not clinically validated hearing-correction settings, and the profile should not be interpreted as a medical recommendation.

DSP simulation

Before relying on the embedded output, the DSP implementation was also checked in simulation.

The current simulation checks include:

  • Recombination of the six bands under a flat configuration
  • Limiter behaviour against the configured output ceiling

These are software-level checks, not measurements of the complete hardware audio path.

  1. Microphone-Level Diagnostics

A raw microphone diagnostic was added to help inspect the input signal independently of the higher-level fitting process.

One observed output was:

raw
5 8 11 11 3 11 5 3 3 1 8 -5 4 1 3 4
peak 11 (-69.5 dBFS)

The reported peak corresponds to approximately 11 counts relative to a 32768-count full-scale reference, or around “-69.5 dBFS”.

This was one observed sample window in a quiet room. It is not a complete noise-floor measurement, and further testing is needed to characterise microphone noise, gain, and sensitivity under controlled conditions.

The raw diagnostic is useful because it separates input-level observations from the behaviour of the six-band DSP and output stages.

  1. Hearing-Test Tone Clicks

Testing the companion application’s hearing-test workflow exposed another issue.

The generated test tones could produce clicks at the beginning and end of a tone. The abrupt transition between silence and a steady sine wave introduced a discontinuity in the waveform.

A second concern was that the microphone signal could be cut abruptly when a test tone began. That transition could potentially provide an unintended cue during a test.

Changes in v0.2.2

The tone-generation and microphone-blending logic was updated to include:

  • A 10 ms fade-in for test tones
  • A 10 ms fade-out
  • Smoother transitions when blending the microphone signal

A regression test was added for the transition behaviour. It fails against the earlier v0.2.1 implementation and passes against v0.2.2.

This verifies the intended software behaviour, but it does not by itself establish that the clicks are completely inaudible on the physical hardware. The updated behaviour still needs to be confirmed through listening tests.

  1. Remaining Audio Glitches and Timing Diagnostics

Although the audio pipeline is running, intermittent static remains an unresolved issue.

The current diagnostic output is:

stat
blocks 19741 block 64 samples (1.33 ms) @ 48000 Hz
DSP CPU now 0.0% peak 0.0% late blocks 4029
limiter GR 0.0 dB howl events 0 howl atten 0 dB clipped 0 resets 0
est. latency: 3.3 ms buffering + ~1 ms filters + codec

Late-block counter

The diagnostic reports 4,029 late blocks out of 19,741 processed blocks, approximately 20.4% of the reported block count.

At 48 kHz, a 64-sample block represents approximately 1.33 ms of audio. Late processing could therefore be relevant to the observed static, but the relationship has not yet been confirmed.

The counter needs further investigation before it can be used to explain the glitches conclusively.

CPU measurement

The current and peak DSP CPU readings both report “0.0%”. These values are not yet trusted because they do not appear consistent with the other timing diagnostics.

The cycle-counter implementation and CPU-utilisation calculation need to be verified before CPU load can be reported reliably.

Latency

The current latency figure is an estimate based on buffering, filter processing, and codec behaviour. It is not a measured end-to-end hardware latency.

A loopback recording and waveform analysis will be needed to establish the actual input-to-output delay.

Planned timing tests

The next diagnostic steps are:

  1. Verify the cycle counter and CPU-utilisation calculation.
  2. Compare 64-sample and 128-sample processing blocks.
  3. Compare operation with BLE enabled and disabled.
  4. Correlate the static with the late-block counter.
  5. Measure end-to-end latency using an audio loopback recording and waveform analysis.

The main priority is to identify whether the static originates from missed processing deadlines, audio buffering, codec behaviour, or another part of the signal path.

  1. Current Implementation Status

Project Development Status Update

Here is the current development and verification status of the project components.

:white_check_mark: Completed / Working

  • DAPLink programming: Resolved after updating the interface firmware.
  • MAX9867 codec initialisation: Working.
  • Microphone power path: Successful initialisation reported.
  • I2C diagnostics: Implemented.
  • Six-band DSP: Running.
  • Output limiter: Implemented; simulation checks completed.
  • BLE communication: Working.
  • Live phone-based tuning: Working.
  • Profile save and reload: Implemented; profile loading confirmed.
  • Hearing-test workflow: Implemented.

:yellow_circle: Implemented, but Hardware Verification Pending

  • Tone transition smoothing: Implemented; hardware listening verification is pending.
  • SD-card recording: Included in the current build, but recording functionality has not yet been verified.
  • Battery-gauge readings: Device detection has been observed, but readings have not yet been validated.

:red_circle: Outstanding Issues and Tasks

  • Intermittent audio static: Unresolved; further debugging is required.
  • Late-block timing: Requires further investigation.
  • DSP CPU measurement: Not yet verified.
  • End-to-end latency: Not yet measured.
  • Enclosure: Not yet completed.
  1. Next Steps

The next development stage will focus on verifying performance and completing the remaining hardware tests.

Immediate priorities:

  • Investigate intermittent static and late processing blocks.
  • Correct and validate the CPU-utilisation measurement.
  • Verify the hearing-test tone transitions on the physical hardware.
  • Test SD-card recording.
  • Validate battery-gauge communication and readings.
  • Measure end-to-end audio latency.
  • Complete the enclosure and check the physical assembly.

Once these tests are complete, the results can be used to determine which remaining issues are software-related and which require changes to the hardware configuration or audio pipeline.

  1. Development Workflow

The firmware has been developed iteratively, using code inspection, simulation, serial diagnostics, and regression tests.

A recurring principle throughout the bring-up process has been to distinguish between implemented functionality, simulated behaviour, and results verified on the physical hardware. Keeping those categories separate makes it easier to identify what is working and what still needs evidence.

The project source code will be available here:

GitHub repository: Coming Soon!

License: MIT

Conclusion

OpenEar has progressed from initial board bring-up to a functioning audio pipeline with six-band DSP, BLE-based live tuning, and profile loading.

The DAPLink programming issue has been resolved, codec initialisation is working, and the companion application can update the device’s running configuration. Additional diagnostics have also made it easier to inspect microphone levels, peripheral communication, and audio-processing timing.

The main outstanding problem is intermittent static, with the reported late-block count providing a useful lead for further investigation. CPU timing, hardware latency, SD-card recording, and battery-gauge readings also need verification.

The next milestone is to turn the current functional prototype into a more thoroughly measured and validated system, with reproducible tests and clearly documented results.

OpenEar Day 3: The 0.0% CPU Mystery Is Solved, and the Static Turned Out to Be a Clock Slip

Hi everyone!

Yesterday, OpenEar had two annoying problems: intermittent static in the audio output and a CPU meter that insisted the DSP was using exactly 0.0% CPU.

The audio was running, the six-band DSP was working, Bluetooth tuning was functional, and the board was otherwise behaving pretty well. But something was clearly off. A real-time audio pipeline reporting zero CPU usage while also reporting late processing blocks? Yeah, that wasn’t adding up.

Today’s update is about tracking down those problems, what changed in the firmware, and what still needs testing on the actual hardware.

  1. First, the CPU meter was lying to me

The earlier diagnostic output looked like this:

stat
blocks 19741 block 64 samples (1.33 ms) @ 48000 Hz
DSP CPU now 0.0% peak 0.0% late blocks 4029
limiter GR 0.0 dB howl events 0 howl atten 0 dB clipped 0 resets 0
est. latency: 3.3 ms buffering + ~1 ms filters + codec

The important details here are the processing-block count, CPU readings, and late-block counter.

OpenEar processes audio at 48,000 samples per second, using blocks of 64 samples.

That gives us:

  • Sample rate: 48 kHz
  • Block size: 64 samples
  • Audio represented by each block: approximately 1.33 ms
  • Reported processed blocks: 19,741
  • Reported late blocks: 4,029

The reported late-block rate is approximately 20.4%.

That’s a significant diagnostic warning, although it doesn’t automatically tell us why the blocks were late or prove that every late block produced an audible glitch.

Meanwhile, both CPU readings were stuck at “0.0%”. The problem was with the CPU measurement logic, not evidence that the processor somehow had nothing to do.

What changed?

I corrected the CPU utilisation calculation so that the meter could provide a meaningful measurement rather than a suspiciously perfect zero.

The key lesson here is that a diagnostic counter is only useful if the measurement behind it is correct. Printing a percentage is easy; making sure that percentage actually represents processor utilisation is the important part.

The CPU measurement fix and the audio crackle fix are separate changes. Getting one right doesn’t automatically resolve the other.

  1. The static: following the audio blocks

The second problem was the intermittent static during playback.

Instead of treating it as a generic audio-quality issue, I looked at the behaviour of the audio stream and compared the block-related diagnostics with the audio data being produced and played.

That investigation pointed to a clock slip.

In a real-time audio system, the input and output sides must remain correctly synchronised. If their timing drifts out of alignment, the audio stream can eventually encounter a discontinuity. Depending on how the stream is handled, that can result in an audible click, crackle, or other artefact.

The important part was connecting the timing behaviour to what I could actually hear, rather than simply tweaking gain settings and hoping the static disappeared.

Why this matters

OpenEar’s audio pipeline is not just a collection of filters running on a microcontroller. It also has to move audio through the capture, processing, buffering, and playback stages without losing the timing relationship between them.

The six-band DSP can produce mathematically correct output and still be part of a system that sounds wrong if the surrounding audio pipeline is not behaving correctly.

That’s why timing diagnostics matter just as much as the filter implementation.

  1. Firmware v0.3.1: the fix is in, but the board test is still pending

The clock-slip issue led to a change in firmware v0.3.1.

The updated implementation now passes the relevant PC-based tests. The fix has also been accompanied by a simulation test so the expected behaviour can be checked again after future code changes.

Current status:

Check| Result
Clock-slip fix in firmware v0.3.1| Implemented
Relevant PC-based tests| Passing
Simulation regression test| Passing
Physical-board verification| Pending

One important distinction: passing a simulation test does not prove that the physical board is free of static. The embedded audio path has its own timing, peripheral, and hardware behaviour.

The next step is to flash v0.3.1 onto the MAX32655FTHR, run the same audio workload, and listen for the crackle under real operating conditions.

I am not marking the audio issue as fixed on hardware until that test is complete.

  1. Where OpenEar stands now

The good news is that the main functionality is already running on the board.

Currently working on the physical hardware:

  • Microphone input
  • Six-band DSP
  • Earphone output
  • Bluetooth communication with the companion app
  • Live DSP tuning from the app
  • Saved-profile loading
  • Buttons and LEDs
  • Tone safety stop
  • CPU utilisation monitoring

The CPU measurement has been corrected, while the crackle fix is currently at the PC-test stage.

The distinction matters because I want the project status to reflect what has actually been demonstrated, rather than treating every implemented feature as automatically verified.

  1. The remaining hardware tests

There are still a few things I need to validate before calling the current build thoroughly tested.

Feature| Current status
Audio crackle fix| PC tests pass; board verification pending
SD-card recording| Not yet tested on the board
Battery gauge| Not yet tested with a battery connected
End-to-end audio latency| Not yet measured
Enclosure| Not yet completed

The latency figure from the earlier diagnostic output is still an estimate, not a measured input-to-output result.

For the latency test, I want to measure the actual delay through the complete audio path rather than relying solely on the buffering and filter estimates.

The SD recorder also needs a proper recording-and-playback check, and the battery gauge needs to be tested with a battery connected before its readings can be considered validated.

  1. What’s next?

The next steps are fairly straightforward:

  1. Flash firmware v0.3.1 onto the board.
  2. Run the audio pipeline and check whether the crackle is gone.
  3. Compare the observed behaviour with the PC test results.
  4. Test SD-card recording.
  5. Measure end-to-end audio latency.
  6. Validate the battery gauge and finish the enclosure.

The main priority is confirming the clock-slip fix on the actual hardware. Once that is done, I can move on to the remaining peripheral and performance tests.

Conclusion

This update has been a useful reminder that getting audio processing to run is only one part of building a real-time audio system.

The CPU measurement needed correcting, and the investigation into the static pointed towards a clock-slip issue. The updated firmware now passes the relevant PC-based tests, but the final hardware verification is still ahead.

There is still work to do, but at least the remaining tasks are becoming more specific and measurable.

OpenEar is an experimental assistive-listening project, not a medical device.

Source code, build files and tests: Coming Soon!

License: MIT

OpenEar Day 4: The Crackle Is Gone, and 199 Tiny Corrections Show Why It Was There

Hi everyone!

Yesterday, I tracked the intermittent crackle in OpenEar’s audio output to a clock-slip issue. The fix worked in my PC simulation, but there was still one important question: would it actually work on the physical board?

Today, I flashed firmware v0.3.1 onto the MAX32655FTHR and tested it on the real hardware.

The result? The crackle is gone, and the board’s own counters provide a much clearer picture of what was happening inside the audio pipeline.

  1. The result in one image

The comparison uses the same board, earphone, and room to keep the test conditions consistent.

Before looking at the numbers, one important detail about the diagnostics: a late block means the audio output side reached a block before the DSP had finished preparing it for playback. In a real-time audio pipeline, that kind of timing failure can disrupt the stream and produce audible glitches.

The goal of the fix was to keep the input and output timing aligned, rather than merely trying to hide the resulting noise.

Test conditions: Same board, same earphone, same room.

  1. What the clock corrections tell us

The firmware’s clock-synchronisation logic makes small corrections to keep the audio stream aligned.

The important point is that these are not corrections to the audio’s tone or volume. They are adjustments intended to keep the timing of the audio data consistent between the input, processing, and playback stages.

The board recorded 199 small corrections during the test.

That number is useful because it gives us a view into the synchronisation logic doing its job on the actual hardware, rather than only in simulation.

However, the correction count needs to be interpreted alongside the late-block count and the listening test. A correction is not automatically a missed deadline, and the number alone does not prove that the timing problem has been eliminated.

  1. Simulation versus the real board

The PC simulation was useful for developing and testing the fix, but the physical board adds the real audio hardware, peripheral timing, and playback path.

Testing firmware v0.3.1 on the MAX32655FTHR closes that gap: the fix is now being evaluated against actual board behaviour rather than simulation results alone.

The listening result is encouraging: the crackle was no longer audible during this test.

That does not automatically establish that every possible workload or operating condition is glitch-free. Longer-duration testing and further monitoring of the timing counters are still worthwhile.

  1. Current status

Working on the physical board:

  • Microphone input and earphone output
  • Six-band DSP
  • Bluetooth app with live tuning
  • Saved profiles
  • Buttons and LEDs
  • Tone safety stop
  • CPU utilisation monitoring
  • Firmware v0.3.1 clock-synchronisation fix, with the crackle no longer audible during this test

Still to validate:

  • SD-card recording
  • Battery-gauge readings with a battery connected
  • End-to-end audio latency
  • Enclosure
  1. What’s next?

Now that the audio fix has been tested on the board, the next steps are to continue checking stability and complete the remaining hardware tests.

  1. Run longer audio sessions and monitor the synchronisation counters.
  2. Test SD-card recording.
  3. Measure end-to-end audio latency.
  4. Validate the battery gauge with a battery connected.
  5. Complete the enclosure.

The main milestone today was getting the clock-synchronisation fix out of simulation and onto the actual hardware.

OpenEar remains an experimental assistive-listening project, not a medical device.

License: MIT

OpenEar Day 5: 8.5 Hours on a 300 mAh Battery, SD Recording Works, and 3.3 ms of Delay

Hi everyone!

Today was measurement day for OpenEar. I tested battery runtime, verified SD-card recording, measured the actual microphone-to-earphone delay, and investigated the watchdog message that appeared in the previous updates.

There are quite a few results to share, so let’s get into it!

  1. Battery: 8 Hours 30 Minutes, with 30% Still Remaining

What I did

  • Connected a 300 mAh LiPo battery and disconnected USB, ensuring the board was running entirely from the battery.
  • Left OpenEar running normally, with microphone input, six-band DSP, and audio output to the earphone.
  • Monitored the battery during the test.
  • Stopped the test after 8 hours and 30 minutes, with approximately 30% charge remaining.

Battery monitoring

The “batt” command reads the fuel gauge associated with the MAX20303 power-management chip. It reports the battery voltage in millivolts and the estimated state of charge.

batt
BATT mv=3720 pct=30.0

Results

Parameter| Value
Battery| 300 mAh LiPo
Runtime measured| 8 h 30 min
Remaining charge| 30%
Estimated charge consumed| ~210 mAh
Estimated average current| ~25 mA
Extrapolated full runtime| ~12 hours

The estimated charge consumption is approximately 70% of 300 mAh, or 210 mAh.

Dividing that by 8.5 hours gives an estimated average current of approximately 25 mA for the complete board.

If consumption remains similar, the extrapolated runtime is around 12 hours. This is only an estimate, not a full-discharge measurement. Actual battery behaviour and the fuel gauge’s accuracy can affect the result.

Still, getting more than 8.5 hours of operation from a 300 mAh battery is an encouraging result!

  1. SD-Card Recording: Working!

The next test was the onboard SD-card recorder.

What I did

  1. Formatted a microSD card with FAT32.
  2. Inserted it before powering on the board.
  3. Used the “rec 10” command to record approximately 10 seconds.
  4. Talked and snapped my fingers near the microphone during recording.
  5. Copied the resulting WAV file to my laptop and opened it in Audacity.

Result: The recording plays correctly, with both channels present.

The recorder generates a stereo WAV file with the following arrangement:

Channel| Contents
Left| Raw microphone signal, before processing
Right| Processed OpenEar output sent to the earphone

This is particularly useful because both signals are captured in the same recording. It allows me to compare the original microphone input against the processed output without having to record them separately.

The recorder stores the audio at 16 kHz, 16-bit. The main audio pipeline runs at 48 kHz, with the recorder filtering and retaining every third sample.

rec 10
recording 10 s to OE000.WAV (L = mic, R = OpenEar output)

rec ?
REC OE000.WAV 4.2/10 s overruns 0

rec ?
idle (card mounted)

The “overruns” counter is particularly useful here. It indicates audio data that the recorder could not accept in time.

A slow SD card can cause recording problems even when the rest of the audio pipeline is functioning correctly. The successful playback of the recorded WAV file is a good first verification of the recording path.

  1. Latency: Measuring the Actual Microphone-to-Earphone Delay

For an assistive-listening device, latency is an important parameter.

Some sound reaches the listener directly, around the earbud, while the processed version arrives through the device. If the delay is too large, the two signals can become perceptibly separated, affecting how natural speech sounds.

So instead of relying only on the firmware’s buffering estimate, I measured the actual end-to-end delay.

Measurement setup

The measurement was performed using a stereo recording on a laptop with Audacity.

  1. One microphone was placed next to OpenEar’s microphone.
  2. The earbud was held against a second microphone.
  3. Five finger snaps were recorded.
  4. The first channel captured the direct sound.
  5. The second channel captured the sound after passing through OpenEar.
  6. The time difference between corresponding events was measured in Audacity.

This gives an estimate of the complete microphone-to-earphone delay, including the audio processing and playback path.

Results

Snap| Measured delay
1| 3.30 ms
2| 1.76 ms
3| 4.90 ms
4| 3.30 ms
5| 3.30 ms

What do the numbers tell us?

  • Median: 3.30 ms
  • Mean: 3.31 ms
  • Minimum observed: 1.76 ms
  • Maximum observed: 4.90 ms

The median is 3.30 ms, with three of the five measurements returning exactly that value.

My original design estimate was approximately 3.5 ms, consisting of around 2.5 ms of buffering and approximately 1 ms of filter processing.

The measured median is reasonably close to the design estimate.

There are also two measurements worth discussing:

  • Snap 2: 1.76 ms. This is below the expected buffering delay, so it is likely affected by measurement interference, such as the second microphone picking up some of the direct snap acoustically.
  • Snap 3: 4.90 ms. Finger snaps are not perfectly repeatable impulses, so identifying their exact starting points in Audacity introduces some measurement uncertainty.

For that reason, I am reporting all five observations and using the median as the representative result rather than presenting every measurement as an identical fixed latency.

  1. Watchdog Message: Investigating the Unexpected Reset Note

In the previous updates, the boot log displayed:

NOTE: the last reset was the watchdog (the main loop had stalled for ~5 s)

This was worth investigating because a watchdog reset can indicate that the firmware stopped responding for too long.

For today’s check, I pressed “SW5” twice, waiting approximately 10 seconds between presses.

The watchdog note did not appear on either subsequent reset.

This suggests that the message observed previously may have been associated with the earlier programming or startup process rather than a repeatable watchdog event during normal operation.

One possible explanation is that programming or flashing interrupted normal processor execution while the watchdog was active. However, the exact cause has not been conclusively established.

For now, the important observation is that the message did not recur during the two manual-reset checks.

  1. Hearing-Test Microphone Behaviour

There was one more behaviour worth documenting.

During the companion application’s hearing test, I tapped the board’s microphone lightly with a fingernail between test tones.

The taps were clearly audible through the earphone.

This was intentional. I had increased the microphone amplification specifically to verify that the microphone input and output path were functioning.

The test therefore confirms that microphone audio is reaching the earphone, but it also highlights a remaining limitation: the microphone is not muted between hearing-test beeps as intended.

The hearing-test tone generation itself works, but the room-sound behaviour still needs attention.

With the current development timeline, I am documenting this as a known limitation rather than introducing another unverified firmware change.

  1. Day 5 Results Summary

Test| Result| Status
Battery| 8 h 30 min on 300 mAh LiPo, with 30% remaining| Pass
SD-card recording| Stereo WAV plays correctly in Audacity| Pass
End-to-end latency| 3.30 ms median| Measured
Watchdog check| Note absent during two manual resets| Checked
Hearing-test microphone mute| Microphone remains audible between beeps| Known limitation
3D-printed enclosure| Fit, button access, and feedback testing| Pending

  1. Where OpenEar Stands

Working on the physical board:

  • Microphone input and six-band DSP
  • Earphone output
  • Bluetooth companion application with live tuning
  • Saved profiles
  • Buttons and LEDs
  • Tone safety stop
  • SD-card recording
  • More than 8.5 hours of operation on a 300 mAh battery
  • Measured microphone-to-earphone latency

Known limitations:

  • The microphone is not muted between hearing-test beeps.
  • The reported late-block rate is approximately 0.19% with the phone connected. No corresponding glitches were audible during the test.
  • The firmware performs automatic timing corrections to maintain audio synchronisation.

Pending for Day 6:

  • 3D-printed enclosure
  • Physical fit and button accessibility
  • Feedback testing with the enclosure installed
  • Final integration checks and documentation

OpenEar is an experimental assistive-listening project, not a medical device.

Source code, build files and tests: GitHub link

License: MIT

OpenEar: Final Update — An Open-Source, Self-Tunable Assistive-Listening Prototype on the MAX32655FTHR

Hi everyone!

This is the final update from my OpenEar build week.

On Day 6, the board finally got its printed enclosure. In this post, I’ll bring everything together: what OpenEar does, how I built it, the results from testing on the physical board, the problems I encountered and fixed, and the limitations that remain.

«OpenEar is an experimental assistive-listening project, not a medical device. It has not been clinically evaluated, and its hearing test is not a clinical audiogram.»


Day 6: Giving OpenEar a Case

I designed the enclosure using Python and “manifold3d”, rather than a conventional CAD program. This means the dimensions and geometry are defined directly in the script, so the model can be regenerated and modified programmatically.

I measured the board from a calibrated top-view photograph, including the mounting holes, buttons, microphone port, both 3.5 mm jacks and the micro-USB connector. The enclosure openings were positioned using those measurements.

Enclosure features

Physical Design & Enclosure Features

Overall size

  • 74.6 × 28.9 × 18.7 mm

Shape

  • Rounded pod design with filleted top edges and a 45° chamfered bottom edge.

Wordmark

  • Raised OpenEar lettering, 0.8 mm high.

Microphone

  • Seven-hole hexagonal grille positioned over the MEMS microphone.
  • Three raised sound-wave arcs.

Buttons

  • Openings for all six buttons: bypass, volume, reset, wake, power and SW6.

Connectors

  • Headphone and line-in jacks at one end.
  • Micro-USB port at the other end.
  • Dedicated slot for the LiPo battery lead.

Board Mounting

  • Four standoffs with locating pins that pass through the board’s mounting holes.

Lid

  • Friction-fit design with a base lip.
  • Matching lid rabbet and a small reveal groove.

Pocket Clip

  • Separate pen-style clip.
  • 38 mm arm with a 1.8 mm gap.

The microphone grille sits directly over the board’s microphone, while the connector openings provide access without having to remove the board from the enclosure.

The pocket clip

The clip is a separate printed component. I printed it lying on its side so that the layer orientation runs along the arm, rather than across it.

The idea is to make the clip more flexible along its length.

It attaches using two dowels cut from 1.75 mm filament and a small amount of superglue. It sits near the jack end, allowing the earphone cable to come straight upwards when the pod is clipped to a pocket.

Printing without supports

One of the design goals was to print all three parts without support material.

I wrote a small geometric checker that examines surfaces facing down more steeply than 45° in each component’s intended print orientation. The resulting checks reported 0 mm² of unsupported surface area for all three parts.

This is a geometry check rather than a guarantee for every printer and material combination, but the final parts were successfully printed without supports.

Getting the geometry to that point took several iterations:

  • A 45° chamfer on the bottom edge instead of a rounded fillet.
  • Flat-topped teardrop-shaped jack openings instead of circular holes.
  • 45° chamfered corners on the USB opening.
  • A 40° roof where the lid steps over the base lip.
  • Chamfered clip corners and teardrop-shaped dowel holes.

The base prints open-side up. The lid prints rim-down, using its 25 mm ceiling as a bridge. The clip prints on its side.

The parts were printed in PLA at 0.2 mm layer height.

One important distinction: this is a display and carry enclosure, not a sealed battery enclosure. The LiPo remains external, with its lead passing through the dedicated slot.


The Complete Project

What is OpenEar?

OpenEar takes audio from the board’s microphone and processes it through a six-band digital signal-processing pipeline.

Each frequency band can be adjusted independently to create an experimental hearing profile. The system also includes compression, quiet-signal expansion, feedback suppression and output limiting.

The processed audio is then sent to a wired earphone.

A companion web application connects over Bluetooth. It provides a short experimental hearing test, generates a starting profile and allows the six frequency bands to be adjusted live.

The design target is approximately 3.3 ms of microphone-to-earphone latency, based on the measurements described below.

What I built

Hardware

  • MAX32655FTHR development board.
  • MAX32655 Arm Cortex-M4F microcontroller, running at 100 MHz.
  • MAX9867 audio codec.
  • MAX20303 power-management IC.
  • Wired in-ear earphone.
  • 300 mAh LiPo battery.
  • Custom 3D-printed enclosure.

Audio pipeline

Microphone → codec → I²S with DMA → six-band DSP → I²S with DMA → codec → earphone.

The main audio pipeline operates at 48 kHz, using 64-sample blocks. Each block represents approximately 1.33 ms of audio.

DSP

  • Six-band Linkwitz-Riley crossover with phase compensation.
  • Independent gain adjustment for each band.
  • Per-band compression and quiet-noise expansion.
  • Click-free volume and bypass transitions.
  • Feedback suppression, also referred to as a howl guard.
  • Output limiter configured with a ceiling of −3 dBFS.

Control

  • A text console accessible over USB and Bluetooth.
  • Settings saved to flash.
  • Commands for monitoring and controlling the audio system.

Phone application

  • Experimental hearing test.
  • Starting-profile generation.
  • Six-band adjustment sliders.
  • Live per-band level meters.
  • Console access.

The application runs as a web page and uses Web Bluetooth.

Recorder

  • Stereo WAV recording to microSD.
  • Left channel: raw microphone input.
  • Right channel: processed OpenEar output.

Firmware-level limits

The firmware includes several limits independently of the phone application:

  • Maximum band gain of +30 dB.
  • Configured output ceiling.
  • Test tones limited to −20 dBFS and automatically stopped after 15 seconds.
  • Tighter volume limits for Bluetooth commands, because the current Bluetooth control implementation does not use pairing.

These are engineering safeguards, not a substitute for clinical or product-safety validation.


Results Measured on the Physical Board

The following table separates physical-board measurements from the PC-side test results.

Performance & Test Results (Firmware v0.3.1)

Audio Performance

  • End-to-end latency: 3.30 ms median (five finger snaps recorded in Audacity).
  • DSP load: 35.3% average, 41.7% peak.
  • DSP load with phone connected: 43.8%.
  • Interrupt delay: Maximum 4 samples (0.08 ms).

Audio Reliability

  • Late audio blocks (phone disconnected): 0 of 15,568.
  • Late audio blocks (phone connected): 234 of 126,293 (0.19%).

Battery Performance

  • Battery runtime: More than 8.5 hours.
  • Tested using a 300 mAh LiPo battery; test stopped with 30% charge remaining.

Storage

  • SD recording: Stereo WAV recording successfully opened and played in Audacity.

Automated Testing

  • 314 automated PC checks passing.
  • Test suite: run_all_tests.sh

Overall Results

  • 3.30 ms median end-to-end latency.
  • Zero late audio blocks without a phone connection.
  • Only 0.19% late audio blocks with a phone connected.
  • More than 8.5 hours of battery runtime.
  • All 314 automated PC tests passing.

The latency, CPU load, audio-block counters, interrupt delay and battery runtime were measured on the physical board. The 314 automated checks were run on the PC test environment; they are not 314 separate hardware tests.


What Went Wrong, and How I Fixed It

The most useful part of this project was probably not the features that worked. It was the problems that forced me to understand what was happening inside the system.

  1. The codec would not start — Day 1

The first firmware build reported error “-6”, indicating that the I²C bus was busy. There was no audio output.

After comparing my startup sequence with the working Analog Devices example, I found several differences:

  • I was starting the I²C bus multiple times.
  • I was communicating with the power-management chip before configuring the codec.
  • Bluetooth was being started before the audio system.

Firmware 0.2.1 corrected the startup sequence:

  1. Initialise the I²C bus once.
  2. Configure the codec first.
  3. Initialise the remaining audio components.
  4. Start Bluetooth after the audio system.

After flashing the corrected firmware, the codec started successfully and audio output worked.

  1. A CPU meter that reported 0.0% — Day 2

The firmware initially used the Cortex-M4 cycle counter to measure CPU utilisation.

On this board, that counter was not providing usable measurements, so the displayed CPU load remained at 0.0%.

Firmware 0.3.0 replaced it with a hardware timer.

The physical-board measurement was approximately 35.3% average load, much closer to the 36.7% estimate I had obtained earlier using a Cortex-M4 emulator.

That gave me a useful reminder: a measurement method needs to be validated before its output can be trusted.

  1. Static, followed by crackling audio — Days 2 to 4

This was the biggest debugging problem.

In firmware 0.2.2, approximately 20% of audio blocks were late. The DSP was estimated to consume around 62% of the available block time, while the output deadline arrived at around 65%.

That left very little timing margin.

Firmware 0.3.0 made the DSP approximately 1.7 times faster and changed the deadline handling. The hiss disappeared, but the late-block rate increased to approximately 37%, and the output started crackling.

The important clue came from comparing the input and output timing.

The output stream was losing approximately 19 samples per second relative to the input. As a result, the point where the output switched buffers gradually moved through the processing window.

Eventually, the switch point crossed the DSP’s active processing time, producing the crackling.

Firmware 0.3.1 introduced a timing correction mechanism:

  • It measures the output switch point on every block.
  • When the measured drift reaches two samples, the next output block is adjusted by two samples.
  • This brings the output timing back towards the input timing.

The physical-board tests showed zero late blocks during the phone-disconnected test. The board’s correction counter also independently measured the timing slip at approximately 19.2 samples per second.

This corrected the observed synchronisation problem, although the underlying cause of the original timing drift is still under investigation.

  1. Clicky hearing-test tones — Day 2

The original hearing-test tones started and stopped instantly.

Because they could begin or end at arbitrary points in the sine wave, the transitions produced audible clicks.

I added 10 ms fade-in and fade-out ramps to the tone generation.

The resulting tones were clean during the physical-board test.


What Is Still Not Perfect?

There are still a few issues I want to be transparent about.

  1. The microphone is not muted between hearing-test tones.

The PC tests show the intended microphone-muting behaviour, but it is not working as expected on the physical board.

During the board test, microphone input remained audible between tones. The microphone amplification had been increased deliberately to verify the input path, but the remaining mute behaviour still needs to be fixed.

The hearing test therefore needs a quiet environment, and its results should be treated as experimental.

  1. A small number of late audio blocks remain when the phone is connected.

The phone-connected test recorded 234 late blocks out of 126,293, approximately 0.19%.

No corresponding glitches were audible during that test, but the firmware counter still detects them.

Bluetooth activity also increases the measured timing slip from approximately 19.2 to 27.8 samples per second.

  1. The original timing drift does not yet have a confirmed root cause.

My current hypothesis is that the I²S output buffer may occasionally run empty.

The timing-correction mechanism handles the resulting drift, but it does not establish why the drift occurs. I still need to investigate the I²S FIFO behaviour and related timing.

  1. The hearing test is not calibrated.

The test can provide an experimental starting profile, but it does not measure absolute hearing thresholds.

Without a calibrated reference and proper validation, it cannot be treated as a clinical audiogram or used to diagnose hearing conditions.


What I Learned

A few lessons from building OpenEar:

Real-time audio is about deadlines, not just averages.

A DSP operating at 35% average load can still miss deadlines if input and output timing are not properly synchronised.

Counters can reveal problems that listening alone cannot.

The crackling was audible, but counters such as “late blocks”, “played” and “blocks” helped identify the timing behaviour behind it.

Test on the PC, prove on the board.

The PC simulation helped reproduce and investigate the timing issue, but only the physical board could establish the actual behaviour of the hardware.

Safety limits belong in the firmware.

The application is not the only possible source of commands. Limits should be enforced by the firmware itself, especially when commands can arrive over Bluetooth.

Mechanical design is part of the engineering too.

The enclosure needed to accommodate the actual board, buttons, microphone, connectors and battery lead. Designing it parametrically made those relationships easier to adjust and reproduce.


Reproducing the Project

The source code, firmware, application, tests and enclosure files will be available in the project repository.

  1. Get a MAX32655FTHR development board and a wired in-ear earphone. A microSD card and small LiPo battery are optional for the corresponding features.
  2. Download the repository.
  3. Follow “BRINGUP.md” for the initial setup.
  4. To use the prebuilt firmware, copy “firmware/prebuilt/openear-full.bin” to the DAPLINK drive that appears when the board is connected.
  5. Open the companion application in a supported browser, press Connect, and begin with a low volume.
  6. The enclosure models and associated files are available in “enclosure/stl/”.

“TROUBLESHOOTING.md” documents the issues encountered during development.

Source code, firmware, tests and enclosure files: GitHub - khushitpratikshah/OpenEar · GitHub

Live companion application: openear.pages.dev

License: MIT


Next Steps

There is still room to improve OpenEar:

  • Fix microphone muting between hearing-test tones.
  • Investigate the underlying cause of the output timing drift.
  • Further reduce late audio blocks during Bluetooth activity.
  • Calibrate and validate the experimental hearing test against appropriate reference equipment.
  • Explore a two-microphone configuration for directional listening in noisy environments.

These are future development goals, not features that I am claiming as completed.


Thank You

A big thank-you to CircuitDigest and DigiKey for providing the opportunity and supporting this project through the programme.

Thanks also to Analog Devices for the open MSDK examples that helped me bring up the hardware.

Building OpenEar took me through hardware bring-up, embedded firmware, real-time DSP, Bluetooth communication, PC-side testing, battery measurements and mechanical design.

It was a challenging build, but getting the complete system running on the physical board and into a printed enclosure was a great way to finish the project.

OpenEar is an experimental assistive-listening project, not a medical device.

Thanks for following the build!