Minimalist MP3 player for Mamie Colette, my grandmother 👵 💕
By "minimalist", I mean the whole user interface is :
A single button allows to switch between 2 modes :
- On : indefinitely play all MP3 files randomly
- Off : stop playing
Behind the button is a Raspberry Pi 3 B with external speakers powered by USB.
Volume control is on external speakers.
Button state is read by Raspberry Pi GPIO2 input.
USB power is switched off when the button is off.
Using rpi-installer, choose RASPBERRY PI OS (LEGACY)
with desktop and
security updates, without recommanded applications.
Insert SD card and start the Pi.
A usefull lib to play audio files from python.
pip install python-vlc
A usefull tool to switch USB power ON/OFF programmatically.
sudo apt-get install libusb-1.0-0-dev
cd ~
git clone https://github.com/mvp/uhubctl
cd uhubctl
make
sudo make install
cd ~
git clone https://github.com/remipch/radio_colette
Copy some MP3 files to /home/pi/radio_colette/audio/
directory.
Enable audio output from "Device Profiles" icon :
- Disable HDMI Digital Stereo Output
- Enable AV Jack Analog Stereo Output
Autostart radio_colette (from forums.raspberrypi.com) :
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
and add this line at the end :
@lxterminal -e python3 /home/pi/radio_colette/radio_colette.py
GPIO2 has a builtin pullup, just connect the button between GPIO2 and GND, so :
- On = connected circuit = play
- Off = disconnected circuit = stop
From raspberry.com, here is the GPIO pinout :