| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

Final Project EE47 (1)

Page history last edited by Thomas Che 4 years, 11 months ago

Thomas Che

EE47 Final Project Documentation – BOOMBOX mini

Design Vision/Point of View:

My design was created based on the fact that size would amount to the time it would take to create it. So I thought of a player of music that would be excusable for the size it might become, so I immediately was draw to a Boom box. With this idea and the parts I had, I imagined a miniature sized boom box of which I could hook onto my backpack or onto my belt loop, and still be able to blast music at its loudest. The idea was to make a more portable version of a Boom box that allowed to download any music you wanted into it, without the necessity of CD’s or cassettes, and you could also plug in headphones or ear buds in to listen to the music yourself!

I envisioned the Boom box mini with the classic two loudspeakers with a display in the middle that would display the selected song. There would also be a large button of which to play and stop the song, an encoder which would scroll through the songs, and a potentiometer that could adjust the volume.

BOOMBOX mini Preliminary Plan (Right):

BOOMBOX mini paper Prototype (Left):

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Components Necessary:

  • Arduino Micro

  • VS1053 MP3/MIDI decoder

  • Stereo 2.8W Class D Audio Amplifier

  • 2: 3” Diameter (8 olm, 1 watt)

  • LED Illuminated Pushbutton 30mm Square

  • Rotary Encoder

  • 10K potentiometer

  • Breadboard

  • Micro SD Card

  • Standard LED

Process:

Because the week leading up to the final presentation was Finals week, the process of constructing my project was very hectic. On Monday, I focused on building the face of the Boom box using the laser cutting in Room 36, and I completed the face as planned. On Tuesday I was busy with Finals from another class, and on Wednesday was spent in vain trying to utilize another mp3 decoder that I bought from Adafruit. When I realized that it was not working out I spent Thursday rewiring the previous mp3 circuit that we learned in lab 6, and wired up the loudspeakers to the amplifier to the mp3. On Friday, I managed to get the Play and Pause button working. However, I did not managed my time wisely and I didn’t not get to the other functions of the BOOMBOX mini that I wanted to implement such as the display, the song selector, and the volume knob. I decided to focus on the basic parts of the mp3 such as getting it to play music in the first play and controller when to play the music.

Project Code:

// ---- includes and defines ------------------------------------------------

 

const int ledPin = 9;

#include <SD.h>

#include <SPI.h>

#include <EEPROM.h>

#include <mp3.h>

#include <mp3conf.h>

#include <Adafruit_GFX.h>

#include <Adafruit_PCD8544.h>

#define sd_cs 17

#define mp3_cs A0

#define mp3_dcs A1

#define mp3_rst -1

#define mp3_dreq A2

#define lcd_dc A4

#define lcd_cs A3

#define lcd_rst -1

#define read_buffer 512

#define mp3_vol 254

#define max_name_len 13

#define max_num_songs 40

#define max_title_len 60

 

// ---- global variables ----------------------------------------------------

 

Adafruit_PCD8544 lcd = Adafruit_PCD8544(lcd_dc, lcd_cs, lcd_rst);

 

 

File sd_file;

 

unsigned char num_songs = 0, current_song = 0;

 

char fn[max_name_len];

 

char title[max_title_len + 1];

 

enum state { DIR_PLAY, MP3_PLAY, PAUSED };

state current_state = PAUSED;

 

//---- module functions -----------------------------------------------------

 

void pause() {

if (current_state != PAUSED) {

current_state = PAUSED;

}

else {

current_state = DIR_PLAY;

}

}

 

void my_interrupt_handler() {

static unsigned long last_interrupt_time = 0;

unsigned long interrupt_time = millis();

if (interrupt_time - last_interrupt_time > 200) {

pause();

}

last_interrupt_time = interrupt_time;

}

 

void sd_file_open() {

get_current_song_as_fn();

sd_file = SD.open(fn, FILE_READ);

print_title_to_lcd();

}

 

void mp3_play() {

unsigned char bytes[read_buffer];

unsigned int bytes_to_read;

bytes_to_read = sd_file.read(bytes, read_buffer);

Mp3.play(bytes, bytes_to_read);

if (bytes_to_read < read_buffer) {

sd_file.close();

if (current_state == MP3_PLAY) {

current_state == PAUSED;

}

}

}

void dir_play() {

if (sd_file) {

mp3_play();

}

else {

if (current_song < (num_songs - 1)) {

current_song++;

sd_file_open();

}

else {

current_state = PAUSED;

}

}

}

 

// ---- setup and loop ------------------------------------------------------

 

void setup() {

pinMode(ledPin, OUTPUT);

lcd.begin(55);

lcd.display();

delay(500);

lcd.clearDisplay();

lcd.print("Barebones Mp3!");

lcd.display();

delay(500);

Mp3.begin(mp3_cs, mp3_dcs, mp3_rst, mp3_dreq);

Mp3.volume(mp3_vol);

sd_card_setup();

sd_dir_setup();

sd_file_open();

}

 

void loop() {

digitalWrite(ledPin, HIGH);

if(digitalRead(3) == LOW) {

my_interrupt_handler();

}

switch(current_state) {

case DIR_PLAY:

dir_play();

break;

case MP3_PLAY:

mp3_play();

break;

case PAUSED:

break;

}

}

Video of Final Project:

https://www.youtube.com/watch?v=catCrEWisWQ&feature=youtu.be

Comments (1)

David S said

at 1:32 pm on Aug 18, 2015

We like your direct, personal point of view, and that your project suits it quite nicely.

Your preliminary plan is quite detailed, and lays out a good agenda for where you expected the development process to go. We appreciate your including a description of the design challenges that you faced, and, are disappointed that you weren’t able to make the Adafruit player cooperate with the rest of your project. Do you think that it was a circuit/wiring issue, or was the software you used perhaps incompatible with other libraries? Did you use Adafruit’s MP3 library, or the EE47 MP3 library and player code?

Your paper prototype design is nicely made, and we like that it’s drawn to scale. We wish that it was an actual 3d paper model, rather than a concept sketch, so that someone could test out the interface, and maybe give you feedback on its usability. Perhaps it would be better to rename the prototype as a sketch.

Especially given the quality of the preceding sketches, we would also like to have seen a Verplank diagram describing the project’s overall design, and a state diagram of its operation (which we expect would be rather similar to that described in class for the barebones MP3 player, but welcome just the same).

We also wish that you had fabricated sides and a back, so that once you got home, you could complete the housing. As it is now, you can’t really leave it on a shelf, or move it around, safely.

f you do get a chance to complete the project, we would love to see a photo or video of it in use and on the move. We hope that you have a great year!

David, Dongao, Praveen, Samyuktha, Tian, Xiangyu, Zahra

You don't have permission to comment on this page.