How to Add Audio to Your Embedded Project Using SparkFun's Qwiic Twist and Audio Player Breakout

Pages
Contributors: [redacted], QCPete, Member #927272

Introduction

Looking to bring sound into your next embedded project? In this tutorial, we'll walk you through using the SparkFun Audio Player Breakout in combination with the Qwiic Twist to let you select and play tracks from a microSD card. It's a compact and powerful way to add audio interactivity to your prototype using simple I2C and serial connections.

Follow along on video here, or find the full tutorial below.


Hardware

To follow this experiment, you will need the following materials. While this is a simple project, we wanted to make sure that you have everything you need to get started before we get to the code.

SparkFun RedBoard Qwiic

DEV-15123
$21.95

Flexible Qwiic Cable - 100mm

PRT-17259
$1.95

Breadboard - Self-Adhesive (White)

PRT-12002
$6.25

SparkFun Qwiic Twist - RGB Rotary Encoder Breakout

DEV-15083
$25.50

SparkFun Audio Player Breakout - MY1690X-16S

BOB-28038
$14.95

Jumper Wires - Connected 6" (M/M, 20 pack)

PRT-12795
$2.95

Break Away Headers - Straight

PRT-00116
$1.95

Soldering Iron - 60W (Adjustable Temperature)

TOL-14456
$25.95

SparkFun Mono Audio Amp Breakout - TPA2005D1

BOB-11044
$10.50

Thin Speaker - 0.5W

COM-15350
$1.50

microSD Card - 1GB (Class 4)

COM-15107
$5.50

USB-A to USB-C Cable - 1m, USB 2.0 (Flexible Silicone)

CAB-25630
$10.95

Wiring


alt text

Qwiic Twist connected to RedBoard Qwiic via Qwiic cable Audio Player Breakout:

  • TXO → RedBoard D8
  • RXI → RedBoard D9
  • VIN → RedBoard 5V
  • GND → RedBoard GND

Audio Out → Mono Audio Amp → Speaker Mono Audio Amp

  • PWR -GND
  • PWR +5V

Software Setup

To follow along, install the following libraries via the Arduino Library Manager:


alt text

Use Example4_QwiicTwist.ino from the SparkFun MY1690 MP3 Decoder Library examples. It enables the Qwiic Twist to:

  • Rotate to change track number
  • Press to play the selected track
  • Display info via serial monitor

How It Works:

  • The Audio Player Breakout receives serial messages from the RedBoard Qwiic.
  • The Qwiic Twist allows you to navigate through tracks by rotating and play one by pressing.
  • The selected audio file is played through the MY1690 and sent to the mono amp and speaker.

Serial Feedback: The sketch prints useful debug messages to the Serial Monitor, including the number of tracks on your SD card and the currently selected track.

Tips:

  • Make sure your microSD card is formatted correctly and contains MP3/WAV files.
  • Use a single-cell LiPo if you'd like to run this portable.
  • You can customize the playback behavior by editing the example sketch.

Conclusion

This setup gives you a simple and intuitive audio playback solution for embedded projects. With just a few SparkFun parts and a handful of wires, you can control sound output with a tactile, menu-like experience. It’s perfect for interactive displays, soundboards, or even DIY toys!

Let us know what you build with it!