Mar
23

iPhone RS232 at 1200 baud - no Jailbreak required, using 2.0 SDK
The iPhone has a modem. Did you know that? Well, not quite, but we managed to build a device that interfaces with an iPhone via the headphone/microphone jack and can send bidirectional serial data.
Though there are a number of ways to get data into and out of the iPhone - the dock connector, Bluetooth, Wi-Fi, etc. - none of these are well-suited for simple, low-speed bidirectional communication with inexpensive components. Plus, many of these were inaccessible via Apple's 2.0 SDK. The audio port, however, is accessible from the SDK - both for playing audio and recording it.
iPhone Hacks has the schematic for the circuit you see below.
The core of this solution is a souped up microcontroller, which has a serial port on one side and talks to the iPhone using FSK (frequency shift keying), the same technique used by some of the first modems. (Frequency shift keying uses a sequence of analog signals with alternating frequencies to send information. For example, in binary FSK a tone of 8kHz might represent '1', and 4kHz might represent '0'.)
For less than $20, we built a circuit that accomplished this, and wrote a corresponding iPhone application. Serial devices plugged into our circuit can communicate with any iPhone running our 2.0 code.
We will be releasing schematics and source code with the release of iPhone hacks.














on Tue, 03/24/2009 - 13:55
Is that a Scenix/Ubicom SX28 microcontroller? If not, what is it?
on Sat, 03/28/2009 - 15:45
Do you think it's possible to do something similar with the iPod touch? Because I have a targus IR keyboard from my psp. It would be sweet to get the same keyboard working with the ipod touch too ;)
on Fri, 04/10/2009 - 11:59
It's a Microchip PIC microcontroller.
on Thu, 05/07/2009 - 20:16
This is a very, very nice hack.
But I am having a little trouble figuring out which UART cable you used. I found this digikey page (the ftdichip site seems to ship from the UK) http://tinyurl.com/pfpb3h but I am not sure which cable is right. I am guessing it is this one http://tinyurl.com/on8oyg but it has a six pin connector and your board doesn't have a 6-pin header. Any help?
Also, as of this moment, I have not been able to order your $10 board from Droid supply. It fails with some weird FedEx error.
on Sat, 05/16/2009 - 07:42
[Comment removed: spam]
on Sat, 05/16/2009 - 07:47
As far as which UART, we simply put a two-pin header (tx/rx) and you make the corresponding pins of the adapter connect. The 6 pin connector, only two would be connected.
Did the fedex issue resolve?
on Mon, 05/18/2009 - 14:09
Yes, the FedEx problem was resolved by Droid and in fact I got my board yesterday.
on Mon, 05/18/2009 - 18:53
I have several questions about the board I bought from you for this project:
Which UART pin is RX and which is TX? There is nothing on the silkscreen to indicate.
Which end of the programming header is which? Again, nothing on the silkscreen to indicate.
There are pads for surface-mount phono jacks X4 and X5 but there is no indication what parts you designed those for.
The voltage regulator layout is clearly not for the part listed in the book and the one I bought.
Actually what would be really good is if you just supplied a BOM, complete with supplier and part numbers for every part on the board.
on Wed, 05/27/2009 - 22:06
The speed of this RS232 is only 1200 baud. Does it possible to increase to 9600 baud?? I am thinking to connect this serial to Cisco devices that need 9600 speed.
on Tue, 06/02/2009 - 19:02
Possible, but it depends on what the SDK allows them to do in terms of audio. The audio-processing algorithms/raw processor speed might not be up to handling sound processing on the fly with only ~.0001 seconds between one tone and the next.
on Tue, 06/02/2009 - 21:02
Ok re: the 1200 baud issue. In the keyboard firmware, we're actually reading the infrared keyboard (input only, not bidirectional) at 9600. Since the keypresses are brief, even sustained average bandwidth is under 1200 baud. Thus, someone could modify the firmware to decode 9600 baud input, as long as the average was below 1200 baud.
on Fri, 09/18/2009 - 01:59
We've tried the iPhone program installed with two iPhone. But, did not succeed the communication. Is there any special setting for the achievement? I checked the book but could not found any clue. Thank you your kind information in advance.
on Fri, 09/18/2009 - 02:05
IPhone receiver has no response, while iPhone sender sends beep sounds. (I used same program at the time.)
on Tue, 09/22/2009 - 23:03
I tried the serial modem example and could not reproduce the demonstration results. Anybody succeeded on OS version 3.0?
on Tue, 10/20/2009 - 06:40
Why didn't you use 3.3V power from iPhone's interface connector?
Is this possible in this schematic solution?
on Wed, 10/28/2009 - 06:27
this is a nice article.. Can you please guide me if i want to buy your device for serial communication using Audio Jack of iphone
on Wed, 12/09/2009 - 07:24
Thanks for your website. Those iPhone hacks rewritten in your blog are really awesome. I have found so many various tricks here, that no I am an iPhone specialists between my friends. Keep posting good stuff and making people happy. I have bookmarked your blog and will be waiting for nice articles to appear here in the future too.
Sincerely,
Glen Burdon from online payday loans
on Fri, 01/01/2010 - 14:13
Does the book explain how the source code works? Will it work with an iPhone Touch 2G? Thanks.
on Wed, 01/06/2010 - 03:03
Frequency Shift Keying (FSK) is the modulation technique used for digital modulation,but I didn't have any idea about its uses in iphones.But your experiment is excellent & very very innovative to hack iphone.I must take a look into it for details,thanks for sharing this beautiful information.
Subrat,
walkie talkie two way radios
on Sun, 01/10/2010 - 15:38
Any test sounds for FSK Terminal? I modified the source code to match Tin Can test sounds (baud rate 600, frequency for H/L signal 4000/2666, defined in FSKRecognizer.mm) , but it did not work. Actually it decoded characters from the sound, but these characters are not what I expected, not even similar to the original "The quick brown fox...".
on Sat, 01/16/2010 - 06:45
I got it. FSKRecognizer.mm should be modified to skip 2 bits (for parity & stop bit) to recognize Tin Can test sounds. Now the app recognizes LOW test sounds, but HIGHs are not. I don't know why...
on Sat, 01/16/2010 - 19:58
The FSK discriminator algorithm written for the book was only tested with frequencies that differed by at least a factor of 2. Tin Can uses a different algorithm that can distinguish frequencies that are much closer, so the 4000/2666 frequency pair does not present a problem for Tin Can. My guess would be that the published discriminator code might have trouble locking on to the bit pattern when it's only a 1.5x difference between the frequencies.
Another possibility: if you are using the built-in microphone to get the sound into the app, then you will have additional noise and distortion in the signal, which this algorithm cannot handle. Tin Can's algorithm was designed for over-the-air sound transmission and it can accept quite a bit of background noise without errors. The published code has only minimal noise rejection, so it requires a wired connection to the mic port to operate. The low-frequency test sounds might work with the microphone, but the high-frequency sounds would not.
on Fri, 01/29/2010 - 11:46
This article the work of the author's health. I have always followed this style of writing was sequel. I already saw the youtube video site video about it. also a member of a group I am in the facebook site. I would like to specify that descriptive See this article informed me more.
Thank you to the article author.
on Sun, 01/31/2010 - 02:18
This article the work of the author's health. I have always followed this style of writing was sequel. I already saw the youtube video site video about it. also a member of a group I am in the facebook site. I would like to specify that descriptive See this article informed me more.
Thank you to the article author.
Post new comment