You are on page 1of 22

8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Blog Login Sign up

09 Jul 2019 on etcher-featured | project | tutorial

Turn your old speakers or Hi-Fi


into Bluetooth receivers with a
Raspberry Pi and this step-by-
step guide
If you’ve got an old Hi-Fi or sound system with an AUX input,
this project is for you. Try balenaSound, a starter project to
quickly and easily add Bluetooth to an old Hi-Fi, speakers, or
any other audio device using only a Raspberry Pi!

Contents
https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 1/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Before you start

Introduction
Hardware required
Software required

Tutorial

1. Setup the Raspberry Pi


2. Deploy the project code
3. Connect your speakers

Using balenaSound

Give it a try
What next?
Until next time...

Before you start

Introduction

A lot of people have older and probably still great, high-quality audio
systems that no longer get used, simply because they’re inconvenient.
We’ve decided to address that with this very simple project we're calling
balenaSound. We will show you how to build your own Bluetooth audio
receiver which connects to the auxiliary(AUX) input of any audio device to
give it modern streaming functionality. You’ll then be able to stream music
to your audio setup from your phone, tablet, or laptop.

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 2/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

All you need is a Raspberry Pi and a little bit of time. We’ve done all the
hard work by con guring Bluetooth and setting everything up in a
repeatable format to get you up and running with minimal effort. It’s the
perfect introduction if you’ve never tried a project like this before.

We’re going to guide you through setting up the Raspberry Pi, deploying
the balenaSound project code onto it and then show you how to connect
your audio system and get started with streaming. Let’s get to it!

Hardware required

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 3/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Raspberry Pi 3A+/3B/3B+/Zero W
An SD Card (we always recommend SanDisk Extreme Pro SD cards)
Power supply
3.5mm audio cable to the input on your speakers/Hi-Fi (usually 3.5mm
or RCA)
An audio system to connect
(optional) Digital-analogue-converter(DAC) HAT (e.g. Pimoroni pHAT
DAC) for better audio quality

Note: the Raspberry Pi Zero cannot be used on it's own as it has no audio
output. To use the Pi Zero you'll need the optional DAC HAT to get the
project working.

Software required
A download of balenaSound from GitHub
Software to ash an SD card (balenaEtcher)
A free balenaCloud account to setup and manage the Pi
Download and install the balena CLI tools - to be installed on your
computer, allowing you to install the project code on the Pi

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 4/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Tutorial

Setup the Raspberry Pi


Once you’ve found all the hardware and prepared all the software, we’re
going to start setting up the Raspberry Pi.

Sign up for a free balenaCloud account

The rst thing you’ll need to do is sign up for an account if you haven't done
so already. If you’ve already got a GitHub or Google account you can use
that to login and bypass the signup process.

Sign up to balenaCloud

Create a balenaCloud application

Add an application selecting the correct device type for the device you’re
using, choosing Starter as the application type, then hit Create New
Application. Using the starter application will provide you with all of the
features of the microservices application and is free up to and including
your tenth device.

This will take you to the dashboard for your newly created application,
where you can move on to the next step and add your device. The name
you give your application is up to you, but you'll need to remember it for
later when you push your code.

Add a device and download the balenaOS disk image


from the dashboard

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 5/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Once your application has been created, you can setup and add a device
within that application by clicking the green 'add device' button. When you
add a device you specify your device type, which is important that it
matches the device you’re using, and if you are connecting to a wireless
network you can set your WiFI SSID and passphrase here too.

balenaOS 2.38 or higher is required for this project.

Note: we've used a Raspberry Pi 3 in the image below but be sure to select
the correct device type for the device you are using!

This process creates a customized image con gured for your application
and device type and includes your network settings if you speci ed them.

Note: When you're rst getting started, a development image will be most
useful, as it permits a number of testing and troubleshooting features. More
details on the differences between development and production images can
be found here. If you're con dent you can go ahead and deploy the
production image straight away.

Flash your SD card with the balenaOS disk image and


boot the device
https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 6/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Once the OS image has been downloaded, it’s time to ash your SD card.
You can use balenaEtcher for this.

Once the ashing process has completed, insert your SD card into the
Raspberry Pi and connect the power supply.

When the device boots for the rst time, it connects to the balenaCloud
dashboard, after which you’ll be able to see it listed as online and move
onto the next step.

Troubleshooting: It should only take a few minutes for the new device to
appear in your dashboard, If your device still hasn't shown up on your

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 7/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

dashboard after a few minutes, something has gone wrong. There's an


extensive troubleshooting guide in the documentation, with lots of
information on why this could be, but if you still can't get your device online,
come on over to the forums where we’ll be able to help out.

Deploy the project code


Now you’ve got your Raspberry Pi online within the balenaCloud
dashboard, it’s time to deploy the project code and turn it into a Bluetooth
audio device!

Download the project from GitHub

As we mentioned in the software required section, you’ll need to grab a


copy of the balenaSound project from GitHub. You can download the ZIP
from GitHub as shown below but if you’re familiar with Git you can use
git clone in the normal way.

Important note for Windows users: if you're using Windows the


combination of git clone and balena push can cause issues due to line
ending changes; we recommend using a combination of either the zip
download of the project and balena push or if you'd like to use git clone

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 8/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

then also use the git deployment method git push instead of
balena push .

Push the project code to your Raspberry Pi

As you’ve installed the balena CLI on your computer, downloaded the


balenaSound code from GitHub, and have your Raspberry Pi online in the
balenaCloud dashboard, it’s time to push the code and get things running!

From within the unzipped project directory, execute


balena push <appName> , where appName is the application name you set
earlier in the guide. For example: balena push balenaSound .

If everything worked out correctly, after a few minutes your device


information screen in the dashboard should look something like this,
showing the service running.

At this point you’re ready to move on, connect things up and give it a try!

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=etc… 9/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Connect your speakers


Most Hi-Fi systems and powered speakers will include an auxiliary (AUX)
input for connecting things such as your newly-created balenaSound
device. To do this you’ll need to ensure you have the right cables. The audio
output on the Raspberry Pi (and the PHAT DAC) is a 3.5mm stereo audio
jack, and most AUX inputs are going to be either the same or perhaps more
commonly a phono/RCA input, which are the individual red and white
connectors. Therefore you’re going to need a cable to work with your setup.
The AmazonBasics range is a good place to start looking, the cables are
good quality without costing too much.

3.5mm to RCA cable (Amazon USA)


3.5mm to RCA cable (Amazon UK)

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 10/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Using balenaSound

Give it a try
Once you’ve got your Pi powered up and your speakers connected, you’re
ready to go! Perform a scan for Bluetooth devices on your phone, tablet or
laptop and you should see your balenaSound device ready to connect.

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 11/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

BalenaSound presents itself to your device as a Bluetooth audio receiver, so


that once pairing is complete you can now send any audio output from your
device to your old speakers!

What next?
So, you’ve got the project running and are jammin’ to your old hi- system
with a new lease of life! What now? Here are some ideas…

Customize your device name

What’s that? Don’t like the balenaSound xxxx name? We’ve got you
covered! Simply add a device environment variable in the balenaCloud
dashboard called BLUETOOTH_DEVICE_NAME and your device will reboot with
a new name.

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 12/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Upgrade your audio with a DAC

The Raspberry Pi isn’t known for great audio quality; fortunately this has
been addressed with a lot of manufacturers producing DACs for the
Raspberry Pi. One I have tested and like for both its small size and low price
is the Pimoroni PHAT DAC.

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 13/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

To use this you’ll need to make a couple of changes to the device


con guration in the balenaCloud dashboard. The rst one is to disable the
on-board audio by editing the existing RESIN_HOST_CONFIG_dtparam
variable to set ”audio=off” . We then add an additional custom
con guration variable called BALENA_HOST_CONFIG_dtoverlay with a value
of hifiberry-dac .

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 14/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

This essentially enables the I2S sound interface on the Raspberry Pi GPIO
pins, enabling the external DAC to receive and process the audio output.

Try the HDMI out

If you've got an ampli er or receiver that has an HDMI input, you can also
use the HDMI output of the Raspberry Pi to transfer a digital audio signal.

Until next time...


Thanks for taking the time to check out our guide, we hope you had success
with the project and added Bluetooth to some old speakers or a Hi-Fi. If you
had trouble getting the project running or have any other feedback we’d
love to hear it; everything helps to improve our projects and tutorials for
next time.

You can always nd us on the forums at https://forums.balena.io, on Twitter


@balena_io, on Instagram @balena_io or on Facebook.

Chris Crocker-White Share this post


Hardware Hacker in Residence  
Sign up now

What do you think?


98 Responses

Upvote Funny Love Surprised Angry

Sad

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 15/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

41 Comments balena blog 


1 Login

 Recommend 2 t Tweet f Share Sort by Best

Join the discussion…

LOG IN WITH OR SIGN UP WITH DISQUS ?

Name

metool6 • a month ago • edited


Loaded it all up, My pi is showing the bluetooth name but it is not acting
like a receiver. Phones and pcs are showing it as another Bluetooth
devices and not taking in an audio.
4 △ ▽ • Reply • Share ›

GekkeBob > metool6 • a month ago


yes, same problem here
1 △ ▽ • Reply • Share ›

DB > GekkeBob • a month ago


same here
1 △ ▽ • Reply • Share ›

DB > DB • a month ago


Works now.. Was a problem with balenaSound code
from Github..
3 △ ▽ • Reply • Share ›

Timbo614 > DB • a month ago


Downloading the latest and pushing fixed my
problem too. I didn't get any notification about this
fix/patch so thanks!
1 △ ▽ • Reply • Share ›

GekkeBob > DB • a month ago


How did you fix it?
1 △ ▽ • Reply • Share ›

DB > GekkeBob • a month ago


Downloaded the new updated version of
balenaSound code from GitHub and pushed it.
2 △ ▽ • Reply • Share ›
https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 16/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Toby • a month ago • edited


Thanks Chris, works a treat using the jack output on the pi. I've a
hifiberry dac clone (link below) with 3.5mm jack and RCV outputs,
which I can't get to work with the custom variable change you've
detailed. The clone works fine with lots of other software eg Volumio. Is
there a simple fix for this hifiberry dac clone? Thanks again.

https://www.ebay.co.uk/itm/...
3 △ ▽ • Reply • Share ›

Toby > Toby • a month ago • edited


OK, found the solution myself and all working nicely. If you are
using a hifiberry dac plus use "hifiberry-dacplus" in place of
"hifiberry-dac" for the variable
BALENA_HOST_CONFIG_dtoverlay in the Custom
Configuration Section. Thanks again for your work.
3 △ ▽ • Reply • Share ›

Benjamin • 2 months ago


Oh my god. This tutorial, the software, and everything else is just just
soooooooo nice. Everything worked extremely nice, I had no single
porblem. Love the work of the devs thet made things soooooo easy.
Thank you.
3 △ ▽ • Reply • Share ›

A.M • a month ago


Great projects each time. Thank you!
2 △ ▽ • Reply • Share ›

Matt • a month ago


Is there a way to do this project without BalenaCloud?
2 △ ▽ • Reply • Share ›

Chris Crocker-White Mod > Matt • 24 days ago


Sure, just set up the OS and install/copy the script over manually
- the packages you need are all detailed in the Dockerfile
1 △ ▽ • Reply • Share ›

neville_scollop > Matt • a month ago


roughly the same sort of project discussed here using spotify:
https://mybroadband.co.za/n...
△ ▽ • Reply • Share ›

Benjamin > Matt • a month ago


I don't think so as you need the balena dashboard to change some
https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 17/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide
I don t think so as you need the balena dashboard to change some
settings, but I can be wrong.
△ ▽ • Reply • Share ›

Edward Spiegel • a month ago


does this setup allow pairing with multiple devices (not at once). For
example, sometimes I would want to stream audio from my phone and
sometimes from my iPad.
2 △ ▽ • Reply • Share ›

Chris Crocker-White Mod > Edward Spiegel


• 24 days ago
Yup, you can have multiple pairings stored, but only one
simultaneous connection
1 △ ▽ • Reply • Share ›

Drew Abas • a day ago


I'm a noob and missing something big time...

From within the unzipped project directory, execute balena push


<appname>, where appName is the application name you set earlier
in the guide. For example: balena push balenaSound.

I have no idea what that is. I loaded the OS on to my pi. The device is
showing up in my balena project dashboard. I've downloaded and
installed (I think) the CLI, but have no real idea what that is for. I've
downloaded the project from GitHub and extracted it. But, I have no
idea what happens next. How do I push the project code to my pi??

If this is too much hand holding, I completely understand. If so, could


you possibly point me to tutorials to understand the basics of what's
going on here?
△ ▽ • Reply • Share ›

Drew Abas > Drew Abas • a day ago • edited


so I was able to access the CLI and log in to my balena account
from there. Am I supposed to somehow navigate within the
command line to the project directory root and there perform
balena push appname?
△ ▽ • Reply • Share ›

Bjorn • 3 days ago


It worked (almost). I get sound via the hdmi kabel to my TV. But If I put
an headphone into the PI I do not get any sound. Anybody has an idea
what's going on?
△ ▽ • Reply • Share ›

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 18/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

Shane Eazor • 6 days ago


This is my First Pi project and it worked great! I have the Pi connected in
my car with and Apogee One and it sounds fantastic.

How ever, I cant seem to find a way to get the Pi to auto connect to my
iPhone when it boots. I found a script tutorial but when I try it I get read
only errors when I try adding a script. I was wondering if anyone could
help me with a configuration or way to add scripts to balenaCloud?

Tnanks!
△ ▽ • Reply • Share ›

PJ Jns • 8 days ago • edited


Would love to do this project. Can I add a small touch screen to the pi for
control instead of using a phone.
△ ▽ • Reply • Share ›

Aldo D'Orso • 12 days ago


Can i follow that guide for rasberry pi 0 w?
△ ▽ • Reply • Share ›

Chris Crocker-White Mod > Aldo D'Orso • 10 days ago


Yup, but you'll need a HAT as the Zero has no audio output :-)
△ ▽ • Reply • Share ›

Gamba85 • 16 days ago


Hola, hecho, gran aplicación y tutorial, alguna cosa faltaba y he tenido
que investigar un poco, pero bueno. Os dejo mi propio tuto:

△ ▽ • Reply • Share ›

Chris Crocker-White Mod > Gamba85 • 10 days ago


Muchas gracias por el gran video tutorial!!
https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 19/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide
Muchas gracias por el gran video tutorial!!
△ ▽ • Reply • Share ›

Subhang Bhatti • 19 days ago


Interesting. If You Want More However You Can Always Go To
https://projects.raspberryp... For More Projects.
△ ▽ • Reply • Share ›

Scott Plude • 25 days ago


huge delay in sound vs the video on my laptop. I would guess it is almost
2 seonds delayed. brand new i7PLUS laptop with ssd so I know it isn't
my laptop that is draggin
△ ▽ • Reply • Share ›

Timbo614 • a month ago • edited


I have everything downloaded setup and it all seems to be running but I
have an Android 9 phone, its bluetooth finds the pi as balenaSound xxxx
pairs with it ... connects then immediately disconnects :( Any ideas?
△ ▽ • Reply • Share ›

Letrix_AR • a month ago


And how differs from a regular Bluetooth receiver?
△ ▽ • Reply • Share ›

GekkeBob • a month ago


Would this work with a raspberry pi zero and a usb audio card?
△ ▽ • Reply • Share ›

Chris Crocker-White Mod > GekkeBob • 24 days ago


Check out the issue on GitHub here, another balenaSound user
has explained how to get this working:
https://github.com/balena-i...
△ ▽ • Reply • Share ›

Sean Miller • a month ago


Where I intend to use this does not have a continual internet connection.
Of course setting it up requires the internet, and that's okay. Does
actually using it require an internet connection? It looks very interesting.
△ ▽ • Reply • Share ›

Chris Crocker-White Mod > Sean Miller • 24 days ago


Once you have deployed the project it no longer needs an internet
connection so should work fine!
△ ▽ • Reply • Share ›

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 20/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

ph9214 • a month ago


Would this work with a usb audio dac?
△ ▽ • Reply • Share ›

Benjamin • a month ago • edited


Hello. Is it possible to disable the connect/disconnect sound ? (as the
volume set itself at 100% on boot so it is very loud). Or is it possible to
set the volume to like 30% when a device connect/disconnect to the
raspsberry ?
(I am using a raspberry PI 3 model B with a hifiberry amp+ DAC).
Thank you :)
△ ▽ • Reply • Share ›

Benjamin > Benjamin • a month ago • edited


Ok, so I found a very non-aesthetic solution. I just went into the
script files and lowered the gain of the two files (connect and
disctonnect), they are located in : balena-sound-
master\bluetooth-audio\sounds,
using Audacity and used balena cli to "re-push" the script and
now, everything seems ok !
△ ▽ • Reply • Share ›

Leko Fraggle • 2 months ago


This is amazing. Thank you for sharing. Will this work without Internet
after setup?
Thanks.
△ ▽ • Reply • Share ›

Chris Crocker-White Mod > Leko Fraggle


• 2 months ago
Yep it will!
△ ▽ • Reply • Share ›

Adrien • 2 months ago


G j !W ld i k ih R b Pi B d USB


 Github  Twitter  Facebook  Instagram  Linkedin  Youtube  Twitch

 Slideshare  Hackaday  Hackster


https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 21/22
8/29/2019 Turn your old speakers or Hi-Fi into Bluetooth receivers with a Raspberry Pi and this step-by-step guide

All Systems Operational

Balena Products Resources Company

What is balena? BalenaCloud Support Team

Pricing OpenBalena Docs Jobs

Customers BalenaEtcher Forums Press

BalenaOS Projects Contact us

BalenaEngine Base images

BalenaFin Status

Subscribe to our newsletter


Email

Subscribe now

Terms of Service | Privacy Statement | Master agreement | Copyright 2019 Balena | All
Rights Reserved

https://www.balena.io/blog/turn-your-old-speakers-or-hi-fi-into-bluetooth-receivers-using-only-a-raspberry-pi/?utm_source=efp&utm_medium=et… 22/22

You might also like