An Arduino library for controlling iPods (and some features for the iPod app on iPhones and iPod Touches) via the Apple Accessory Protocol (AAP)
Clone or download
finsprings Merge pull request #10 from per1234/keywords-separator
Remove leading space from keywords.txt identifier
Latest commit e7e7505 Jul 17, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
AdvancedRemote.h Move library files to top-level, so that the library can be cloned di… Mar 2, 2014
SimpleRemote.cpp Move library files to top-level, so that the library can be cloned di… Mar 2, 2014


iPodSerial Apple Accessory Protocol (AAP) Arduino library.

This library lets an Arduino interact with an iPod, or some features of the iPod application on the iPhone and iPod Touch*,  via the serial AAP protocol through the iPod's dock connector.

See for more details of AAP. I used during development but it seems to be stale now. The one has the correct format of the Advanced Remote polling response, for example, and the version does not.

The library sends commands via serial to the iPod and listens for responses. If and when responses come back over serial from the iPod, the library parses them and passes the data to callback functions provided by the user of the library. Responses are received asynchronously, and so the calling code is not blocked waiting for the iPod to respond; therefore it can continue to blink lights, scroll a display, poll buttons, or whatever.

If you have an Arduino Mega you can take advantage of its multiple serial ports to have debugging messages out one serial port and communication with the iPod on another. The library provides setup functions to let you do this. You could probably also use SoftwareSerial for this.

The library consists of three classes: SimpleRemote, AdvancedRemote and iPodSerial. iPodSerial is a common base class for the other two; it does the low-level protocol stuff to talk to the iPod.

The SimpleRemote class implements AAP Mode 2, aka iPod Remote, aka Simple Remote. This lets you send commands like play/pause, change the volume, etc, but also still control the iPod via its own interace. This is the mode I used for my in-car remote, the write up for which is at

The AdvancedRemote class implements AAP Mode 4, aka Advanced Remote. Be aware that in Advanced Remote mode the iPod will display a large checkmark and the message "OK to disconnect"; in this mode you cannot control the iPod via its own interface so you need to do everything from your Arduino sketch. Advanced Remote has more options though, like being able to put the iPod in polling mode, where it will send you back the currently-playing track's elapsed time every 500ms; you could use this to update a display controlled by your Arduino (I'm thinking nixie tubes with the arduinix shield would be cool!).

NOTE: When connecting your iPod to your Arduino, please double-check your wiring. iPods are expensive and you don't want to break yours by sending it too high a voltage or whatever. You use this library at your own risk etc.

* On my iPhone 3GS and my wife's iPhone 3G I get the "This accessory is not made to work with iPhone" popup and occasionally the longer error message that asks if you want to put it into Airplane mode. Advanced Mode commands don't work. Simple Remote commands do seem to work fine though.