Introduction: TV REMOTE CONTROLLABLE COMPUTER MP3 PLAYER USING ARDUINO AND PROCESSING

Picture of TV REMOTE CONTROLLABLE COMPUTER MP3 PLAYER USING ARDUINO AND PROCESSING

Hello every one . here I show my project TV remote controllable computer MP3 player using processing software and arduino board. This project idea is based on controlling computer using TV remote control. In this project I created custom MP3 player using processing software . and I programmed the arduino board to decode the IR remote control signal and communicate with processing custom mp3 player using serial communication. So by using this project I can play , pause the player song and also change the song forward and backward direction using my IR remote control. lets start building the project.

Step 1: WATCH THE VIDEO

Step 2: HARDWARE AND SOFTWARE REQUIEMENTS

Picture of HARDWARE AND SOFTWARE REQUIEMENTS

Software requirements are Arduino IDE, Processing software.

To download Arduino software visit the link bellow:

http://arduino.cc/en/Main/Software

To download Processing software visit the link bellow:

https://processing.org/download/?processing

To download complete project code click the rar file bellow:

Step 3: SELECT THE REMOTE

Picture of SELECT THE REMOTE
  • Take any ir remote control.
  • Select the any four button for four option of control like shown in the above image.
  • Then connect the IR receiver to the Arduino board As shown in the image.
  • Then copy the bellow code to find the Selected four buttons Hex code for use in the project.
  • Paste the code in arduino software and upload it to arduino.
  • Then open serial monitor and press the button selected in the remote pointing towards ir receiver in arduino then the hex code of the button will be shown in the Serial monitor like the above image.
  • Remember the the hex code like rounded codes in the image for further use . note the four button code separately.

#include<IRremote.h>

int RECV_PIN = 11;

int POWER_PIN = 9;

int GROUND_PIN = 10;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

{

Serial.begin(9600);

irrecv.enableIRIn();

pinMode(POWER_PIN,OUTPUT);

pinMode(GROUND_PIN,OUTPUT);

digitalWrite(POWER_PIN,HIGH);

digitalWrite(GROUND_PIN,LOW);

}

void loop() {

if (irrecv.decode(&results)) {

Serial.println(results.value, HEX);

irrecv.resume();

}

}

Note: This code is not the project code. it is just to find the selected four buttons hex code.

Step 4: PREPARING THE ARDUNO

Picture of PREPARING THE ARDUNO

    In this project the arduino act as ir signal finder and send the appropriate command to processing software using serial communication.

  • Connect the IR receiver to the arduino board as shown in the above image.
  • Then download the project code available in the hardware and software requirement section in above.
  • or copy the bellow arduino code. and paste it in arduino software.
  • compile the code and upload it to arduino board.
  • And stay connect with the computer for control the processing mp3 player mp3 player.

Ardunio code:

#include<IRremote.h>

int count = 1;

int RECV_PIN = 11;

int power = 9;

int gnd = 10;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()

{

Serial.begin(9600);

pinMode(power,OUTPUT);

pinMode(gnd,OUTPUT);

digitalWrite(power,HIGH);

digitalWrite(gnd,LOW);

irrecv.enableIRIn();

}

void loop() {

if (irrecv.decode(&results)) {

irrecv.resume();

if (results.value == 0xFF7A85){ /* replace the under lined code with the your remote pause button code in above step*/

Serial.write('a');

}else if(results.value ==0xFFBA45){

/* replace the under lined code with the your remote play button code in above step*/

Serial.write('b');

} else if(results.value ==0xFFDA25){

/* replace the under lined code with the your remote changing song forward button code in above step*/

count = count +1;

Serial.write(count);

} else if(results.value ==0xFFFA05){

/* replace the under lined code with the your remote changing song backward button code in above step*/

count = count-1;

Serial.write(count);

}

}

}

Step 5: CREATING CUSTOM MP3 PLAYER USING PROCESSING

Picture of CREATING CUSTOM MP3 PLAYER USING PROCESSING

Download the processing code bellow given irmp3.rar for this project. In this project i created the ir responsible mp3 player using processing software. i created this program by combining the serial library and audio library in processing.In this project i created player using processing that only can read 50 song in the data folder. In future update of this project i will create more user friendly player.If you want to add more than 50 songs to the player then follow the last step of this instructable.

  • After downloading the rar file extract the file there you can see that data folder.
  • just copy and paste your 50 favorite songs in data folder.
  • and rename all songs name from 1,2,3,...and so on to 50.
  • then only the player read the songs in the data folder.
  • now open the processing file irmp3 in folder.
  • And only one change you have to do in processing code is that you have to change the COM port number in the coding (you can see it above image) to which port your ardunio board is connected to computer.
  • In my case the ardunio board is connected with laptop in COM31. for others it may vary like COM14,COM13,etc.
  • Change the COM port number and save the code and run the code by clicking triangle button in it.
  • now the song will be played in the player.
  • Use the selected four buttons in your remote to pause the song and play it and for changing the song in player by pointing the remote to their receiver in the arduino board.
  • the output setup shown in the above image.
  • then close the player application.
  • and follow the next step to make the player as easy runnable file.

Step 6: CREATING RUNNABLE EXE FILE FOR OUR PLAYER

Note:watch the video int the watch video step to better understand this step.

  • Now open the irmp3 processing file .
  • In processing software you can see that Right towards arrow mark .
  • click it to export our processing program as runnable .exe application.
  • once you click it new window will be pop up.
  • this window is for select the OS you want create runnable .
  • Select the os and click ok.
  • then visit the project saved folder .There is a new application folder will be created.
  • open it there you will see a irmp3.exe file.
  • create the short cut of irmp3.exe for easy use of running our player.
  • Now we created our 50 songs custom ir controllable mp3 player.
  • if we want to play this player just click the irmp3.exe file desktop and take the remote and goto do your work and control the player using remote.
  • if you want to close the player just press ESC button in keyboard.

Step 7: OUTPUT

watch the simple output video above.The output of this project the player works fine. only draw back is that if a song over it can't automatically change to next song. we need to change song from our remote. This project Now i developing the advanced features . so i will over come this draw back in my next update.

Step 8: ADDING MORE THAN 50 SONGS TO OUR CUSTOM PLAYER

Picture of ADDING MORE THAN 50 SONGS TO OUR CUSTOM PLAYER

if we want to add more than 50 songs to the our custom player then we need to add three things in coding in the places shown in the above images.

open irmp3.pde processing file.

then do the following changes

change 1:

In first image place in processing coding.

add coding like that

Minim minim51;

Minim minim52;

.

.

Minim minim100;

change 2:

In second image place in processing coding

add coding like that

minim51 = new Minim(this);

minim52 = new Minim(this);

.

.

minim100 = new Minim(this);

Change 3:

In third image place in processing coding

add coding like that

else if(val == 51){
player.pause();

player = minim51.loadFile("51.mp3");

player.play();

}

else if(val == 52){
player.pause(); player = minim52.loadFile("52.mp3"); player.play();

}

.

.

.

else if(val == 100){
player.pause(); player = minim100.loadFile("100.mp3"); player.play();

}

finally add another 50 songs to the data folder then rename it to 51 to 100. then run the processing code and make it as runnable exe file.

Thank you for watching

Comments

MátéP made it! (author)2015-11-14

Working =D

stephanieyabes (author)2015-08-17

hi why do i always get this error upon compilation:

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino Nano, ATmega328"

E:\Program Files\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope
int RECV_PIN = TKD2; // the pin the IR receiver is connected to
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

thank you

anurags (author)2014-08-29

seamster (author)2014-08-28

Cool!

vigneshraja (author)seamster2014-08-28

Thank you

About This Instructable

2,811views

21favorites

License:

More by vigneshraja:Speed control of dc motor from laptop using arduino and processingProgram Arduino Pro Mini Using Arduino UnoTouch switch for MSP430 launchpad
Add instructable to: