BLE Spotify Controller - Unleash the Beat!
by vinvout-io in Circuits > Audio
1901 Views, 13 Favorites, 0 Comments
BLE Spotify Controller - Unleash the Beat!
Tired of reaching for your device every time you want to change a song or adjust the volume? Say hello to this ESP32-powered Spotify remote.
I have an exciting project to share, a Spotify controller using an ESP32 (for lazy people created by a lazy guy)
With this Nifty device, you will be able to control your Spotify playlist from a distance wirelessly.
Supplies
- ESP32
- Keypad Matrix
Quick Overview
Let's have a quick overview of our project, We'll be using an esp32, which is a powerful microcontroller, and a matrix keypad which we have built ourselves on a breadboard, so if you want to make one you can go check out my video on this.
Features
The esp32 uses its BLE (Bluetooth Low Energy) to act like a BLE keyboard here, which will send out the media controls like the play, pause, next track, previous track, volume controls, and on the desktop you can even go to the Spotify website just by a single press. You can go to some playlists like the liked songs by using your matrix keypad or this Nifty device.
Connections
Now let's connect the component --- we will wire up the Matrix keypad to the esp32 for user interaction if you want you can go check out this video to understand how to make one.
A 9V battery will power esp32 making it portable and wireless.
I know it will waste a lot of power but I could have used this 3.7 volt LiPo battery with the LDO like a mic 5205 but these were not available in my local store, so for now let's adjust with this
About the Code
It is time to upload the code, We will be using the Arduino IDE and some libraries such as keypad and ble keyboard to make our esp32 into the Spotify controller.
okay, first we need to download this library from GitHub. Next, open the Arduino IDE and navigate to Include library, then click and add zip library. Now go to the desired folder, and select the esp32 ble keyboard. Go to the examples, and scroll down to the examples from Custom Library there you can see it.
About the Library
You can find the code below, Go and upload it to your esp32. We use the BLE keyboard, This library is easy to use and it is similar to the keyboard library with more features. Thanks to its creators.
We also have something called the nimble mode. The nimble mode saves a lot of RAM and flash memory just add it using
#define USE_NIMBLE
Making It Presentable
To make it more presentable let's put all of this in a case
Testing
Alright, everything is ready Let's test our Spotify controller, now we'll pair our PC or phone and then we can start playing and controlling our Spotify playlist wirelessly. With the Press of a button, Spotify will open up in a new tab of our browser. You may need to change the code or the keyboard shortcut according to yours, it also has a feature to move to your favorite songs
Level It Up!!
Put the volume on max.
Here you have a demo.
Thanks for reading.