Music Status Player

by winrtop255 in Circuits > Arduino

4251 Views, 55 Favorites, 0 Comments

Music Status Player

F24M6A5MG16BUMD.jpg
FKDBJXKMG16C2N5.gif
FEGN2ZSMG16BW3B.gif
IMG_9236.JPG
IMG_9253.JPG
IMG_9235.JPG
IMG_9258.JPG
FP2F2JVMG16BVQ4.jpg
FQEFU67MG16BVIJ.jpg
FQMZ67AMG16BVL1.jpg
FDFSUAXMG16BU6H.jpg
FMKIVVIMG16BUAA.jpg

Have you ever wished you could control your music without constantly switching windows or fumbling with keyboard shortcuts that don’t even work half the time??

This project aims to solve all these problems with a live desktop Status Player! It’s a simple, affordable and compact tool that gives you direct control over your music.

It has an Arduino Nano and an OLED display with three control buttons, and a rotary encoder, all built inside of an aesthetic 3D printed case! With it, you can easily see your song name and artist at a glance, and with just a press or a twist, you can fully control your music, such as skipping, pausing, rewinding or even changing the volume!


The tool acts like a bridge between your PC and your workspace since it sends commands from the Arduino over USB through serial. It’s then picked up by a Python script that controls the actual media on your computer! This makes it super versatile and allows for extensive control and modding. The final result is a vital but out-of-the-way tool that fits perfectly on any tabletop.

Supplies

IMG_9157.JPG
IMG_9156.JPG
IMG_9158.JPG
IMG_9159.JPG
IMG_9160.JPG
IMG_9266.JPG
IMG_9268.JPG

I wanted to make this status player small but also affordable, so anybody could make it. The entire cost for this project (excluding tools and filament) was only around ~10$!

Here’s what you’ll need:

  1. 1 Arduino Nano
  2. 1 SSD1306 OLED Display
  3. 3 Momentary Push Buttons (for rewind, pause/play, skip)
  4. 1 Rotary Encoder with a built-in Push Button
  5. 1 PCB Prototype board
  6. Female Header Pins
  7. Jumper Wires
  8. Hot Glue
  9. M2x8(mm) screws
  10. 3D Printed Case + Backplate + Buttons + Knob


As for the tools you’ll need:

  1. Soldering iron & solder
  2. Screwdriver
  3. Wire cutters/strippers
  4. 3D printer
  5. Filament (I used PLA)

3D Printing Everything

IMG_9171.JPG
IMG_9170.JPG
IMG_9172.JPG
IMG_9169.JPG
IMG_9168.JPG
IMG_9166.JPG
IMG_9165.JPG
IMG_9162.JPG
IMG_9163.JPG

The first step in this project is to print out all the models. There are 4 main parts.

  1. The Enclosure that holds all the components inside
  2. The Backplate, which covers everything up and seals the enclosure
  3. The Buttons that go in the enclosure’s designated hole to make it more aesthetically pleasing
  4. And the Knob cover to complete the aesthetic!


When printing the parts, I would recommend the following settings:

  1. Layer height: 0.2 mm
  2. Infill: 20% is enough for strength
  3. Supports: None, I designed the models for support-free printing!
  4. Orientation: Print the enclosure flat on its face


I also used PLA filament since it’s easy to work with, but you can use any other material, such as PETG, etc.

Soldering Up the PCB

IMG_9173.JPG
IMG_9174.JPG
IMG_9175.JPG
IMG_9176.JPG
IMG_9177.JPG
IMG_9178.JPG
IMG_9179.JPG
IMG_9180.JPG
IMG_9181.JPG
IMG_9182.JPG
IMG_9183.JPG
IMG_9184.JPG

Now we’ll begin with the actual components for the tool. Originally, I had decided to wire everything up manually, but I realised that using a prototype PCB board would make the whole setup easier. I’ve attached multiple photos of my PCB and a schematic photo of the circuit, which will make it quite easy to follow!


To start, first place the three push buttons onto the PCB near the bottom left. One pin from each button should be soldered together since it will be the ground pin.


After that, you’ll need to solder the rotary encoder to the PCB.

First, place it on the PCB, making sure it’s above the middle button and with the two pins side facing towards it. The encoder module will have a total of 5 pins, with 2 of them located on the opposite side. These pins are for the built-in button and will similarly require one of the pins to be soldered to the common ground.


On the other side, there will be 3 pins (for the encoder itself). You’ll need to solder jumper wires onto the right and left pins while connecting the middle pin to the ground!


Finally, you’ll need to solder on a 4-pin female header onto the board. This will allow the OLED display to connect and interface with the Arduino! You can wire the GND header from the OLED to other ground pins on the buttons since they share a common ground.


For the other 3 pins on the header, solder jumper wires onto them individually.


At this point, your PCB should have all the components mounted. From here, make sure to use a multimeter to test each connection and ensure there are no shorts apart from the ground pins.

Assembling the Case

IMG_9185.JPG
IMG_9186.JPG
IMG_9187.JPG
IMG_9188.JPG
IMG_9190.JPG
IMG_9191.JPG
IMG_9192.JPG
IMG_9193.JPG
IMG_9194.JPG
IMG_9195.JPG

Next, we can give our status player a body!


  1. First, place the 3D printed buttons into the front panel cutouts of the 3D printed enclosure. Make sure the little tabs are all aligned so that the buttons don’t end up spinning or falling out.


  1. Now, insert the PCB board from behind the panel, aligning the buttons and the encoder with their openings.


  1. Once that’s done, carefully screw the PCB into the shell using 3 M2x8 screws through the mounting holes!


  1. Now the front of the case should show the three buttons and the slot for the rotary knob.

Wiring Up

IMG_9196.JPG
IMG_9197.JPG
IMG_9198.JPG
IMG_9199.JPG

With the PCB mounted, it’s time to connect everything to the Arduino Nano.

I’ve attached a schematic of the circuit in this step as well as multiple photos of my setup!

Here’s also a written-out version of it:

Buttons -> Arduino

  1. Skip Button > Pin 4
  2. Pause/Play Button > Pin 7
  3. Rewind Button > Pin 6
  4. Ground > GND

Rotary Encoder -> Arduino

  1. CLK (Outer pin) > Pin 3
  2. GND (Middle pin) > GND
  3. DT (The other outer pin) > Pin 2
  4. Rotary Button > Pin 5

OLED Display -> Arduino

  1. SDA > A4
  2. SCL > A5
  3. VCC > 5V+
  4. GND > GND

As you can see from the diagrams, the circuit is quite simple!

Mounting the Arduino

IMG_9200.JPG
IMG_9201.JPG
IMG_9202.JPG
IMG_9203.JPG
IMG_9204.JPG

Now that we’ve wired everything up, it's time to install the Arduino inside the case.

  1. First, position the Arduino Nano inside the case with its USB-C port aligned to the enclosure’s cutout.
  2. Then, fix it in place using hot glue. Make sure the port remains accessible for programming and power!


Sealing the Enclosure

IMG_9205.JPG
IMG_9206.JPG
IMG_9207.JPG
IMG_9208.JPG
IMG_9209.JPG
IMG_9210.JPG
IMG_9211.JPG
IMG_9212.JPG
IMG_9213.JPG
IMG_9214.JPG
IMG_9215.JPG
IMG_9216.JPG
IMG_9217.JPG

Now for the finishing touches!

  1. Place the backplate onto the case and screw it in using four M2x8mm screws!
  2. Then finally, push the rotary knob cover onto the encoder shaft to complete the look!

Your status player should now look like an actual, complete product!

Uploading the Arduino Code

SatDisplay.png

Now it’s time to finally upload our code!

First, download the sketch at the bottom of the step, and open it up in Arduino IDE.

Before we can upload it, however, we need to make sure that we’ve installed the required Arduino libraries. These libraries handle the OLED display and graphics rendering.


To install these libraries in the Arduino IDE,

First, open the Arduino IDE.

Then go to Sketch > Include Library > Manage Libraries….

Search for and install:

  1. Adafruit GFX Library
  2. Adafruit SSD1306 Library


Once they’ve installed, plug your Arduino Nano into your PC via USB-C.

Then, in the Arduino IDE, select the Arduino Nano board and the correct COM port.

Finally, hit upload and you’ll be done!


Now your Nano should be able to handle button presses, the rotary encoder, and updating the OLED display.

Downloads

Setting Up the Python Script

Python.png

Now we need to set up the Python script. The Python side acts like a bridge between the Arduino and Windows itself. Make sure you download it from the step and place it into an empty folder.


Once you’ve done that, first head into that blank folder and create a virtual environment in PowerShell with:

python -m venv venv


Then activate the virtual environment with:

.\venv\Scripts\Activate


Now we can begin installing the required libraries. With your virtual environment active, install them via:

pip install pyserial winsdk comtypes pycaw


Once everything is installed, simply run:

python status_player.py

to verify that everything is installed and it works.


Downloads

Enjoy!

Demo .gif
Scroll.gif
IMG_9237.JPG
IMG_9244.JPG
IMG_9241.JPG
IMG_9240.JPG
IMG_9243.JPG
IMG_9255.JPG
IMG_9252.JPG
IMG_9259.JPG
IMG_9260.JPG
IMG_9261.JPG
IMG_9262.JPG
IMG_9263.JPG
IMG_9264.JPG

And that’s it!

Your Status Player should now be complete!

To use it, connect your Arduino Nano via USB. Then run the Python script and wait around 5 seconds for it to sync up. Then open your favourite app like Spotify, YouTube, or anything else and play something.


It should then appear on the display, and you’ll be granted full control over it, such as rewinding, pausing, skipping and adjusting volume!


I found this project extremely useful since I no longer had to change tabs or fiddle with keybinds whenever a song I didn’t like came up; all I had to do was press a physical button!

I hope you enjoyed building this project and that it finds a permanent place on your desk.

Happy making!