This issue didn’t surface until the system was fully integrated. But by that point, several sources of audio delay had become apparent.

Initially, the speaker was controlled directly by the Arduino Mega via a serial MP3 player module. These modules require MP3 files to be preloaded onto a microSD card and accept traditional commands like Play, Next, and Back. However, the onboard processor introduces noticeable latency when handling these commands, resulting in a delay between when a step is triggered and when the corresponding tone is played.

Further delay came from the software-implemented SPI communication with the RFID readers, as described in the previous section. While this bit-banged SPI allowed for reliable long-distance communication, scanning all readers could take up to 4 seconds. Because the Arduino Mega is single-threaded, this would sometimes delay tone playback by several seconds.

To reduce these delays, I implemented three key solutions:

  1. Replaced the MP3 module with a Python script: By routing audio playback through a Python script over serial (at 9600 baud), the system became significantly more responsive.
  2. Reduced RFID polling frequency: Instead of scanning continuously, RFID readers are polled every 10 seconds. This has minimal impact on gameplay, as players typically take longer than that to place a step and prepare for the next action.
  3. Paused scanning during final play: Once the steps are arranged correctly, RFID scanning is suspended until the game is reset. This ensures that audio feedback is immediate during the most crucial and satisfying moment: the player’s victory attempt.