The purchase of this versatile breakout board from Adafruit immediately made me put on hold all my ongoing projects. May the stream be with me!
This breakout board, built around the VS1053B chip, decodes various digital (stereo) audio formats such as MP3, AAC, Ogg Vorbis, WMA, MIDI, FLAC, WAV (PCM and ADPCM), and sends the analog signal to a female headphone plug (included as a breadboard friendly separate part). It can also record audio in both PCM (WAV) and compressed Ogg Vorbis format. All functions can be controlled over SPI.
Other features of the breakout board are:
- microSD card holder for storing audio files
- works with 3.3V and 5V boards (5V compliant pins)
- 8 digital GPIO pins (not 5V compliant)
- Volume, bass and treble control
- a microphone input port
- MIDI mode (reads MIDI data on the UART pin)
- Additional functions (e.g. spectrum analyzer and VU meters) available via plugins
I had noticed the board before, but what made me decide to purchase it was this very simple esp8266 Internet Radio sketch on the Adafruit site. The fact that the VS1053 chip can handle mp3 live streams, delivered by an esp8266, means that it can be used for building a music streamer/internet radio! Since the esp8266 is capable of acting as a web client and a web server at the same time, it should be possible (in theory) to control the player with any web device (apart from several additional options, like buttons, IR remotes, rotary encoders, keypads, joysticks…).
After soldering the included header pins, I started with some simple MP3 playback from an SD card. My vintage Sennheiser Ovation was impressed! Then, with great expectations, I ran the Internet Radio sketch…. No sound! Not even debug messages on the serial monitor. Although Adafruit only, my hardware wasn’t from their new Feather/Wing line, for which the sketch was written. After quite some desperate attempts, almost losing hope, out of the blue came Bob Dylan’s “there must be some way out of here“. How appropriate (just as “something is happening, but you don’t know what it is” would have been). What did the trick was connecting the RST pins of the VS1053 and esp8266 boards, although the Adafruit example sketch suggests otherwise in the following line:
#define VS1053_RESET -1 // VS1053 reset pin (not used!)
Here’s what I plan to do next:
- Add a display (probably SPI, claiming two additional esp8266 pins; only one left…)
- Make the esp8266 run a web server, listening to commands via a web page, very similar to the one I wrote for controlling my Transporter
- Add manual control (buttons, IR, keypad?). The board’s own GPIO pins can be used for simple high/low devices like buttons
- Support a list of selectable presets, pointing to internet radio stations
- Make it possible to switch between radio mode and file mode (play ‘local’ music files)
- Implement a larger (cyclic) buffer for more stability