Wednesday 24 July 2019

Starting on a Quest to Building a Music Player

Hi All!

I've recently gotten into the swing of libre software/hardware projects, and so am interested in designing a music player capable of playing ogg vorbis format music.

This is the rough set of requirements:
-Portable (roughly size of a smartphone/PDA, realistically smaller since it's not going to have much hardware other than audio)
-Capable of output sound to a 3.5mm jack (with a small stereo amplifier).
-Capable of Bluetooth A2DP for comparable sound quality to wired. This is important for me as I have a pair of wireless speakers.
-Play audio files from a micro SD card. Keeps design simple and reduces size.
-Play large audio files (100s of MB) to allow listening to podcasts.
-Main audio format to be Ogg Vorbis because the specification is free and available (https://xiph.org/vorbis/doc/). However, given the components I'll be using, other formats (WAV, MP3 etc.) will be usable too. Additional formats will be a stretch goal.
-Custom shuffle functions. I don't like when my devices recommend a song I already played during the same day. Perhaps having a list on the SD card that shows what I listened to today and not adding anything in that list to the shuffle queue?
-Use on of my existing development boards as a prototype. Contenders are: Raspberry Pi 3 Model B, CHIP, STM32F0 Discovery, ESP32 WROOM 32. I decided against using Arduino based boards so that I got more experience with C programming and to reduce  memory overhead.
-Physical buttons for controlling volume, play/stop, next, previous, perhaps some additional functions. For the prototype I'll use my existing protoboard keypad with 14 buttons available.
-Small display for showing current song, shuffle settings, directory etc. For prototyping I have an I2C OLED display with a 0.96 inch diagonal and 128x64 resolution. Should more than enough for testing.
-At least initially, I will reuse parts that I already have (Li-On charger IC, passives etc.) to cut down on prototyping cost.
-Minimise power consumption by using interrupts, turning off unnecessary gpio, reducing clock frequencies etc. This will be more relevant once I figure out the final set of hardware after prototyping. This is also where Arduino, and Linux based solutions may be unsuitable as they have a lot of overhead.
-(?) Anything else that I may deem fun or interesting to play with, since it is my device after all!

Once this device gets closer to finalisation, I will aim to use parts that are:
1. Readily available.
2. Have datasheets and all bootloader information available.
3. Will be produced for a long time.
I'll approach the design from a modular perspective, to allow parts to be replaced with minimum hassle if any parts from my original BOM go out of production etc. In addition I'll include debugging pins and ways of bypassing sections (such as the audio amplifier, bluetooth chip etc.) to allow straightforward replacement of sub-systems.

Monday 8 July 2019

Pipe Post-Script

The end of the big engineering project came and went fairly swiftly, but not without a few fairly long experiment/analysis/writing sessions to finish it off. (It wouldn't be a proper project without them ... riiight??)

The result was that my visions of a brilliant new way of detecting pipes was only partly correct. The final experiments involved sweeping the antenna in front of a pipe, which had been hidden behind a very large wooden board. The pipe could be clearly seen in the reflection data and with a bit of processing the peak in reflected power could be made rather significant.

The pipe is causing that ripple!

And with a bit of manipulation of the underlying phasors we can make the peak magically appear!
Unfortunately the usefulness in the reflection data for distinguishing pipes and non-pipes was not tested (a year is a remarkably short time in the end). Looking at the initial goals for the project - they were all met, the method was tested in the ways proposed and experience in how the data generally worked allowed me to build a schematic of the pipe detector!

Inevitably the question after every project is what next? - well I think it is time for something completely different...