Easy DIY Bluetooth Speaker Project

Creating your own Bluetooth Speaker is a simple and fun project, which you can use around the house or in the garden, even while camping with a portable power pack.

In this guide we use an ESP32 Dev Module, along with some old USB Speakers to make our own Bluetooth Speakers.

We also use a USB Passthrough so we can power both the ESP32 Dev Module, and the speakers from a single USB Connection.

Note IconPlease Note:

This project simply shows how this can be achieved, and it could all be permanently wired together and hidden within a speaker easily for a more permanent installation.

It could also be minimised by using a standalone ESP32 chip, and a small number of components.

Hardware

Speakers

We are using a set of USB Powered speakers (an old equivelant of these), which have a 3.5mm Stereo Audio Jack connector, and USB Lead for power only.

These speakers already contain an amplifier so we don't need to add an amplifier circuit to our setup here.

Audio Connectors

We used a Female Audio connector so we can plug our speakers into this easily.

It also allows us to connect it to an existing stereo system with a Male to Male Audio lead.

The ESP32 Dev Module outputs audio the same audio on GPIO25 and GPIO26, we will join the Left and Right connections on our Female Audio connector together, so we only need one pin connected on our ESP32.

You can wire up both channels to the seperate ESP32 pins GPIO25 and GPIO26, which would look like below:

Software

Arduino Libraries

We will be using the ESP32-A2DP Library which allows us to harness the Bluetooth and PWM features of the ESP32 to create our Bluetooth Audio Receiver.

The library needs to be downloaded from GitHub here, and can then be installed manually, or by using the vMicro > Add Libraries > Install from ZIP command.

Example Project

Once the library is installed, the example project can be downloaded from here, and opened in Visual Micro.

If you want to customise the name of the device, this can be edited in the setup() function on the line a2dp_sink.start("vMicro BT Speaker");

Now we can select the ESP32 Dev Module Board, and our COM Port, and Build and Upload as normal.

Connections

Now we can connect the Audio connector to the ESP32 on GND, and on GPIO25 (and GPIO26 if you are using it).

Finally we need to power both the speakers and the ESP32 to bring the system to life.

Now you can see the Bluetooth device "vMicro BT Speaker" on your laptop or mobile phone and connect to it to begin playing music through your new device.

Going Further

Now we have the basics setup, we could add an LED Indicator to show when a device is connected, or when the volume changes, or alternatively a screen.

An SD Card could also be used to play audio from locally giving all the features of a modern Bluetooth speaker, with all the customisable features you want to add.

Video Guide

There is a short YouTube video below which covers this guide: