Raspberry Pi based MP3 jukebox with USB display board 2014 Russell Kramer

Similar documents
Getting started with Raspberry Pi (and WebIoPi framework)

XLink Kai Raspberry Pi Beginners Tutorial

RETROPIE INSTALLATION GUIDE

Topics. What is a RaspberryPi? Why should I want one? What is Raspbian? What is SSH? What is FTP? What is LAMP? Making a LAMP Stack!

BLUETOOTH BASED OFFICE AUTOMATION AND SECURITY SYSTEM USING RASPBERRY PI AND ANDROID APPLICATION

Manual of ET-LCD SW HAT

Embedded Automation, Inc. Suite #104, th Street Surrey, BC V3W 1H8 Phone: (604) Fax: (604)

Tutorial 1: Software Setup

Atmel 328-Processor for RaspberryPi

Adafruit's Raspberry Pi Lesson 6. Using SSH

Lab 0: Intro to running Jupyter Notebook on a Raspberry Pi

Pianoteq 6 Raspberry Pi 3 Station. By Edgar Bustamante

Spring 2017 Gabriel Kuri

09/05/2014. Engaging electronics for the new D&T curriculum. Geoff Hampson Managing Director of Kitronik. Presentation overview

Advanced Embedded Systems

Click-A-Tune. User Manual

PIC Dev 14 Surface Mount PCB Assembly and Test Lab 1

Cooking with Team 279

Raspberry Pi NTP Clock Setup Guide

AlaMode User Manual Revision

USB Type A Female Breakout Hookup Guide

w w w. b a s e t r a i n i n g i n s t i t u t e. c o

Lab2 - Bootloader. Conventions. Department of Computer Science and Information Engineering National Taiwan University

Configure router. 26. Start AirPort Utility (located in the Utilities folder). The AirPort Utility window show a component diagram:

PIC Dev 14 Through hole PCB Assembly and Test Lab 1

BeagleBone Black: Installing Operating Systems

Development Environment Embedded Linux Primer Ch 1&2

Programmable Analog Input Node (PAIN) Master Semester Thesis, Nicolo D Anna.

Interfacing with Raspberry Pi 3 Model B Updated: 9/19/17

EAN-FPGA Firmware Update 1500-OEM

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

MP3 audio amplifier. Build Instructions. Issue 2.0

SD/MMC mod - DD-WRT Wiki

TQ2440 Development Platform Manual

Building RoboPIC 18F4550

Exclusive 2.5 GHz Frequency Counter

MicroEmbedded Technologies, Pune. A user manual for Using the BeagleBone Black with Linux Host.

Assembly Instructions for 128x64 Graphics Display Unit

Raspberry Pi Workshop

Experimental Procedure. Frequently Asked Questions (FAQ) Kit General Questions. Setting Up and Using Your Raspberry Pi Projects Kit

MABEL, PiTone and Control Functions Installation Procedure for hamvoip.org version 1.5 Allstar Distribution

AAZ-0914A USB, Blue tooth and Graphic CPU 50MHZ Antenna Analyzer

RaspiDigiHamClock. Raspberry Pi Amateur Radio Digital Clock. v WA4EFH R.Grokett

Preparing SD card for Pi

The CD100MP3 is a micro-computer based hard disk player that replaces the entire CD mechanism and decoder in your ROWE/AMI CD100 jukebox.

IoT with Intel Galileo Gerardo Carmona. makerobots.tk

SBC45EC. Single board computer for 44 pin PLCC PICs

Adafruit PiUART - USB Console and Power Add-on for Raspberry Pi

Adding a Real Time Clock to Raspberry Pi

Docking Station Operational Description

GETTING STARTED WITH RASPBERRY PI

Cygnos360 V2 Installation Manual

Ding Dong, You've Got Mail! A Lab Activity for Teaching the Internet of Things

TuBbika SMR-4-PLUS voicecard

M-606 Linux ARM9 Single Board Computer User Guide

Xinu on Intel Galileo User Manual

PIC 28 Pin Board Documentation. Update Version 5.0

TH E FI N EST I N G E E K E NTE RTAI N M E NT

DELUXE STEREO AMPLIFIER KIT

Sidewinder Development Board rev 1.0

Security Camera. by maartenbrysbaert. The SeCam is a security camera that allows you to: - Livestream. - Rotate your camera 180 degrees

Embedded Technosolutions

To lead your students through this activity, you will need your computer, attached to a projector, for projecting your code for students to see.

Grand Central Soundboard in Ten Minutes Created by Mike Barela. Last updated on :11:24 PM UTC

Product Overview -A 16 bit Micro Experimenter for Solderless Breadboards

SoundBridge Helpful Tips. For customers who want to use Roku SoundBridge with the SlimServer music server

RASPBERRY PI IN AMATEUR RADIO. Matthew Miller KK4NDE

Fix the Missing Tags in your MP3 Files

Tim Chin Omar Gonzalez Ward Huang. Critical Design Review

In this video, I will be covering DM385 IPNC RDK out of box demo-- Here, I'll be showing flashing the uboot using prebuilt binaries available in RDK--

How to Make a Raspberry Pi Web Server

All rights reserved by Waveshare Electronics Co., Ltd. Not allow to modify, distribute, or copy without permission.

IoE Workshop. Marc Khayat, CCIE #41288, Leonard Janer Technical Managers. June 16

RASPBERRY PI MEGA-IO EXPANSION CARD USER'S GUIDE VERSION 2.3

Rs-Pi 7 USB- Hub & I2C 1-Wire User Manual

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

The FED PIC Flex 2 Development Boards

GpsNtp-Pi Network Time Server ~ Supplement

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

E-Blocks Datalogger Bundle

How to use the MP3 player

Overview of the Raspberry Pi Models 3B & 2B

DIY KIT 121. ATMEL 89Cx051 PROGRAMMER

Internet board datasheet EB

FINAL PROJECT: MUSIC SERVER

C S Technology Ltd. cstech.co.uk. DTMF display 32 kit with 2 line x 16 LCD display

Adafruit's Raspberry Pi Lesson 2. First Time Configuration

Adafruit Metro Mini. Created by lady ada. Last updated on :12:28 PM UTC

Adafruit MAX98357 I2S Class-D Mono Amp

BeagleBone Black: Installing Operating Systems

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

+ Background Music and Intelligent Messaging. + Message Player for Internet Streamed Audio. + Message Player for Existing Audio Device

Electronics Single Board Computers

Raspberry Pi User Guide, 2nd Edition

#Uncomment the second line to enable any form of FTP write command. #write_enable=yes

Cygnos360 V2 Installation Manual

Atlas iot. Installation guide V 1.0

Integration Partners:

Cambrionix Universal Charger API

TNC-Black Assembly Instructions & Operating Tips

Transcription:

Raspberry Pi based MP3 jukebox with USB display board 2014 Russell Kramer Project Goals: 1) Launch a Raspberry Pi Python MP3 player script on power up. 2) Control volume and song selection with a button matrix 3) Extract ID3 tags and send the data to display hardware through USB

Background Prior to this project I created a LED Rave shopping cart tricycle. This project featured a mobile set of speakers and LED display boards capable of responding to audio sources and displaying text. I found myself irritated with off the shelf MP3 players for two main reasons: 1) None of them would simply turn on and start playing music. They all required me to navigate through various menus and loading screens beforehand. 2) There was no easy way to extract information such as the song title and integrate it into the lighting display. This problem had a few solutions: I could use a microcontroller and MP3 codec chip or hack the firmware of a store bought MP3 player. Ultimately I decided to use a raspberry pi with a software based MP3 codec. At $50 for the RPi and an 8Gb flash card it cost less than buying an MP3 player or the components required to build one from scratch. Note regarding Rpi audio DAC. I have seen numerous sources claiming that the RPi's internal audio DAC is of such low quality it should not be used to play music. This is not true. The Rpi has an eleven bit PWM based DAC, which is comparable to the original line of ipods. The reason for its poor reputation is a hardware quirk not enough people are aware of: Most audio DACs have a secondary volume control stage. Audio data is fed into the DAC at 100% volume, then the output of the DAC is cut down by the volume stage. The Rpi does not use a secondary volume stage due to its inexpensive simplified design. If the volume is set to 25% (the default for some OSs) the audio drivers will divide data by four before sending it to the DAC. This means the two most significant bits of the data stream are always going to be zero. This turns the RPi's 11-bit DAC into a 9-bit DAC that sounds terrible. People encountering this problem typically solve it by adding an external USB audio DAC rather than investigating the problem. ArchArmLinux For this project I decided to use ArchLinuxARM. The selling point of this OSs is that it can boot up in under six seconds due to its minimalist design. This is a very important feature because I wanted to avoid a lengthy delay between hitting the project's power button and a song starting. To further improve startup time I used an 8gb Class 10 (high speed) SD card. ArchLinuxARM is only 2gb, so a 4gb SD card is an option, but this will leave space for only about 100 MP3 files. Someone wanting to use this project with a very large MP3 collection should consider using a 16gb or 32gb SD card.

Archlinux Setup: Required equipment: An SD card interface for your computer an SD card (recommended 8gb Class 10). An Ethernet router or hub. Ethernet cable to connect RPi to hub First follow the installation instructions listed here: archlinuxarm.org/platforms/armv6/raspberry-pi. Use the default root username or your filesystem will not match the one presented in this tutorial. Archlinux runs an SSH server by default. This will allow you to control thr RPi through an Ethernet network instead of a monitor and keyboard connected directly to it. The RPi's IP address is assigned through DHCP. You can discover it by logging in directly (keyboard and monitor to the RPi), then entering arp -a. I prefer to use a program called Angry IP Port Scanner (angryip.org) to search my network for the RPi. I know the RPi is 192.168.15.4 because there are only three machines on my network. 192.168.15.1 is the router, 192.168.15.2 is my PC.

Once the Rpi is located download Putty (chiark.greenend.org.uk/~sgtatham/putty) and use its SSH server to connect to the RPi's IP. Installing Libraries Download and install Python2: sudo pacman -S python2 Download and install Rpi GPIO library: sudo pacman -U http://myplugbox.com/raspberry-gpio-python-0.4.1a-1-any.pkg.tar.xz Download and install Mutagen MP3 library: sudo pacman -U https://bitbucket.org/lazka/mutagen/downloads/mutagen-1.23.tar.gz

Installing FTP server. Next we are going to create an FTP server using VSFTP. This will allow MP3 files and python scripts to be transferred to the Rpi. Enter sudo pacman -S vsftpd. Enter Y when the package manager asks you to confirm the install. Next modify the configuration file to allow remote users write permission. Enter sudo nano /etc/vsftpd.conf and modify the file to match the following screenshot. Use ctr-o to save the file, then set the VSFTP to launch on startup with the command sudo systemctl enable vsftpd.service. Reboot the Rpi to activate VSFTP. You can now connect to the Rpi through Filezilla Client (filezilla-project.org).

Adding the Python project. Using filezilla create the folder env_python in /usr/bin. You can also do this using the mkdir command from the SSH terminal. FTP the following files into env_python: Adafruit_CharLCD.py, CartBikeControl.py, button-1.mp3. Adafruit_CharLCD_dual.py is a modified version of the Adafruit LCD library capable of running two LCDs in parallel. CartbikeControl.py is the main script. button-1.mp3 is a simple beeping sound used to indicate a successful startup. (source: SoundJay.com)

Adding the MP3 files. Within the env_python directory create a directory named mp3. FTP your MP3 files into this directory. Make sure the MP3 filenames do not contain spaces or slashes. Linux does not handle those well. l

Adding Startup script for CartBikeControl.py: The following command will create a new startup script file and open it for editing: sudo nano /etc/systemd/cartbike.service Copy the following text into the contents of the file: [Unit] Description=Launches cartbike python script After=syslog.target network.target [Service] Type=simple ExecStart=/usr/bin/python2 /usr/bin/env_python/cartbikecontrol.py RemainAfterExit=yes [Install] WantedBy=multi-user.target Save the file with ctrl-o then exit nano with ctrl-x. Enable the script file with the following command: systemctl enable /etc/systemd/cartbike.service Reboot the Rpi and you should first hear the button-1.mp3 sound effect, then each of your mp3 files played in alphabetical order.

Adding button matrix: The button matrix allows you to control the volume and song number of the MP3 files. The pattern number deals with what pattern external lighting equipment uses, and will not be discussed here. The buttons are connected to the Rpi through a matrix, because this allows 9 buttons to occupy only six GPIO pins. An additional row or column of buttons can be added with only the cost of 1 more input button. I tried to keep a consistent pattern when assigning buttons to functions. The top row are red pushbuttons which increment a variable. The middle row are black pushbuttons which decrement a variable. The bottom row are toggles which enable some option like cycling through songs randomly instead of sequentially.

Adding LCD Output. I had a pair of 16x2 GDM1602K LCDs in my junk drawer, and decided to add them to the jukebox. They display system status, song genre, artist name, and album name on each of the four lines. Genre, artist, and album are extracted from Mp3 ID3 tags. Adafruit provides a very good GDM1602K python library, however I wanted to run two LCDs in parallel. This means making some minor modifications to the adafruit library. The circuit is shown below. The data and RS wires of each LCD are connected together. Each enable (E) pin is connected to an independent Rpi GPIO output, which allows data to be addressed to each of them individually.

Adding USB display board. The USB display board is created with a PIC18F2550. This chip has an internal USB transceiver. Since this was a one-off project I mostly used previously designed breakout boards. I print my boards using only a single layer of copper. This unfortunately means there is a very large number of jumper wires connecting everything. Provided with this project are four PCB files: 4X transistor, 8x transistor, 15F4550BreakoutBoard, LedPanel. There is a.brd file and a.tap file included for both of them. The.tap file is G-code deaisned to be read by routing software like Mach4. The.brd file is an Eagle board file, however these are not designed like regular eagle PCB files. I directly specify the cuts that need to be made in the copper layer rather than dealing with pour layers. Keep this in mind if you are generating your own Gcode or toner transfer sheets. The DisplayBoardAssemblyDiagram.png explains how to solder components onto the PCBs, and how to connect them together. The parts list is as follows: Part QTY LED 5MM Green 3v, 20mA 128 PIC18F2550 SOIC 1 7-segment LED Display. 0.56 Common Anode 8 16 74HC164 SOIC 6 6 2N3906 TO-92 12 USB Type A plug/cable 1 1k resistor 12 10k resistor 1 20Mhz Xtal 1 470 nf ceramic capacitor 2 22pf ceramic capacitor 2

Assembled USB display Board (Back) Assembled USB display Board (Front)

Installing PIC firmware. After assembling the PIC18F2550 breakout board you will need a PIC programmer such as the PICKIT2 to download the firmware. The PIC programming port is indicated in DisplayBoardAssemblyDiagram.png. Compile the source code with MCC18. The source code is based on the Vellaman USB sample program.