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

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Final report

Page history last edited by SETHU KOVENDHAN BOOPATHY JEGATHAMBAL 10 years, 8 months ago

PROJECT REPORT

EE47-PRESS PLAY: INTERACTIVE DESIGN

NAME:SETHU KOVENDHAN BOOPATHY JEGATHAMBAL

ID NO:05921102

 

Project Idea:

MP3 players have blended into our lives and we always have them with us in our day to works. Project idea is to develop a Bike MP3 player that is easy to control and light weight so it can be mounted in the handle bar. Controls are also mounted into the handle so that it is easy to control. This MP3 player can be controlled using the buttons that are attached to the handle. We can pause, play, change songs with these buttons.It also has a charging point and it can be charged by bike dynamo.This makes it easy to use.

Motivation:

I took a study of people using headphone while biking and jogging.I found that it would be extremely useful if there is a MP3 player with speakers and with easy interface,which in turn reduces the risk of accidents while riding a bike.This is the motivation of my project.

Rough idea:

 

 

FUNCTIONS IMPLEMENTED:

  • Pause and Play using the same button.

  • Next song

  • Previous song

Future plans:

  • Bluetooth interface.

  • Solar charging.

  • Battery charging by Bike Dynamo.

 

Parts used:

  • Ardiuno Micro

  • IC 4050

  • Sd card

  • MP3 decoder.

  • Buttons and resistors

  • Connecting wires

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Project development stages:

Verplankā€™s Diagram:

 

Making it into Perfboard:

 

Program code:

#include <SD.h> #include <EEPROM.h>

#include <mp3.h> #include <mp3conf.h>

#include <Adafruit_GFX.h> #include <Adafruit_PCD8544.h> int pin1 = 13; volatile int state1 = LOW; /*int pin = 3; volatile int state1 = LOW; volatile int state2 = LOW;

volatile int state3=LOW;

#define sd_cs         17        // 'chip select' line for the microsd card

#define mp3_cs        A0        // 'command chip select' connect to cs pin #define mp3_dcs       A1        // 'data chip select' connect to bsync pin #define mp3_rst       -1        // 'reset' connects to decoder's reset pin #define mp3_dreq      A2        // 'data request line' connect to dreq pin

 

#define read_buffer  512        #define mp3_vol      230       

#define max_name_len  13 #define max_num_songs 40

.

#define max_title_len 60

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

File sd_file;                   // object to represent a file on a microsd

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 = DIR_PLAY; void pause_play(){   if (current_state == MP3_PLAY)   {     current_state=PAUSED;   }   else   {   current_state=MP3_PLAY;    } }

void skip_forward(){  if(current_song!=num_song-1){    Mp3.cancel_playback();    sd_file.close();    current_song++;    sd_file_open();  } } void skip_backward(){  if(current_song!=1){    Mp3.cancel_playback();    sd_file.close();    current_song--;    sd_file_open();  } }

void sd_file_open() {    // first, find the file name (that's stored in eeprom) of the current song.     get_current_song_as_fn();      sd_file = SD.open(fn, FILE_READ); }

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 we've been in the MP3_PLAY state, then we want to pause the player.

    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;     }   } }  

void setup() {    pinMode(pin1, INPUT);   attachInterrupt(0, pause_play , HIGH);

pinMode(pin2, INPUT);   attachInterrupt(0,skip_forward , HIGH);

pinMode(pin3, INPUT);   attachInterrupt(0,skip_backward , HIGH);     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() {     digitalRead(pin1, state1);

digitalRead(pin2, state2);

digitalRead(pin3, state3);   switch(current_state) {

    case DIR_PLAY:       dir_play();       break;

    case MP3_PLAY:       mp3_play();       break;

    case PAUSED:       break;   } }

Difficulties:

It is really hard to make the circuit in perfboard and also it takes too much time to do it.I crashed my laptop and it is difficult to work without it.

Final Project:

This is my final bike MP3 player.

 

http://www.youtube.com/watch?v=RC_YB9DUabc&feature=youtu.be

 

 

 

 

 

Comments (1)

kdade said

at 11:53 am on Aug 20, 2013

Dear Sethu,

We really like your point of view, because you talk about the specific need (a safe MP3 control interface for cyclists), and how you will address it. We also like your beautiful sketches in your Verplank diagram, and we like the metaphor of opening a bottle for the motion that you will use to control the volume. From a safety perspective, does twisting a knob on the handlebars seem safer than pressing a button? If so, why? We would love to read about your answers to these questions, and remember it is always great to include as much information as you can about *why* you made certain design choices in your project.

We also are impressed that in spite of your technical difficulties (with your laptop crash), you managed to get up a working rendition of your project. This is an important skill, so nice work! We wish you would have shared a little more about the specific difficulties you faced during the project, like what aspects of moving to perfboard were difficult, and any design considerations you faced while making your box. Also do you have any plans for how to reduce the size of the enclosure so it will actually fit on the handlebars of a bike? These are all great things to talk about in your report!

Overall, we love the concept, and we really like the idea of bringing safer, easier devices to everyday situations. Great work this quarter!

Best,
Kevin, David, Jessica, Vivien, Matt

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