Reputation: 26271
I have a small device which connects to a battery powered monitor. When I turn the wheel on the device, the monitor displays information such as when you started turning the wheel and how fast the wheel is turning. I believe the device is sending some sort of magnetic pulse or something through the 3.5 mm audio jack.
Instead of connecting the device to its original monitor, I want to connect it to my iPhone and read in the same data. The cord has a 3.5 mm audio jack at the end and fits in the iPhone normally like a headphone.
I have looked into projects like HiJack but am unsure of how to use the data I receive (or where the data is actually coming from when I do receive it), or if I can even use it in this circumstance.
Can I read data in (to the iPhone) from an external device through the iPhone's audio jack?
If yes, what frameworks/libraries do you suggest I look into?
I have looked into AurioTouch by Apple, but it seems rather complicated and isn't very straightforward.
Upvotes: 36
Views: 23464
Reputation: 11
Check ArduCom project. Its transfering serial data over iPhone headjack. www.youtube.com/watch?v=ROMvwrd0Au8
Upvotes: 1
Reputation: 51
I found one framework http://www.crudebyte.com/jack-ios/sdk/ but to be honest didn't try it. Seems like they have some sample code inside of binary and the last update date of the lib was in 2013-06-07, so seems like the work is going there.
Upvotes: 2
Reputation: 101
Yes, it is possible to use the iPhone 3.5 mm (1/8") headphone/mic jack as a data input, as has been demonstrated by the HiJack project - which also powers the input device.
The key, as Dominik Selbold has pointed out, is that the incoming data must be modulated at frequencies within the passband of the iPhone microphone input. Although many have suggested that this limits the data rate, in fact 19 kHz audio is a very wideband signal, capable of dozens of kilobits per second.
For example, in 2008, Jonti Olds demonstrated how using Quadrature Amplitude Modulation at audio frequencies could stream TV sound and picture between two computers,using their audio cards. What would be needed on the iPhone would be to develop a QAM demodulator for the audio input - using the FFT library - to demodulate QAM audio modulated video back into digital video - like H.264 - probably at 1/4 VGA resolution. NTSC Composite video is already QAM, but at a much higher bandwidth; about 5 MHz.
If you search the web for JQAM, you can find Mr. Olds project and code. IMHO, this would be a very cool project to tackle on iPhone or Android.
Upvotes: 10
Reputation: 15669
If it is of any relevance, I am using the HiJack project from the University of Michigan. You can find the source here. The code is mainly written in C++, it has some bugs and yes, it is version 0.1, but if you dig in the code, you will find some interesting information regardng this matter.
Upvotes: 2
Reputation: 9866
Look out for SpeakHere application if it helps and not finding any complexity... because this also works same as AurioTouch but somewhat simpler than that..
This will be much more straightforward that you are talking about if you only need to record audio.... best of luck...
Upvotes: 4
Reputation: 2469
You can read any data through the iPhone's headjack, if the bandwidth of the signal fits into the bandwidth of the iPhone's A/D-converter, which is about 20Hz to 20kHz.
Upvotes: 5