This is an Arduino based iPod hack audio project that allows you to select tracks for playback from an attached iPod Touch simply by placing cards on flat upper surface of the machine:
The cards can be placed in small plastic boxes with a picture of the album cover on one side to make small blocks more suitable for small hands to manipulate. Originally designed for disabled child. Since then people, teachers I know and so on, have been urging me to "do something with it" so this is an easier to set up and use quasi "tablet" version.
Much improved from an older attempt to do this with; lower cost components, more compact housing and in particular better software that allows you to directly add new RFID cards without needing an attached PC as you add more music to the iPod playlist - hence the keypad.
Watch the video and what it does will all become clear.
- An iPod Touch controlled by Arduino via the serial protocol intended for use by docking stations and other peripherals.
- RFID (Radio Frequency Identification) cards are embedded in small plastic blocks with album cover art on the face of each block.
- Advanced serial mode is used, giving 2-way communication between Arduino and iPod and ability to select individual tracks by number.
- Place an RFID "block" in the centre of the top surface (or wherever you mount the wireless card reader and the selected album plays automatically, no conventional controls or menus at all.
This video shows it being used with word cards to allow playback of recorded words and phrases from the iPod Touch as communication aid or as an educational device.
This is called "Tangible computing" and allows, for example a disabled child who cannot manipulate small buttons / touchscreens on an MP3 player or use a CD player to select tracks or albums for themselves.
Also gives the user the ability to physically shuffle through a pile of cards to choose the one they want, rather like the experience of sorting through CD's or vinyl albums in case of older readers. It is all about giving control and choice back to the child.
I built a cruder version of this for my daughter over a year ago and she still uses it daily. This one is a lot more practical in terms of how you set it up.
How does it work?
The cards all have an individual unique code number from the factory so when "paired" with a certain track in the iPod playlist of songs, it will always select that track when placed on the top surface of the device. The cards, known as RFID cards, are read wirelessly by a reader hidden inside the machine.
The cards can be placed in small plastic blocks with a picture on the outside as I tend to do, or soft toys, or anything your imagination can come up with.
The idea with this machine was something like a thick iPad that would be portable and could be placed on a table.
- It allows you to go into a "setup" mode where you can pair new blank RFID cards with songs in the playlist. The Arduino remembers this pairing the next time it is switched on as the details are retained in a portion of the memory called EEPROM.
- This means instead of me adding all the track info to the Arduino code using a computer as I did before, this time you can add more music and more cards to select the tracks, as and when you want to without ever needing an attached computer. It is configured to remember up to 500 cards.
- The device will play the song you select with the RFID card, and then every song after that in the playlist. Therefore you can set each card to select the first track of an album, or if you prefer, just individual tracks.
- If each mp3 file in the playlist is a recorded word or phrase for example, it could also be used as a communication system or as a teaching aid with the RFID tags inside each of a set of word/picture cards.
NOTE: I live in the United Kingdom but for this parts list I have quoted items from US websites.
Arduino Mega 1280: $19.99 (same price as an Uno) Well known online auction site.
ID-12 RFID Reader: $29.95 from Sparkfun. https://www.sparkfun.com/products/8419
Breakout board for ID-12 RFID reader: $0.95 from Sparkfun. https://www.sparkfun.com/products/8423
Logic Level Converter: $1.95 from Sparkfun. https://www.sparkfun.com/products/8745
20 x 4 black on green LCD display: $17.95 from Sparkfun. https://www.sparkfun.com/products/256
PodBreakout plug/board: $14.95 from Sparkfun. https://www.sparkfun.com/products/8295
Membrane keypad: $3.95 from Adafruit. http://www.adafruit.com/products/419
Double 10K potentiometer (volume control): $2.95 on well known online auction site.
Single 10K potentiometer (LCD contrast control): $1.00 on well known online auction site.
Single push to make button switch (reset button): $1.00 on well known online auction site.
Stereo headphone socket, panel mount: Approx $2.50
Power supply for Arduino: Suggest 7.5V 1000mA (the 300mA ones sometimes sold for Arduinos are not enough).
Example: AC 100V-240V Converter Adapter DC 7.5V 1A Power Supply EU plug DC 5.5mm × 2.1mm: Approx $5.00
N.B. The RFID allegedly uses "a lot of power" when it is actually in "read" mode. Not sure how much this is but since I am supplying the backlight of my LCD display as well as my RFID reader with 5V power from the on-board voltage regulator on the Mega, I thought it would be best to turn the RFID off most of the time, having it "look" for a new RFID reading every few seconds instead. The Arduino runs at 5V and has an on board voltage regulator to keep everything at 5V. It will run with a DC supply of 7-12V. However at 12V it is converting a lot of that to heat, and if I am also consuming a lot of current with my peripherals, that might not be a great idea. I therefore have used a stabilised (i.e. not a really cheap thrift shop unit) 7V power supply with claimed output of up to 1.5Amps. By using a 7V supply I have enough to keep the Arduino regulator happy without generating masses of unwanted heat.
You will also need some resistors:
1 x 500,000 Ohm.
1 x 10 Ohm.
1 x 1000 Ohm (i.e. 1 K Ohm)
Optionally to make iPod charge itself from Arduino, you also need:
2 x 33k Ohm
1 x 47k Ohm
1 x 22k Ohm
This machine is designed to have an iPod attached to it.
I have tested it with an iPod Touch 4 which is a readily available current model and also an older iPodTouch 2
You also need some RFID cards. One for each of your albums (or even one per song if you prefer). Can get them on well known auction site in bulk. Make sure you have correct type - the EM4100 family, 125kHz. About $1 each, less if bought 20 or 50 at a time.
Total: Approx $100 (about GBP 67) - remember that you also need RFID cards, an iPod and a set of headphones, (and/or connection cable to a HiFi amplifier if you prefer).
Here is the main parts list with UK suppliers:
Logic level converter:
4 x 20 LCD green:
ID-12 RFID reader:
So, here's how to make one.........................
Step 1: General Layout of Parts
In the case of these photos, I just acquired a MakerBot 3D printer so was trying to print out a flat chassis to hold all the parts in a neat way. You do not have to do this at all, use any enclosure you want to.
My last machine was a small coffee table with the RFID reader just under the top surface, and a cable with the plug for the iPod hanging beneath so the iPod could be kept in a cupboard underneath.
In this photo I have glued the plug for the iPod into a plastic housing so the iPod can then slot in from the top side like a form of docking port.
I will attach the 3D print files at the end for those who are interested but I will say again, you do not have to arrange the various parts like this, I would just start with a wooden board, make life easier for yourself and spread the parts out.
The heart is an Arduino 1280. This the old version of the Arduino "Mega" and is very low cost now. I use it as it has several serial ports and loads of pins so you do not run out. Also has larger memory than the basic Arduino Uno which means it will remember more "paired" cards even when turned off.
The cards are read by a wireless reader called an ID-12 which is very reasonably priced. This reads the 10 digit unique tag number of the card. The arduino then goes through its memory to see which track of the iPod playlist this card is "paired" with. The Arduino then selects that track for playback. It does that by being connected to the iPod via a special plug called a PodBreakout plug made for hackers of Ipods etc.
The track being played is displayed on the 4 row liquid crystal (LCD) display. This display is also used when going through the setup menu to pair new cards with newly added songs or tracks in the iPod playlist.
The logic level converter is a board that converts data at 5V that the Arduino uses, to the 3V standard that the iPod uses so they can talk to each other without damaging each other.
The LED flashes each time the ID-12 attempts to read the RFID card unique number, i.e. every time it "looks" for a new card to see if it has changed.
There is a volume knob, a headphone socket, and a knob which adjusts the contrast of the LCD display.
Finally there is a reset button that restarts the Arduino when pressed.
Step 2: RFID Cards Made Into Plastic Blocks Using Business Card Holders
RFID cards have a coil of wire in them and a radio transmitter. The reader induces a current in the wire coil which then momentarily powers the radio transmitter. This sends a 10 digit code to the RFID reader (and so to the Arduino). Each card has a unique number.
Therefore the software in the Arduino can work as follows:
"If I see number XXXXXYYYYY on the RFID reader, I must instruct the iPod to start playing track number X in the playlist."
It will do this every time it sees that particular card.
Later on I will show how the numbers are discovered for each card, it is best to just write the number on the back of each one.
Each card represents the first track of each album in the playlist, and the cover art from each CD is put on the front as a label.
Here are a few spare "bricks" on the floor waiting to be chosen next!
Step 3: Making a Block With RFID Card, Cardboard and a Business Card Holder
Taped or superglued together.
Step 4: Pin Arrangement of PodBreakout Plug.
On the left is a picture of it and on the right I have altered it slightly to make the pin solder holes more obvious.
This plugs into the base of the iPod.
We do not use all 30 wires (phew!) but we do need some for:
a) Serial communication between Arduino and iPod.
b) To carry audio output to our line-out sockets and headphone socket.
c) Pin 21 has to be connected to GND (ground) via a 500kOhm resistor to "tell" the iPod it has been connected to an external device.
The secret is to take each aspect in turn, breaking the task into small chunks.
Step 5: Telling the IPod to Allow Itself to Be Remote Controlled: Pin 21 on PodBreakout.
This tells the iPod that it is connected to an external device.
Step 6: Summary of Main Groups of Arduino Pins Being Used.
Step 7: Level Converter Connecting Data Between Arduino and the PodBreakout Plug.
These all go to the 3Volt side of the Logic Level converter board (marked as the LV or "low voltage" side).
On Arduino side of this board which is at 5V (the HV or "high voltage" side) there are 4 corresponding wires going to Pins
on the Arduino board.
This logic level converter board is quite small so make sure you get it the right way around. To be honest I use one of those desk lamps with a magnifying glass in it.
Step 8: Wiring a Basic 4 X 20 LCD Display to the Arduino
It has 16 pins along one edge, many of which have to be wired to various pins on the Arduino.
Details of how to do this follows......
It also has a backlight so you can see it in the dark.
Step 9: Wiring Up the LCD Display to Arduino
I have used 4 colours for the groups of wires as they do different jobs.
15 and 15 are to do with the backlight. The 10 Ohm resistor gives reasonably bright backlight without drawing too much current from voltage regulator on the Arduino. Remember it is powering the RFID reader as well, and supplying current to keep the iPod charged too.
Pins 11,12,13,14 and also 4,5,6 on the LCD are used to create the characters on the display.
Power is supplied from arduino to pins 1 and 2 (GND and +5V respectively).
Finally, the voltage at Pin 7 on the LCD controls the contrast of the display. Without it you may well see nothing on the display at all.
A wire from the centre pin of the single 10k Ohm potentiometer is run to Pin 7 on the LCD.
The other two pins on the potentiometer are connected to +5V and GND on the Arduino. Turning the potentiometer knob alters voltage at Pin7 and so contrast of display can be adjusted.
Just be slow and methodical.
Step 10: Wiring Up the LCD Display to the Arduino
I solder wires sideways to pin-headers pushed into the rows of pin sockets on the Arduino. These are very low cost from sparkfun for example.
"Tin" the ends of the pins while they are pushed into the Arduino socket rows (stops plastic melting and pins moving slightly).
"Tin" ends of the wires, then you find they will solder together with just a dab of the soldering iron.
You see here everything is screwed to a wooden board and spaced out.
Step 11: Wiring ID-12 RFID Reader Module to the Arduino
The ID-12 can be soldered to a square circuit board (the ID-12 breakout board) designed to take it.
This makes attaching various wires much easier. This view is of the back of the breakout board.
Need to wire it up to the Arduino exactly as shown.
Pins 1, 10 (via a resistor and LED) and 7 on the ID-12 breakout board are ALL connected to a GND pin (any will do) on the Arduino.
Step 12: Arranging an Audio Output to Headphones and a Volume Control.
Pins 2,3,4 on the Pod Breakout plug cater for this.
Pins 3 and 4 go out to centre pins of each of the two 10k Ohm potentiometers on the "double" 10k potentiometer we are using as the volume control knob.
From the potentiometers they go to the outer small pins on the headphone socket.
Pin 2 on the Pod Breakout board runs to the large pin on most panel mount headphone sockets (the long one that sometimes also includes the tabs that grip the cable).
Step 13: Volume Control Double-potentiometer
Step 14: Wiring the 7 Wires From the Membrane Keypad to the Arduino
Why do we have a calculator style keypad?
When you add a new RFID card, the LCD display will ask you for the number of the song in the playlist on the iPod that you want this card to, in future, select when it is placed on the machine.
You therefore have to key in the number when asked (don't worry how to do this is all explained later), and to key in the number you need a keypad!
This one is great as is sticky backed, just cut a slot for the ribbon cable and then stick it down to the surface of your machine, however it is designed.
7 wires come out of the keypad and here is a diagram showing you which pins on the Arduino to connect them to. I extended mine with extra wire hence the grey wires on the Arduino header pins in my photo.
Step 15: View of Volume Double-potentiometer, Single Brightness Pot and Headphone Socket.
Step 16: Optional Extra Resistors to Allow IPod to Self-charge While Docked.
There is a way to trick the iPod into accepting a charging current from the Arduino that keeps the battery topped up all the time.
Without this everything will still work fine but the iPod will generate music using its own battery so you would need to charge it up every now and then as you would if using it normally.
By using resistors to create specific voltages at certain pins (16 and 25) on the Pod Breakout board, the iPod will then accept charge from the Arduino so the battery never runs flat........which avoids tantrums in small children if you accidentally leave it on all night!
Tricky bit is doing this neatly so the PodBreakout does not end up with resistors sticking out all over it, which get snapped off once it has been plugged into and out of the iPod a few times.
This is why I made a docking port and glued the PodBreakout board into it.
Step 17: Load Software Into the Arduino Mega 1280
First of all it only compiles in Arduino V22 not the newer V1.0
You can still download V22 of Arduino here:
You need to click where circled in red in image and then V22 will download to your computer.
Step 18: Arduino Code
I cannot attach it as a .pde as Instructables gets upset if I do that.
Load this sketch into your Arduino Mega 1280 using Arduino V22
Final thing is libraries, you need the following libraries in your library folder:
See next 4 pages for info on how to get each if you do not already have them.
Step 19: Arduino Libraries You Need
David Findlay has written some libraries which need to be downloaded, unzipped and added to your Arduino libraries folder.
This is a screenshot of part of my Arduino libraries folder, you can see the new folders added, all of which come bundled in the download.
The libraries are available via Github here:
Half way down the page on the right is a "Download" button. Click on it and download the .zip file.
Extract it, select and arrange the "AdvancedRemote" folder in your library as in my picture below.
Also look here for the same download:
Alternatively create a folder called AdvancedRemote inside the libraries folder of your Arduino V22 and paste the attached files into it (apart from the photo).
The EEPROM library, the Keypad library and LiquidCrystal libraries should already be there in the Arduino. If not copies are attached to next 3 pages.
Step 20: Liquid Crystal Library
If not present in the libraries folder of Arduino 22, create a folder called LiquidCrystal in the libraries folder of your Arduino 22.
Insert the following into it:
LiquidCrystal cpp file
LiquidCrystal h file
(all 3 are attached)
Step 21: EEPROM Library
EEPROM cpp file and
EEPROM h file.
Step 22: KeyPad Library
Keypad cpp file and
Keypad h file
Step 23: How to Create Playlist of Songs for the IPod Touch That the Cards Can Select Songs From
But, for those who don't here is my effort at showing you how to get your songs onto the iPod.
Or, just ask a 10 year old to show you how.
Here is the iPod Touch. It has a long thin plug socket along its lower end. This actually has 30 contacts in it which is why the PodBreakout plug is rather ugly and has 30 holes in the circuit board sticking out of the back of it.
Take the white cable that comes with it (and also iPhones and iPads) and plug one end into the iPod touch.......
Step 24: Insert Cable Into Laptop USB Port.
Step 25: Insert a CD Into Computer CD Drive
The iTunes software running on your computer creates the environment for you to do all this (free download).
Here I am putting a CD of a well known UK band into the CD drawer on the side of my laptop.
Shut the drive drawer and wait.
The iTunes software should have opened automatically on your laptop when you plugged in the iPod Touch a few moments ago.
Step 26: ITunes Asks If You Want to Add the Songs to Your ITunes Library
The answer is yes!
Step 27: Songs From CD Are Now in the ITunes Library on Your Computer
When done click on the "Music" icon under the "Library" heading on the upper left of the iTunes page. The Beatles songs we took off the CD are now sitting there in the library along with everything else you put there previously.
NOTE: This library of songs is at present on your computer, but not (yet) transferred to your attached iPod Touch.
Step 28: Create a Playlist on Your Computer in ITunes
Step 29: Here We Can See the Songs Are Now in the Playlist on the Computer
Here I have clicked on the playlist and there is a a set of songs in the playlist folder.
NOTE: You have to add new songs to the END of your existing iPodTouch playlist if you add more later on, else the numbering of all the previous tracks, and the RFID cards that you have set up to select them for playback, will all end up out of sync.
Step 30: Copy Playlist on Computer to the Attached IPod Touch
It now copies entire playlist, keeping the same playlist name, to the iPod.
Step 31: Preparing the RFID Cards. Note Playlist Number of Each Song You Want a Card For.
Open the playlist icon you now have for the attached iPod Touch.
We can see that among everything else there, the first song of our Beatles CD that we imported the music from, happens to be song number 227 in the playlist we made.
Write this down on a bit of paper, with the song name and album if you like.
Step 32: Example of First Track of an Album. Write Down the Playlist Number.
Here I have chosen a particular song by the legendary UK band "Thin Lizzy" so I need to write down the number/text 248 - Rocker,Thin Lizzy on my piece of paper.
Cards can be used to select albums by selecting the first song of any given album, or, as in this case, you can use a card just to select one song.
The machine will just play the whole playlist starting from the song selected by the RFID card so either approach will work.
Step 33: Write Down Playlist Numbers of All Tracks You Want Cards for (to Select These Tracks).
Step 34: Write Track Playlist Number on Each New RFID Card, Name of Song and Artist Etc.
Just use new RFID cards that have not already been "paired" with other songs in the playlist already, obviously.
Step 35: Detail View of an RFID Card
Step 36: Insert PodBreakout Plug Into IPod Touch
i.e. we need to go into "setup" mode.
First step is to make sure the iPodTouch has the PodBreakout plug inserted into it.
In this case the PodBreakout plug is embedded into my fancy docking port (second image), but so long as the plug is connected into the Ipod Touch, that is all that matters (see main image).
Step 37: Press RESET Button.
Press the reset button (or the little one directly mounted on the standard Arduino board) to restart the Arduino program.
Step 38: Press 5 to Add a New Card, or Wait and It Will Move to Playback Mode on Its Own.
NOTE: If you just wait it will timeout and enter playback mode anyway.
However as we want to "pair" our new RFID cards, we DO want to press the 5 key.
Step 39: In Newcard Setup Mode......are You Sure?
If you want you can add a little tray to upper surface to locate the RFID "bricks."
This could be a dish, a wooden salad bowl or anything you like really so long as the base is narrow and it is non-metallic, so the RFID brick always falls down so it comes to rest directly over the ID-12 RFID reader.
Step 40: Key 1 Is Erase All Cards and Start Again.......be Careful, Other Key = Carry on Add New Card
This is if you make a whole new different playlist for example with all new track numbers.
However, we are starting from scratch but adding new cards in sequence, so we are "adding to existing list" it is just that the existing list has no items in it at the moment.
So, we want to "add to the existing list."
Step 41: Put Fresh New Card on Reader, Press Any Key When Ready
So here we have placed our card over the ID-12 RFID reader module (under the white plastic), we want this card, in future, when placed over the reader, to select track number 227 in the iPod Touch playlist, which is the track called "Back in the USSR" by the Beatles (the well known UK band of yesteryear).
Step 42: Displays 10 Digit Tag Code of the Card
It should be the same as the 10 digit unique number printed on the card (if you really want to check).
Step 43: Then Asks You to Enter Playlist Number the New Card Is to Be "Paired" With
NOTE: Due to my dodgy programming, you have to enter 4 digits always.
So, track 57 would be entered as 0057
Here I have entered 0227 which is track 227 which is first track of the Beatles album we added to playlist before.
There is no "enter" key.
Just type the 4 digits then wait a moment for it to accept them.
Step 44: Asks You to Press 5 to Confirm "pairing" or Otherkey Means Have Another Attempt.
Press 5 and the details of this card, and what song it is associated or "paired" with are then stored in the Arduino memory.
If you press any other key you get another chance to "pair" pair this card (for example if you entered the playlist number wrongly and need to try again).
Step 45: Confirms Card Has Been Paired OK, Key 3 to Add Another New Card, Otherkey = End Setup
It confirms the last card was "paired" OK.
Press 3 to add a new card or any other key to end this setup process.
Step 46: Press Reset Button to Restart Machine, Do Not Press 5, Let It Enter Playback Mode.
Turn the iPod On (centre button on iPod), open the playlist, start any song in that playlist actually playing using the iPod screen.
Press reset button and wait.
You may have to do this a couple of times. Suddenly on the iPod screen you will see "Accessory connected" on display.
Once you get it to do that it will all be working.
Put an RFID card on the reader and away you go, you can select songs using RFID cards..
Step 47: From Now on Cards Will Select Tracks, Which Will Show in LCD Display
Step 48: Coffee Table Version.
Also, some of the pins on the Pod Breakout board carry the video outputs of the IPod Touch so at some point I may investigate possibility of using this method to select video clips with an attached TV.