My little all in one volumio box


recently i finished my first volumio wlan box. it will be used to power up some very old BOSE 2.1 Speaker in my bedroom.

The box contains one Raspi B with an Audiophonics DAC Sabre ES9023. The DAC is directly connected to a 2*50W Class D amplifier /This one: … aa-ab32174 ). To connect the Speakers to the amplifier i use a regular terminal connector block

To hold all this stuff i designed some easy clamps, which are glued to the bottom plate of the acrylic glas case. The clamps are printed on my 3d printer in ABS plastics.

The Power source is a universal DC power supply with 15-24V and 5,5A. In order to power up the amplifier with 24v and the raspberry with 5v i added a dc-dc converter as a voltage regulator for the raspberry.

Also i added a 16x2 LCD to the front panel of my small box. Its connect via i2c to the pi. I’ve found a lib written in python to use the display. Also i wrote a small bash script to collect the informations i want to show on the LCD

The scripts uses mpc to readout the current song. If there is no song playing it shows the ip-address of eth0 in line one and wlan0 in line two.

I will replace the black painted (i’m not good in painting stuff) mdf front panel trough a laser cut black acrylic glas panel as soon as the lasercutter in my fablab is up and running.

Well done!
Could you give us please dc-dc regulator that you use ?
As it has been explain in a other thread, you should get i2C wire as short as possible. (I have got the same dac)
For the lcd script could give some info / source ( I’m looking one for a new project)

i don’t have any sound issues so i dont so a reason to short that cable.

i use this step down converter

this is my display
and this Adapter

You can find the python lib for the lcd under … pberry-pi/

To work with the lib i wrote two small tools: (place it in the same directory as th pylcdlib:

import pylcdlib, sys, getopt
lineone = ''
linetwo = ''

def main(argv):
      opts, args = getopt.getopt(argv,"hf:s:",["lone=","ltwo="])
   except getopt.GetoptError:
      print ' -f <zeile1> -s <zeile2>'
   for opt, arg in opts:
      if opt == '-h':
         print ' -f <zeile1> -s <zeile2>'
      elif opt in ("-f", "--lone"):
         global lineone
         lineone = arg
      elif opt in ("-s", "--ltwo"):
         global linetwo
         linetwo = arg
if __name__ == "__main__":

lcd = pylcdlib.lcd(0x3f,1) # define the i2c adress of your display

you need to set the i2c address of the display in this script. after this you can use the script with the parameters -f and -s (for first and second line)
for example:

python -f "Rise Against" -s "I Dont want to be here anymore"

The other script to detect the ip-addresses and whats playing is this bash script:


while true
LASTSONG=$(cat /root/lastsong.txt)
ARTISTIN=$(mpc -f “%artist%” | head -1)
TITLEIN=$(mpc -f “%title%” | head -1)
ARTIST=$(echo ${ARTISTIN} | sed “s/[’’]//g”)
TITLE=$(echo ${TITLEIN} | sed “s/[’’]//g”)
if [[ $ARTIST == “volume:” ]]
IP_eth=$(ifconfig eth0 | grep “inet addr:” | awk ‘{print $2}’ | cut -f2 -d’:’)
IP_wlan=$(ifconfig wlan0 | grep “inet addr:” | awk ‘{print $2}’ | cut -f2 -d’:’)
python /root/lcd/ -f “$IP_eth” -s “$IP_wlan”
elif [ “$CURRENTSONG” != “$LASTSONG” ]
echo “$CURRENTSONG” > /root/lastsong.txt
python /root/lcd/ -f “$ARTIST” -s “$TITLE”
sleep 5

This script is added to the rc.local like this:

/root/ & > /dev/null 2>&1

so its started into background on startup and runs in an endless loop.

To use the python lib you need to install a few tools:

sudo apt-get install python-smbus i2c-tools

And you have to load some kernel modules

modprobe i2c-bcm2708 modprobe i2c-dev

The best solution would be to add the modules i2c-bcm2708 and i2c-dev to your /etc/modules

Thank you very much for all details you gave. Few days ago, I have ordered a LCD and a I2c It seems to be the same than yours. I waiting to recieve my order and test it !!! :smiley:

yep looks identical and this should work with my script and the pylcdlib.

Hi - a very nice project, I will definitely try something similar. One question, how do you power the system up and down? I mean have you included any physical buttons etc. If yes, what is your solution?

i use the shutdown button in the volumio webinterface and after its shutdown, i cut the power connection with a built in switch on the back.

If you want a more safe method: you can built a more intelligent switch based on an arduino (the pro mini version for 2-3$ should be enough) and an backup battery. The arduino watches if there is a input voltage if no: it will send a signal to one of the gpio pins of the pi. A script on the pi will read from the gpio pin and if there is a signal on the pin, it will send a shutdown -h now command.

while the external power source is shutdown, the pi and the arduino are powered by the backup battery like a small Uninterruptible Power Supply

Nice box and a creative software solution!

By the way instead of polling the songinfo and save this to a file to compare this with the currentinfo, you could use “mpc idle”
In this case the subsystem player. So when something changes regarding the player this event will trigger an update of the song info.

[code]#! /bin/sh
while : ; do
mpc idle player >/dev/null
mpc current -f “[[[%artist% - ]|[%name%: ]]&[%title%]]|[%title%[%name%]]”




Configure the format of song display for status and the playlist. The metadata delimiters are "%name%", "%artist%", "%album%", "%title%", "%track%", "%time%", and "%file%". The [] operator is used to group output such that if no metadata delimiters are found or matched between '[' and ']', then none of the characters between '[' and ']' are output. '&' and '|' are logical operators for and and or. '#' is used to escape characters. Some useful examples for format are: "%file%" and "[[%artist% - ]%title%]|[%file%]". This command also takes the following defined escape sequences:
\\ - backslash
\a - alert
\b - backspace
\t - tab
\n - newline
\v - vertical tab
\f - form-feed
\r - carriage return 

I use this syntax because it works fine with MP3-files (Artist - Title) and Radiostations which provides different fields (Name+Title or Name or Title) and it results in one line.

I would like to embed the “mpc idle” command in a python-script but I dont know how to write an event!