Difference between revisions of "Music Shield for Arduino"

From LinkSprite Playgound
Jump to: navigation, search
(Usage)
(Software Installation)
 
(16 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Introduction  ==
 
== Introduction  ==
  
The Music Shield is a professional audio codec.It can work with Arduino, Seeeduino, Seeeduino Mega and Arduino Mega. It is based on VS1053b IC, and can play a variety of music formats stored on MicroSD cards with Seeed the provided Arduino Library.<br>
+
The Music Shield is a professional audio codec.It can work with Arduino, Arduino Mega and pcDuino. It is based on VS1053b IC, and can play a variety of music formats stored on MicroSD cards with the provided Arduino Library.<br>
  
Note:Recording is only supported on Seeeduino Mega and Arduino Mega for now.  
+
Note:Recording is only supported on Arduino Mega for now.  
 +
 
 +
[[File:N99DG WITHOUT PACKAGED FRONT.jpg | 640px]]
 +
 
 +
[[File:N99DG WITHOUT PACKAGED BACK.jpg|640px]]
  
[[Image:Musicshieldnew500.jpg]]
 
  
 
== Features  ==
 
== Features  ==
  
*Arduino,Seeeduino, Arduino Mega, and Seeeduino Mega compatible  
+
*Arduino, Arduino Mega, and pcDuino compatible  
 
*2 control-push buttons and 1 knob switch  
 
*2 control-push buttons and 1 knob switch  
 
*Plays music from micro SD cards Decodes:MP3,WAV,MIDI,Ogg Vorbis  
 
*Plays music from micro SD cards Decodes:MP3,WAV,MIDI,Ogg Vorbis  
Line 15: Line 18:
 
*Headphone/Line Out for playback  
 
*Headphone/Line Out for playback  
 
*Line In for recording in OGG format  
 
*Line In for recording in OGG format  
*Excellent sound quality with ±1dB Frequency Response  
+
*Excellent sound quality with ±1dB Frequency Response
*FCC verification
 
  
 
== Specification  ==
 
== Specification  ==
Line 101: Line 103:
 
== Interface Function  ==
 
== Interface Function  ==
  
[[Image:MusicShield-hard.jpg|507px|MusicShield-hard.jpg]]  
+
[[Image:MusicShield-hard.jpg|507px|MusicShield-hard.jpg | 400px]]  
  
 
'''Multifunction button''': Turn left to play previous song, and right to next song, while pressing it down to pause and resume.<br>'''Volume indicator LED (RED)''': If volume+, the red LED will be brighter.<br>'''Play/Pause indicator LED (GREEN)''': If playing, the green LED blinks.<br>'''Line out''' can drive 16 ohm or 32 ohm earphone.<br>'''Line in''' is used to record audio from other resources.<br>'''Micro SD card''' can be FAT16 or FAT32, and the size more than 2GB is not supported.<br>'''I2S and GPIO''' are for digital audio output.<br>'''ISP interface''' is kept for bringing SPI port when using with Mega.<br>
 
'''Multifunction button''': Turn left to play previous song, and right to next song, while pressing it down to pause and resume.<br>'''Volume indicator LED (RED)''': If volume+, the red LED will be brighter.<br>'''Play/Pause indicator LED (GREEN)''': If playing, the green LED blinks.<br>'''Line out''' can drive 16 ohm or 32 ohm earphone.<br>'''Line in''' is used to record audio from other resources.<br>'''Micro SD card''' can be FAT16 or FAT32, and the size more than 2GB is not supported.<br>'''I2S and GPIO''' are for digital audio output.<br>'''ISP interface''' is kept for bringing SPI port when using with Mega.<br>
Line 117: Line 119:
 
=== Hardware Installation  ===
 
=== Hardware Installation  ===
  
Insert the Micro SD card and the earphone; Plug the Music Shield onto the Arduino/Seeeduino; Connect the board to PC using USB cable. [[Image:MusicInstall.jpg]]<br>
+
Insert the Micro SD card and the earphone; Plug the Music Shield onto the Arduino; Connect the board to PC using USB cable.  
 +
 
 +
[[Image:MusicInstall.jpg]]<br>
  
 
=== Software Installation  ===
 
=== Software Installation  ===
 +
 +
 +
New code by [http://www.amazon.com/gp/pdp/profile/ASEV3UG6XKYM4/ref=cm_cd_alppdp Mr Roberts]:
 +
#github. com/jtroberts83/Linksprite-MP3-IR-Remote-Controlled (This version allows for remote control)
 +
#github. com/jtroberts83/Linksprite-MP3-Sheild-Arduino (This is the normal version fixed and working)
  
 
'''Play music:'''  
 
'''Play music:'''  
Line 144: Line 153:
  
 
#Make sure there are songs in the micro sd card.  
 
#Make sure there are songs in the micro sd card.  
#Download [[Image:MusicPlayer v1 7.zip]] and [http://www.seeedstudio.com/wiki/File:Demo1_Fat16.zip Fat16]for music shield.  
+
#Download [https://s3.amazonaws.com/linksprite/Shields/music+_shield/MusicPlayer_v1_7(1).zip MusicPlayer v1 7] and [https://s3.amazonaws.com/linksprite/Shields/music+_shield/Demo1_Fat16.zip Fat16]for music shield.  
 
#Uncompress the package and put it in Arduino-1.0 program: ..\arduino-1.0\libraries  
 
#Uncompress the package and put it in Arduino-1.0 program: ..\arduino-1.0\libraries  
 
#Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.  
 
#Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.  
#'''[Ignore this if under Linux]''' Download a new [http://code.google.com/p/musicshield/downloads/detail?name=portpins.h&can=2&q= portpins.h] file and replace the default portpins.h file of Arduino-1.0 program: ..\arduino-1.0\hardware\tools\avr\avr\include\avr  
+
#'''[Ignore this if under Linux]''' Download a new [https://s3.amazonaws.com/linksprite/Shields/music+_shield/portpins.h portpins.h] file and replace the default portpins.h file of Arduino-1.0 program: ..\arduino-1.0\hardware\tools\avr\avr\include\avr  
 
#Run the arduino program compile and upload the sketch of music_v1_2 -&gt; musicPlayAll into Arduino board.
 
#Run the arduino program compile and upload the sketch of music_v1_2 -&gt; musicPlayAll into Arduino board.
  
Line 153: Line 162:
  
 
*'''Demo 2: Use Fat16 library'''   
 
*'''Demo 2: Use Fat16 library'''   
This demo will use an open source library [http://www.seeedstudio.com/wiki/File:Music_Shield_Demo_2_Library.zip Music_Shield_Demo_2_Library]. There are two sketches in this demo: Using MusicPlayRandomly sketch, you can make the music play randomly.And using MusicPlayWithName, you can specify which song to be played by name.('''Note: The demo can't co-exist with demo 1 in the libraries''')<br>
+
This demo will use an open source library [https://s3.amazonaws.com/linksprite/Shields/music+_shield/Music_Shield_Demo_2_Library(1).zip Music_Shield_Demo_2_Library]. There are two sketches in this demo: Using MusicPlayRandomly sketch, you can make the music play randomly.And using MusicPlayWithName, you can specify which song to be played by name.('''Note: The demo can't co-exist with demo 1 in the libraries''')<br>
  
 
#Make sure there are songs in the micro sd card.  
 
#Make sure there are songs in the micro sd card.  
#Download  [http://www.seeedstudio.com/wiki/File:Music_Shield_Demo_2_Library.zip Music_Shield_Demo_2_Library]for music shield.  
+
#Download  [https://s3.amazonaws.com/linksprite/Shields/music+_shield/Music_Shield_Demo_2_Library(1).zip Music_Shield_Demo_2_Library]for music shield.  
 
#'''[Under Linux]''' Copy libraries/Fat16/Fat16util.h to libraries/Fat16/Fat16Util.h (note util vs Util). The includes have the wrong case and this is easiest workaround.  
 
#'''[Under Linux]''' Copy libraries/Fat16/Fat16util.h to libraries/Fat16/Fat16Util.h (note util vs Util). The includes have the wrong case and this is easiest workaround.  
 
#Uncompress these two packages and put them in Arduino-1.0 program: ..\arduino-1.0\libraries  
 
#Uncompress these two packages and put them in Arduino-1.0 program: ..\arduino-1.0\libraries  
 
#Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.  
 
#Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.  
#'''[Ignore this if under Linux]''' Download a new [http://code.google.com/p/musicshield/downloads/detail?name=portpins.h&can=2&q= portpins.h] file and replace the default portpins.h file of Arduino-1.0 program: ..\arduino-1.0\hardware\tools\avr\avr\include\avr  
+
#'''[Ignore this if under Linux]''' Download a new [https://s3.amazonaws.com/linksprite/Shields/music+_shield/portpins.h portpins.h] file and replace the default portpins.h file of Arduino-1.0 program: ..\arduino-1.0\hardware\tools\avr\avr\include\avr  
 
#Run the arduino program compile and upload the sketch of MusicShieldNewSdLib into Arduino board.
 
#Run the arduino program compile and upload the sketch of MusicShieldNewSdLib into Arduino board.
  
 
== Resources  ==
 
== Resources  ==
 +
*[https://s3.amazonaws.com/linksprite/Shields/music+_shield/MusicShielEagleFiles.zip Music Shield Eagle Files]
 +
*[https://s3.amazonaws.com/linksprite/Shields/music+_shield/Music_Shield.pdf Music Shield Schematic.pdf]
 +
*[https://s3.amazonaws.com/linksprite/Shields/music+_shield/Music_v1_14+(1).zip Music Shield Source code file for Arduino 0022]
 +
*[http://learn.linksprite.com/arduino/shields/music-shield-for-arduino/ Tutorial of Music shield for Arduino]
 +
 +
==How to buy==
 +
Here to buy Music Shield for Arduino on [http://store.linksprite.com/music-mp3-shield/ store]

Latest revision as of 01:08, 11 March 2016

Introduction

The Music Shield is a professional audio codec.It can work with Arduino, Arduino Mega and pcDuino. It is based on VS1053b IC, and can play a variety of music formats stored on MicroSD cards with the provided Arduino Library.

Note:Recording is only supported on Arduino Mega for now.

N99DG WITHOUT PACKAGED FRONT.jpg

N99DG WITHOUT PACKAGED BACK.jpg


Features

  • Arduino, Arduino Mega, and pcDuino compatible
  • 2 control-push buttons and 1 knob switch
  • Plays music from micro SD cards Decodes:MP3,WAV,MIDI,Ogg Vorbis
  • I2S interface for external DAC
  • Headphone/Line Out for playback
  • Line In for recording in OGG format
  • Excellent sound quality with ±1dB Frequency Response

Specification

Item Min Typical Max Unit
Voltage 4.5 5 5.5 VDC
Current / / 70 mA
Output S/N Ratio (With A-Weighting) / 60 / dB
Channel Isolation (With A-Weighting) / 50 / dB
Frequency Response -1 / 1 dB
Signal Distortion / / 0.5% /
Maximum output(each channel with 16 ohm load) 500 / / mV
Audio Interface 3.5mm Audio Jack /
Supporting Format MP3, WAV, MIDI, Ogg /
Supported SD Card Micro SD Card /
ESD contact discharge ±4 KV
ESD air discharge ±8 /
Dimension 80.4x52.5x13.9 mm
Net Weight 11±2 g

Interface Function

MusicShield-hard.jpg

Multifunction button: Turn left to play previous song, and right to next song, while pressing it down to pause and resume.
Volume indicator LED (RED): If volume+, the red LED will be brighter.
Play/Pause indicator LED (GREEN): If playing, the green LED blinks.
Line out can drive 16 ohm or 32 ohm earphone.
Line in is used to record audio from other resources.
Micro SD card can be FAT16 or FAT32, and the size more than 2GB is not supported.
I2S and GPIO are for digital audio output.
ISP interface is kept for bringing SPI port when using with Mega.

Pins usage on Arduino

D0 - Unused.
D1 - Unused.
D2 - Used for receiving signal from iPod dock(could be used for your own application if iPod dock is not used).
D3 - Used for receiving signal from button for Volume Up(could be used for your own application if the switch is not used).
D4 - Used for receiving signal from switch for Next Song function(could be used for your own application if the switch is not used).
D5 - Used for receive signal from switch for Play&Stop and Record function(could be used for your own application if the switch is not used).
D6 - Used for receive signal from switch for Previous Song function(could be used for your own application if the switch is not used).
D7 - Used for receiving signal from button for Volume Down(could be used for your own application if the switch is not used).

D8 - Used for Green Led instructions(could be used for your own application if the switch is not used).
D9 - Used for Red Led instructions(could be used for your own application if the switch is not used).
D10 - Used for SPI Chip Select.
D11 - Used for SPI MOSI.
D12 - Used for SPI MISO.
D13 - Used for SPI SCK.

D14(A0) - Used for Reset of VS1053.
D15(A1) - Used for Data Require of VS1053.
D16(A2) - Used for Data Select of VS1053.
D17(A3) - Used for Chip Select of VS1053.
D18(A4) - Unused.
D19(A5) - Unused.

Usage

Hardware Installation

Insert the Micro SD card and the earphone; Plug the Music Shield onto the Arduino; Connect the board to PC using USB cable.

MusicInstall.jpg

Software Installation

New code by Mr Roberts:

  1. github. com/jtroberts83/Linksprite-MP3-IR-Remote-Controlled (This version allows for remote control)
  2. github. com/jtroberts83/Linksprite-MP3-Sheild-Arduino (This is the normal version fixed and working)

Play music:

  1. Make sure there are songs in the micro sd card.
  2. Download Music v1 14 and NewSoftSerial for music shield.
  3. Uncompress these two packages and put them in Arduino-0022 program: ..\arduino-0022\libraries
  4. [Ignore this if under Linux] Download a new portpins.h file and replace the default portpins.h file of Arduino-0022 program: ..\arduino-0022\hardware\tools\avr\avr\include\avr
  5. Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.
  6. Run the arduino program compile and upload the sketch of music_v1_14 -> music into Arduino board.
  7. Just enjoy.

Record music:(Only support ATmega1280 and ATmega2560 based board)

  1. Press play/stop knob before pressing the RESET button of Arduino.
  2. Release RESET button for a second and then release play/stop knob. When the music shield is beginning to record, the green and red LEDs will blink synchronous.
  3. Press play/stop knob will stop recording.

For Arduino 1.0:
Attention Please:The library of Fat16 between demo-1 and demo-2 is different,so please confirm that you download a corresponding library when using the two demos.And the two libraries can not existed together,so delete a one before using the other.

  • Demo 1: Use SD library

This demo will use the SD library coming with Arduino 1.0.

  1. Make sure there are songs in the micro sd card.
  2. Download MusicPlayer v1 7 and Fat16for music shield.
  3. Uncompress the package and put it in Arduino-1.0 program: ..\arduino-1.0\libraries
  4. Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.
  5. [Ignore this if under Linux] Download a new portpins.h file and replace the default portpins.h file of Arduino-1.0 program: ..\arduino-1.0\hardware\tools\avr\avr\include\avr
  6. Run the arduino program compile and upload the sketch of music_v1_2 -> musicPlayAll into Arduino board.


  • Demo 2: Use Fat16 library

This demo will use an open source library Music_Shield_Demo_2_Library. There are two sketches in this demo: Using MusicPlayRandomly sketch, you can make the music play randomly.And using MusicPlayWithName, you can specify which song to be played by name.(Note: The demo can't co-exist with demo 1 in the libraries)

  1. Make sure there are songs in the micro sd card.
  2. Download Music_Shield_Demo_2_Libraryfor music shield.
  3. [Under Linux] Copy libraries/Fat16/Fat16util.h to libraries/Fat16/Fat16Util.h (note util vs Util). The includes have the wrong case and this is easiest workaround.
  4. Uncompress these two packages and put them in Arduino-1.0 program: ..\arduino-1.0\libraries
  5. Select the corresponding Arduino board, like Arduino UNO or Duemilanove or others.
  6. [Ignore this if under Linux] Download a new portpins.h file and replace the default portpins.h file of Arduino-1.0 program: ..\arduino-1.0\hardware\tools\avr\avr\include\avr
  7. Run the arduino program compile and upload the sketch of MusicShieldNewSdLib into Arduino board.

Resources

How to buy

Here to buy Music Shield for Arduino on store