Wednesday, 13 January 2016

Music player: Choosing the components

Continuing from my previous post, I'm building a music player using a Raspberry Pi.  This left me a number of things to consider:
  • How to power the project?
  • How to amplify the audio from the Pi?
  • How good would the sound quality be?

I'd seen a number of pre-built amplifiers which can be just plugged into the Pi, like the HiFiBerry AMP+. Using this would easily answer the second and third questions, as these are marketed as high quality audio products. This would also be easy to use, and could be powered by an external 12-18V power supply which would also power the Pi, also potentially answering the first question, but another factor I want to consider is cost.

The HiFi Berry Amp+

This amp costs just under £40, although it's not too expensive when you consider the price of an off-the-shelf streaming audio player. As this is a hobby project, I want to keep things small, simple and relatively inexpensive to start with, and potentially build up to something more powerful later.

As I'd mentioned previously, the Adafruit website has been invaluable for guides in how to use the components they sell and build circuits with them. One of the projects I found most useful was their Super Game Pi handheld games console, which was also built with the Raspberry Pi at it's core.

This project also answers some of my questions, the first two. It uses an amplifier circuit from Adafruit, which will essentially amplify anything with a headphone socket, and powers the amplifier and the Pi from a rechargeable battery and includes a circuit which handles the charging of the battery seamlessly.

This sounds ideal, a battery powered music player which can be plugged in via micro-USB to recharge it. Obviously the Raspberry Pi also uses the ubiquitous micro-USB for power, and I should be able to power the amp from the Pi, but having the ability to have the solution totally wireless was an appealing option.

The only unanswered question with this set-up would be the sound quality. The general opinion of the Raspberry Pi sound is that it is quite poor. I listened to music from the Pi over headphones and found that the quality seemed reasonable for what I'd need, providing amplifying this over speakers didn't sound any worse.

With these design decisions made, I found many of the items I'd need on Adafruit, but needed to order them from a UK stockist. Thankfully online stores like Pimoroni, Makersify, Pi Supply and Amazon stocked the items I needed.

This is the list of Adafruit components I ordered, or similar equivalents.


I already have an old Raspberry Pi model B which I am planning to use to prototype the project, but I am also considering that as the project is to be battery powered, keeping the power consumption down would be beneficial.

The newer Raspberry Pi A+ and B+ models have improved power management, and also use less power overall than the original model B. If my initial tests go well, I am planning on using a model A+ in my music player, as this has similar specs to my old model B, but is smaller and uses less power. The newer + models also boast improved sound quality, so this would also be an improvement.

According to RasPi.tv, the original model B uses around 360mA when idling, compared to around 100mA for the model A+.

With the 2500mAh battery I'm using, that could be as much as 25 hours of battery life, although when the music player is in use, I'd expect a greater power draw. If the music player is playing music over Wi-Fi, this will also draw more power.

RasPi.tv suggests that high processor usage (shooting 1080p video) uses 230mA, so even if my project used this much power, I could estimate around 10 hours of battery life. At the moment I don't know exactly how much power my project will draw, so currently these figures are nothing more than estimates.

I now have all the components I need to start building a working prototype. In my next post I will go into how I put this together.

Thursday, 7 January 2016

Starting something

I've taken an interest in the Raspberry Pi since it first launched, and have read a number of articles on possible uses and seen many interesting creations people have made with it.

I picked up one of the early model B editions of the Pi some time ago, and have done a small amount of tinkering with it, using it as a XBMC/Kodi/OSMC machine for watching videos, and trying out other similar applications. I always felt I should try a more ambitious project.

I didn't really need another device to play videos on, and have seen a number of really nice looking custom music players, so I started looking into the possibilities of creating my own.

I should start by mentioning that my electronics and soldering skills are fairly basic, so I wanted to start simple, with a view to adding to the project as I became more familiar and more confident with some of the electronics required.

Having read a lot about other peoples projects and how they had built them, I picked up an electronics starter kit for the Raspberry Pi.  The kit was aimed mainly at kids, but it had a solder-less breadboard, and a number of basic electronic components, wires, and instructions on building basic circuits, so thought this would be a good start.

Basic LED circuit controlled by the Raspberry Pi

I built some basic circuits with this kit, and as I'm a software developer I was happy enough hacking around with some of the python code to alter the function of the circuits slightly.
The projects are a good introduction to what can be achieved, but I mainly wanted the kit for the breadboard and the starter set of components and wires that should prove helpful when prototyping my music player.

Having gained a good idea of what I wanted to build and what components I'd need, I put a list together using Adafruit as a valuable resource for many of the components and also excellent guides on how to use the components and build projects with them.

I'll go into more detail on the components I'm using to build my music player in my next post.

Do a thing!

I've been considering for a while writing a blog, and a number of things recently have given me the push to finally start.

I've recently started a small electronics project, so I'll be writing about that soon, but really that was just a first article to get me started.

I'm a software developer by trade and have been for over 15 years. I read a lot of articles and blogs and have done a fair amount of training on the Internet. I've reached a point now where I've accumulated a fair amount of knowledge over the years and perhaps should start writing some of it down.

I also realised recently that I've not really started anything brand new for a while. I learn new things everyday as part of my job, but this is just an extension of things I already do, so here's something new.

Also, as I read a lot of blogs a lot of my knowledge and problem solving have come from other people's blogs, so perhaps one day my blog may impart knowledge to someone else learning something new.

It might inspire someone else to Do a Thing!


The design is basic to start with, and I'll tweak the design as I go, but I wanted to make a start and get something online, so here it is.