iPod Interface Pins from pinouts.ru:
Used in 3rd and later generation iPods for charging, connecting to a PC via USB or Firewire, to a stereo via line-out, to a serial device (controlled via the Apple Accessory Protocol). This connector exists in all Apple iPod MP3 player (iPod 1G, 2G, 3G, 4G, 5G, Nano)
| Pin | Signal | Description |
| 1 | GND | Ground (-), internaly connected with Pin 2 on iPod motherboard |
| 2 | GND | Audio & Video ground (-), internaly connected with Pin 2 on iPod motherboard |
| 3 | Right | Line Out - R (+) (Audio output, right channel) |
| 4 | Left | Line Out - L(+) (Audio output, left channel) |
| 5 | Right In | Line In - R (+) |
| 6 | Left In | Line In - L (+) |
| 8 | Video Out | Composite video output (only when slideshow active on iPod Photo) |
| 9 | S-Video Chrominance output | for iPod Color, Photo only |
| 10 | S-Video Luminance output | for iPod Color, Photo only |
| 11 | GND | Serial GND |
| 12 | Tx | ipod sending line, Serial TxD |
| 13 | Rx | ipod receiving line, Serial RxD |
| 15 | GND | Ground (-), internaly connected with pin 16 on iPod motherboard |
| 16 | GND | USB GND (-), internaly connected with pin 15 on iPod motherboard |
| 18 | 3.3V | 3.3V Power (+) Stepped up to provide +5 VDC to USB on iPod Camera Connector. If iPod is put to sleep while Camera Connector is present, +5 VDC at this pin slowly drains back to 0 VDC. |
| 19,20 | +12V | Firewire Power 12 VDC (+) |
| 21 | Accessory Indicator/Serial enable |
Different resistances indicate accessory type: 1kOhm - iPod docking station, beeps when connected 10kOhm - Takes some iPods into photo import mode 500kOhm - related to serial communication / used to enable serial communications Used in Dension Ice Link Plus car interface 1MOhm - Belkin auto adaptor, iPod shuts down automatically when power disconnected Connecting pin 21 to ground with a 1MOhm resistor does stop the ipod when power (i.e. Firewire-12V) is cut. Looks to be that when this pin is grounded it closes a switch so that on loss of power the Ipod shuts off. Dock has the same Resister. |
| 22 | TPA (-) | FireWire Data TPA (-) |
| 23 | 5 VDC (+) | USB Power 5 VDC (+) |
| 24 | TPA (+) | FireWire Data TPA (+) |
| 25 | Data (-) | USB Data (-) |
| 26 | TPB (-) | FireWire Data TPB (-) |
| 27 | Data (+) | USB Data (+) Pins 25 and 27 may be used in different manner. To force the iPod 5G to charge in any case, when ‘USB Power 5 VDC’ (pin 23) is fed, 25 must be connected to 5V through a 10kOhm resistor, and 27 must be connected to the Ground (for example: pin 1) with a 10kOhm resistor. |
| 28 | TPB (+) | FireWire Data TPB (+) |
| 29,30 | GND | FireWire Ground (-) |
Back side of dock connector; 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29
Pins 1,2 connected on motherboard.
Pins 15,16 connected on motherboard.
Pins 19,20 connected on motherboard.
Pins 29,30 connected on motherboard.If you disassemble the original apple-ipod-dock-connector-cable and look at the connector itself, on the back side, where it is soldered, you can see the number 1 and 30 (e.g. pin 1 and 30). In this description NUMBERING is INVERSED: pin 1 is pin 30 and pin 30 is pin 2, so, don’t look at numbers on connector.
The remote control, iTalk and other serial devices use Apple Accessory Protocol for communication with iPOD. This protocol was introduced with the 3rd generation iPods, and is also compatible with the 4th generation iPods and mini iPods.
The connections uses a standard 8N1 (one startbit 8 data bits 1 Stopbit) serial protocol, 19200 baud (higher rates up to 57600 also possible, but speed faster than 38400 may cause problems with large amounts of data), delay of 12 microseconds inserted between end of the stopbit and the beginning of the next startbit (also working without this delay).
Electrical: high +3,3V low 0V
default line state: high. Codes used for communication with peripherals are hereThis device may be connected to the firewire computer port by straight cable (TPB+/-, TPA +/- shoulde be twisted pairs in cable)
The Apple Accessory Protocol is used for communication between the iPod and serially connected accessories (such as the Remote, iTalk etc). The protocol was introduced with the 3rd generation iPods, and at present it is assumed is also compatible with the 4th generation iPods and mini iPods. (The Dock Connector provides access to this communication channel as well.)
The connections uses a standard 8N1 serial protocol. The original speed rate is 19200 baud - higher rates (up to 57600 baud) work properly (tested the 5G) but make trouble sending large amounts of data (picture blocks) faster than 38400 baud.
The request and response messages follow this general form.
| field | size | value |
|---|---|---|
| header | 2 | 0xFF 0×55 |
| length | 1 | size of mode + command + parameter |
| mode | 1 | the mode the command is referring to |
| command | 2 | the two byte command |
| parameter | 0..n | optional parameter, depending on the command |
| checksum | 1 | 0xXX - (8 bit additive checksum) ( (sum of all length/mode/command/parameter bytes) & 0xFF) |
The mode in the message indicates which mode the command belongs to, these same mode values are used in the mode switching command below.
| Mode Number | Purpose |
|---|---|
| 0×00 | Mode switching |
| 0×01 | Voice Recorder |
| 0×02 | Simple Remote |
| 0×03 | Request Mode Status |
| 0×04 | AiR Mode |
| 0×09 | Nike+ Mode |
| Command | Purpose |
|---|---|
| 0×01 0×01 | Switch to Voice Recorder mode (not working on 5G) |
| 0×01 0×02 | Switch to iPod Remote mode |
| 0×01 0×04 | Switch to AiR mode |
| 0×03 | Get current mode status |
| 0×04 0xXX | (response) the current mode number (0xXX is the mode returned by the iPod), 0×04 0×01 could also be an indicator that the iPod is currently busy - I frequently get this skipping tracks very fast — this info is not 100% correct, I´m getting different responses. Will try to work this out later. |
| 0×05 | Switch to AiR mode (same as 0×01 0×04?) |
| 0×06 | Switch to iPod Remote mode (same as 0×01 0×02?) |
For example, to switch to AiR mode the following bytes are sent:
0xFF 0x55 0x03 0x00 0x01 0x04 0xF8
| Command | Purpose |
|---|---|
| 0×00 0×00 | Button Released |
| 0×00 0×01 | Play |
| 0×00 0×02 | Vol+ |
| 0×00 0×04 | Vol- |
| 0×00 0×08 | Skip> |
| 0×00 0×10 | Skip< |
| 0×00 0×20 | Next Album |
| 0×00 0×40 | Previous Album |
| 0×00 0×80 | Stop |
| 0×00 0×00 0×01 | Play (just play, no pause) |
| 0×00 0×00 0×02 | Pause (just pause, no play) |
| 0×00 0×00 0×04 | Mute (toggle) |
| 0×00 0×00 0×20 | Next Playlist |
| 0×00 0×00 0×40 | Previous Playlist |
| 0×00 0×00 0×80 | Toggles Shuffle |
| 0×00 0×00 0×00 0×01 | Toggles Repeat |
| 0×00 0×00 0×00 0×04 | Ipod Off |
| 0×00 0×00 0×00 0×08 | Ipod On |
| 0×00 0×00 0×00 0×40 | Menu Button |
| 0×00 0×00 0×00 0×80 | OK/Select Button |
| 0×00 0×00 0×00 0×00 0×01 | Scroll Up |
| 0×00 0×00 0×00 0×00 0×02 | Scroll Down |
Faludi’s Arduino and XBee battery test
Faludi and Shiffman’s Xbee library for Processing
TIgoe’s RSSI graphing code
Arduino + Xbee schematics
Code from Daniel Liss:
the SEND xbee side is like this:
+++OK
atid
(your id)
atmy
1
atdl
2
atit
1
atir
3E8
atd0
3
atd1
0
note: that will read a pin and send junk values to the receive xbee,
which is all you need. you then have to extract the proper byte from
everything sent over. you can do that in arduinolandia.
this is the meat of how i do that. there are prolly more elegant ways
to look for that byte, but i like the simple, don’t you?
// warning i pulled out a bunch of stuff you didn’t need, so some of
these variables won”t make sense for you
int incoming = 0;
boolean firstConnect = true;
boolean countNow = false;
int ledpin = 13;
int green = 2;
int yellow = 3;
int red = 5;
int counter = 0;
int value;int servoPin = 9; // Control pin for servo motor
int otherPin = 10;
int stepping = 0;long lastPulse = 0; // the time in milliseconds of the last pulse
int refreshTime = 20; // the time needed in between pulsesint analogValue = 0; // the value returned from the analog sensor
int analogPin = 0; // the analog pin that the sensor’s on
int otherValue = 0;
int wait = 0;void setup()
{
Serial.begin(9600);
pinMode(green, OUTPUT);
pinMode(yellow, OUTPUT);
pinMode(red, OUTPUT);
Serial.begin(9600);
digitalWrite (ledpin, HIGH);
delay(200);
digitalWrite(ledpin, LOW);
}void loop()
{
digitalWrite(8,HIGH);
if (firstConnect) {
Serial.print(”+++”);
delay (300);
Serial.print(”ATDB”);
delay (300);
}if (Serial.available() > 0) {
firstConnect= false;
incoming = Serial.read();if (incoming == 126){ // find teh start byte
countNow = true;
}if (countNow) { // count til you get what you want
counter++;
}if (counter == 7) { // finding the proper bite for signal strength
countNow = false;
counter = 0;
value = incoming;//do stuff, with your new friend “value” such as the following, but better
if (value < 10) {
digitalWrite(green,HIGH);
digitalWrite(yellow,LOW);
digitalWrite(red,LOW);
}
else if (value <=60){
digitalWrite(green,LOW);
digitalWrite(yellow,HIGH);
digitalWrite(red,LOW);
}else {
digitalWrite(green,LOW);
digitalWrite(yellow,LOW);
digitalWrite(red,HIGH);
}
//Serial.println(value,DEC);
}}
Rosie Daniel’s info on using Arduino and iPod
pinouts.ru
Controlling an iPod Using an Atmel Mega32
first info on Apple Accessory Protocol by Christoph
AdrianGame - more info on Apple Accessory Protocol