Skip to content

iDevice Serial Communication

Chris Jones edited this page Jan 17, 2019 · 3 revisions

Objective

To communicate an Arduino microcontroller to an iPhone 3GS using serial communication.

Requirements

  • iOS device (jailbroken)
  • Arduino
  • Dock connector
  • cable 24 gauge (preferred)
  • soldering iron
  • solder flux
  • PATIENCE

Useful Links

Setup

  • iDevice - iPhone 3GS - iOS 5.1.1 - jailbreak - Absinthe
  • Arduino Duemilanova

Wiring

  • I have a wire going from the TX on the Arduino going to a breadboard.
  • I have a wire going from the GND on the Arduino to the breadboard.
  • I am using two resistors to create a voltage divider outputting a voltage of ~ 3VDC
  • pin 13 is hooked up to the ~ 3VDC, and pin 15 on the dock connector is hooked up to GND.
  • the Arduino has RX / TX pins which send and receive TTL serial data

Arduino Sketch

void setup() {
  Serial.begin(9600);
}

void loop() {  
  Serial.println("Hello World!");
  delay(1000);
}

Soldering > Dock Connector

⚠️ I'd recommend having a 3rd hand, sheet of paper, and masking tape.

📸 iphone dock connector soldering iphone dock connector soldering

Testing serial receive RX communication on an iPhone

  1. jailbreak iDevice
  2. install cydia
  3. search for minicom within cydia
  4. install minicom
  5. launch the minicom with the root user
  6. set serial port to /dev/tty.iap
  7. change baud rate to 9600
  8. turn off hardware / software flow control

Procedure

  1. hook serial TX on Arduino to pin 13 on iPhone
  2. hook serial RX on Arduino to pin 12 on iPhone
  3. installed a 1K resistor between the Arduino serial TX and pin 13 on iPhone
  4. run the command cat /dev/tty.iap 9600 to output the message the Arduino is sending on the iPhone screen.

Notes

  • jailbroken apps are installed in the following directory
/private/var/stash/
  • app store apps are installed in the following directory
/private/var/mobile/Applications/

⚠️ Both the serial RX and TX need to be hooked up on an iPhone in order to receive serial messages on an iPhone.