Thursday, December 26, 2013

Building a webradio with Raspberry Pi from scratch - Part I

I have always wanted to build a web radio from the moment I first started playing around with Raspberry Pi since early 2012. Of course, back then I was missing important experience and knowledge about electronics, which I now have (at least better), and therefore this "weekend project" was always postponed...

But why would someone want to build a webradio? Here are some reasons:
  1. You want the convenience of changing stations and adjusting the volume just like with a plain old radio (OK, not the REAL old radio, because it didn't have radio presets...). This is especially useful when you are living away from your country, and the local radio plays of course LOCAL stations and not your favorite ones back home.
  2. Building a project like this is complex and requires knowledge and experience in different aspects such as: user interface, events, casing etc. When you manage to finish something sophisticated like this you will have a nice feeling of achieving something hard.
  3. The existing off-the-shelf web radio devices out there can be expensive and don't offer exactly what you may want it terms of functionality, so why compromise?
So, how does one start with a project like this? I think the first thing to do, is to think about and write down what exactly functionality you want from your own webradio. Examples:
  • The device should have the ability to manage (add/remove) radio stations.
  • The user should be able to use it independently, without the use of a computer (web interface, SSH console etc.)

Careful here, this list of requirements can be really endless and you are running the risk here of creating a "monster" project that you will never be able to finish in a reasonable amount of time; meaning that it will in no way be a "weekend project"! Try to prioritize your requirements and start with the really important to you things. After all, its YOUR webradio, no ones else's.

This building down of requirements (or "stories" if you have experience with Scrum software development), will guide you to the interface that you need, physical (button-wise) and non-physical (screen interface). For example, having a requirement that the device should be operating absolutely independently (no web interface, no SSH etc.) means that the user should have a screen (e.g. an LCD display) and some buttons that he/she would be able to push to get the expected functionality.

Let's take a look at my requirements:
  • The device should be completely independent.
  • The user should be able to scroll and select from a list of predefined radio stations.
  • The user should be able to adjust the volume by using a potentiometer. meaning an analog input.
  • When the user is not selecting a radio station, he/she should be seeing a screen about what is currently played.
  • The speakers will be externally powered and the user will be able to connect his/her own speakers. 

But how should the interface look like? Here's the idea of the front view of the case which would contain the webradio:


So, like said before, we need an LCD display, 3 buttons and one potentiometer for the volume control. The three buttons will behave as follows: "up" will move the radio station selector up, "down" will move it down and "select" will be playing back our selected radio station.

Think about your requirements and layout, and till Part II!

No comments:

Post a Comment